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_URL
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
It is possible that users might have multiple licenses installed.void
disable()
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) int
This 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.boolean
boolean
This method checks whether there is any license with any valid subject installed.boolean
licenseIsValid
(String subject) Check if an installed license with the given subject is valid or not.void
reset()
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: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 interfaceLicenseService
- 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 interfaceLicenseService
- Returns:
- true if any license with any valid subject is installed.
-
licenseIsValid
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 interfaceLicenseService
- Returns:
- true if the license with the given subject is valid.
-
getLicenseInfo
- Specified by:
getLicenseInfo
in interfaceLicenseService
- Returns:
- a string representation of the license(s) installed for display in logs, etc.
-
getLicenseInfoObject
- Specified by:
getLicenseInfoObject
in interfaceLicenseService
- Returns:
-
installLicense
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 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: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 interfaceLicenseService
-
reset
public void reset()Description copied from interface:LicenseService
Delete any cached, installed licenses currently tracked by the implementation.- Specified by:
reset
in interfaceLicenseService
-
licenseIsAboutToExpire
public boolean licenseIsAboutToExpire()- Specified by:
licenseIsAboutToExpire
in 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:LicenseService
It is possible that users might have multiple licenses installed. In that case, this will return the lowest number.- Specified by:
daysTilExpiration
in 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:LicenseService
Get the expiration date of the installed license.- Specified by:
getExpirationDate
in interfaceLicenseService
- Returns:
- the expiration date, or null if no license can be found
-
getInvalidLicenseMessage
- Specified by:
getInvalidLicenseMessage
in interfaceLicenseService
-
getLicenseKey
- Specified by:
getLicenseKey
in interfaceLicenseService
-