Class GetLease

  • All Implemented Interfaces:
    IDatabaseSupplier<java.lang.Boolean>
    Direct Known Subclasses:
    GetLeasePostgresql

    public class GetLease
    extends java.lang.Object
    implements IDatabaseSupplier<java.lang.Boolean>
    Obtain a lease for this instance of the schema update tool. Only the tool holding the lease is allowed to modify the schema.
    • Constructor Summary

      Constructors 
      Constructor Description
      GetLease​(java.lang.String adminSchema, java.lang.String schemaName, java.lang.String host, java.lang.String leaseId, java.time.Instant leaseUntil)
      Public constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getInsertSQL​(java.lang.String adminSchema)
      Get the insert statement
      java.lang.Boolean run​(IDatabaseTranslator translator, java.sql.Connection c)
      Execute the statement using the connection and return the value
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GetLease

        public GetLease​(java.lang.String adminSchema,
                        java.lang.String schemaName,
                        java.lang.String host,
                        java.lang.String leaseId,
                        java.time.Instant leaseUntil)
        Public constructor
        Parameters:
        adminSchema -
        schemaName -
        host -
        leaseId -
        leaseUntil -
    • Method Detail

      • getInsertSQL

        protected java.lang.String getInsertSQL​(java.lang.String adminSchema)
        Get the insert statement
        Returns:
      • run

        public java.lang.Boolean run​(IDatabaseTranslator translator,
                                     java.sql.Connection c)
        Description copied from interface: IDatabaseSupplier
        Execute the statement using the connection and return the value
        Specified by:
        run in interface IDatabaseSupplier<java.lang.Boolean>
        Parameters:
        translator - to translate any exceptions