Package liquibase.license
Class OSSLicenseService
java.lang.Object
liquibase.license.OSSLicenseService
- All Implemented Interfaces:
LicenseService,Plugin
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.
-
Field Summary
Fields inherited from interface liquibase.license.LicenseService
BASE_INVALID_LICENSE_MESSAGE, END_INVALID_LICENSE_MESSAGE, TRIAL_LICENSE_URLFields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintIt is possible that users might have multiple licenses installed.voiddisable()Disable this LicenseService This can be used to turn off license checking after it has been determined that a license key is not validGet the expiration date of the installed license.getInvalidLicenseMessage(String[] commandNames) intThis method returns a priority value for an implementation.installLicense(Location... locations) 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.booleanbooleanThis method checks whether there is any license with any valid subject installed.booleanlicenseIsValid(String subject) Check if an installed license with the given subject is valid or not.voidreset()Delete any cached, installed licenses currently tracked by the implementation.
-
Constructor Details
-
OSSLicenseService
public OSSLicenseService()
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:LicenseServiceThis 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:
getPriorityin interfaceLicenseService- Returns:
- int
-
licenseIsInstalled
public boolean licenseIsInstalled()Description copied from interface:LicenseServiceThis method checks whether there is any license with any valid subject installed.- Specified by:
licenseIsInstalledin interfaceLicenseService- Returns:
- true if any license with any valid subject is installed.
-
licenseIsValid
Description copied from interface:LicenseServiceCheck 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:
licenseIsValidin interfaceLicenseService- Returns:
- true if the license with the given subject is valid.
-
getLicenseInfo
- Specified by:
getLicenseInfoin interfaceLicenseService- Returns:
- a string representation of the license(s) installed for display in logs, etc.
-
getLicenseInfoObject
- Specified by:
getLicenseInfoObjectin interfaceLicenseService- Returns:
-
installLicense
Description copied from interface:LicenseServiceGiven 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:
installLicensein interfaceLicenseService- 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:LicenseServiceDisable 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:
disablein interfaceLicenseService
-
reset
public void reset()Description copied from interface:LicenseServiceDelete any cached, installed licenses currently tracked by the implementation.- Specified by:
resetin interfaceLicenseService
-
licenseIsAboutToExpire
public boolean licenseIsAboutToExpire()- Specified by:
licenseIsAboutToExpirein interfaceLicenseService- Returns:
- true if any installed license is valid but will expire within the next 30 days.
-
daysTilExpiration
public int daysTilExpiration()Description copied from interface:LicenseServiceIt is possible that users might have multiple licenses installed. In that case, this will return the lowest number.- Specified by:
daysTilExpirationin interfaceLicenseService- Returns:
- the number of whole days until the license expires. Negative numbers would indicate that the license expired that many days ago.
-
getExpirationDate
Description copied from interface:LicenseServiceGet the expiration date of the installed license.- Specified by:
getExpirationDatein interfaceLicenseService- Returns:
- the expiration date, or null if no license can be found
-
getInvalidLicenseMessage
- Specified by:
getInvalidLicenseMessagein interfaceLicenseService
-
getLicenseKey
- Specified by:
getLicenseKeyin interfaceLicenseService
-