Package com.xebialabs.license.service
Class AbstractLicenseService
- java.lang.Object
-
- com.xebialabs.license.service.BaseLicenseService
-
- com.xebialabs.license.service.AbstractLicenseService
-
- All Implemented Interfaces:
com.xebialabs.license.service.LicenseService
- Direct Known Subclasses:
LicenseServiceImpl,RegistrationLicenseService
public abstract class AbstractLicenseService extends BaseLicenseService implements com.xebialabs.license.service.LicenseService
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.String>allowedEditionsprotected java.util.Collection<com.xebialabs.license.LicenseType>allowedLicenseTypesprotected Clockclockprotected com.xebialabs.license.Licenselicenseprotected java.io.FilelicenseFileprotected static org.slf4j.Loggerlogprotected java.lang.Stringproductprotected com.xebialabs.deployit.repository.RepositoryMetadataServicerepositoryMetadataService-
Fields inherited from class com.xebialabs.license.service.BaseLicenseService
ciCounter, ciCounterFactory
-
-
Constructor Summary
Constructors Constructor Description AbstractLicenseService(java.lang.String licensePath, java.lang.String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService)AbstractLicenseService(java.lang.String licensePath, java.lang.String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService, Clock clock)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.xebialabs.license.LicensegetLicense()java.lang.StringgetProduct()org.joda.time.PeriodgetValidPeriod()voidinitialize(com.xebialabs.license.service.LicenseCiCounterFactory ciCounterFactory)protected booleanisAllowedLicenseType(com.xebialabs.license.License license)booleanisLicenseExpired()protected booleanisValidEdition(com.xebialabs.license.License license)protected voidlogLicenseEditionError(com.xebialabs.license.License license)protected voidlogLicenseError(java.io.File licenseFile)protected voidlogLicenseVersionError(com.xebialabs.license.License license)protected abstract com.xebialabs.license.LicensereadLicense(java.io.File licenseFile)voidreload()voidvalidate()voidvalidate(com.xebialabs.license.License license)protected voidvalidateLicenseProperties(com.xebialabs.license.License license)-
Methods inherited from class com.xebialabs.license.service.BaseLicenseService
getCounter, initialize, reLoadCiCounter, rollbackTransaction, startTransaction
-
-
-
-
Field Detail
-
log
protected static final org.slf4j.Logger log
-
allowedLicenseTypes
protected final java.util.Collection<com.xebialabs.license.LicenseType> allowedLicenseTypes
-
clock
protected final Clock clock
-
licenseFile
protected final java.io.File licenseFile
-
product
protected final java.lang.String product
-
allowedEditions
protected final java.util.Set<java.lang.String> allowedEditions
-
license
protected com.xebialabs.license.License license
-
repositoryMetadataService
protected com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService
-
-
Constructor Detail
-
AbstractLicenseService
public AbstractLicenseService(java.lang.String licensePath, java.lang.String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService)
-
AbstractLicenseService
public AbstractLicenseService(java.lang.String licensePath, java.lang.String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService, Clock clock)
-
-
Method Detail
-
initialize
public void initialize(com.xebialabs.license.service.LicenseCiCounterFactory ciCounterFactory)
- Specified by:
initializein interfacecom.xebialabs.license.service.LicenseService
-
logLicenseError
protected void logLicenseError(java.io.File licenseFile)
-
logLicenseVersionError
protected void logLicenseVersionError(com.xebialabs.license.License license)
-
logLicenseEditionError
protected void logLicenseEditionError(com.xebialabs.license.License license)
-
getProduct
public java.lang.String getProduct()
- Specified by:
getProductin interfacecom.xebialabs.license.service.LicenseService
-
isLicenseExpired
public boolean isLicenseExpired()
- Specified by:
isLicenseExpiredin interfacecom.xebialabs.license.service.LicenseService
-
getValidPeriod
public org.joda.time.Period getValidPeriod()
- Specified by:
getValidPeriodin interfacecom.xebialabs.license.service.LicenseService
-
validate
public void validate() throws com.xebialabs.license.LicenseViolationException- Specified by:
validatein interfacecom.xebialabs.license.service.LicenseService- Overrides:
validatein classBaseLicenseService- Throws:
com.xebialabs.license.LicenseViolationException
-
validate
public void validate(com.xebialabs.license.License license) throws com.xebialabs.license.LicenseViolationException- Specified by:
validatein interfacecom.xebialabs.license.service.LicenseService- Overrides:
validatein classBaseLicenseService- Throws:
com.xebialabs.license.LicenseViolationException
-
reload
public void reload() throws com.xebialabs.license.LicenseViolationException, com.xebialabs.license.LicenseParseException- Specified by:
reloadin interfacecom.xebialabs.license.service.LicenseService- Throws:
com.xebialabs.license.LicenseViolationExceptioncom.xebialabs.license.LicenseParseException
-
getLicense
public com.xebialabs.license.License getLicense()
- Specified by:
getLicensein interfacecom.xebialabs.license.service.LicenseService
-
validateLicenseProperties
protected void validateLicenseProperties(com.xebialabs.license.License license) throws com.xebialabs.license.LicenseViolationException- Throws:
com.xebialabs.license.LicenseViolationException
-
isValidEdition
protected boolean isValidEdition(com.xebialabs.license.License license)
-
isAllowedLicenseType
protected boolean isAllowedLicenseType(com.xebialabs.license.License license)
-
readLicense
protected abstract com.xebialabs.license.License readLicense(java.io.File licenseFile) throws com.xebialabs.license.LicenseParseException, com.xebialabs.license.LicenseViolationException- Throws:
com.xebialabs.license.LicenseParseExceptioncom.xebialabs.license.LicenseViolationException
-
-