Class OSSLicenseService

java.lang.Object
liquibase.license.OSSLicenseService
All Implemented Interfaces:
LicenseService, Plugin

public class OSSLicenseService extends Object implements LicenseService
No-op LicenseService implementation for OSS distribution. This provides a consistent "invalid license" response instead of null, allowing Pro features to properly fail with appropriate error messages.
  • Constructor Details

    • OSSLicenseService

      public OSSLicenseService()
  • Method Details

    • getPriority

      public int getPriority()
      Description copied from interface: LicenseService
      This method returns a priority value for an implementation. Liquibase uses this to determine which LicenseService is currently in use. There can only be a single LicenseService used at a time, and the highest priority implementation wins.
      Specified by:
      getPriority in interface LicenseService
      Returns:
      int
    • licenseIsInstalled

      public boolean licenseIsInstalled()
      Description copied from interface: LicenseService
      This method checks whether there is any license with any valid subject installed.
      Specified by:
      licenseIsInstalled in interface LicenseService
      Returns:
      true if any license with any valid subject is installed.
    • licenseIsValid

      public boolean licenseIsValid(String subject)
      Description copied from interface: LicenseService
      Check if an installed license with the given subject is valid or not. The set of subjects that are valid is defined by the implementation.
      Specified by:
      licenseIsValid in interface LicenseService
      Returns:
      true if the license with the given subject is valid.
    • getLicenseInfo

      public String getLicenseInfo()
      Specified by:
      getLicenseInfo in interface LicenseService
      Returns:
      a string representation of the license(s) installed for display in logs, etc.
    • getLicenseInfoObject

      public LicenseInfo getLicenseInfoObject()
      Specified by:
      getLicenseInfoObject in interface LicenseService
      Returns:
    • installLicense

      public LicenseInstallResult installLicense(Location... locations)
      Description copied from interface: LicenseService
      Given a list of potential locations that a license file could be located, check each one and install any .lic files that are found there, iterating until a valid license is installed successfully or all the locations have been tried. After calling this method, clients still need to check licenseIsValid().
      Specified by:
      installLicense in interface LicenseService
      Parameters:
      locations - - A variable number of Location objects, each of which has a name, a type, and a value.
      Returns:
      A data structure that contains an overall exit code plus a list of strings that detail the locations checked and the result of checking each location.
    • disable

      public void disable()
      Description copied from interface: LicenseService
      Disable this LicenseService This can be used to turn off license checking after it has been determined that a license key is not valid
      Specified by:
      disable in interface LicenseService
    • reset

      public void reset()
      Description copied from interface: LicenseService
      Delete any cached, installed licenses currently tracked by the implementation.
      Specified by:
      reset in interface LicenseService
    • licenseIsAboutToExpire

      public boolean licenseIsAboutToExpire()
      Specified by:
      licenseIsAboutToExpire in interface LicenseService
      Returns:
      true if any installed license is valid but will expire within the next 30 days.
    • daysTilExpiration

      public int daysTilExpiration()
      Description copied from interface: LicenseService
      It is possible that users might have multiple licenses installed. In that case, this will return the lowest number.
      Specified by:
      daysTilExpiration in interface LicenseService
      Returns:
      the number of whole days until the license expires. Negative numbers would indicate that the license expired that many days ago.
    • getExpirationDate

      public Date getExpirationDate()
      Description copied from interface: LicenseService
      Get the expiration date of the installed license.
      Specified by:
      getExpirationDate in interface LicenseService
      Returns:
      the expiration date, or null if no license can be found
    • getInvalidLicenseMessage

      public String getInvalidLicenseMessage(String[] commandNames)
      Specified by:
      getInvalidLicenseMessage in interface LicenseService
    • getLicenseKey

      public ConfiguredValue<String> getLicenseKey()
      Specified by:
      getLicenseKey in interface LicenseService