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 Details

    • log

      protected static final org.slf4j.Logger log
    • allowedLicenseTypes

      protected final Collection<com.xebialabs.license.LicenseType> allowedLicenseTypes
    • clock

      protected final Clock clock
    • licenseFile

      protected final File licenseFile
    • product

      protected final String product
    • allowedEditions

      protected final Set<String> allowedEditions
    • license

      protected com.xebialabs.license.License license
    • repositoryMetadataService

      protected com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService
  • Constructor Details

    • AbstractLicenseService

      public AbstractLicenseService(String licensePath, String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService)
    • AbstractLicenseService

      public AbstractLicenseService(String licensePath, String product, com.xebialabs.deployit.repository.RepositoryMetadataService repositoryMetadataService, Clock clock)
  • Method Details

    • initialize

      public void initialize(com.xebialabs.license.service.LicenseCiCounterFactory ciCounterFactory)
      Specified by:
      initialize in interface com.xebialabs.license.service.LicenseService
    • logLicenseError

      protected void logLicenseError(File licenseFile)
    • logLicenseVersionError

      protected void logLicenseVersionError(com.xebialabs.license.License license)
    • logLicenseEditionError

      protected void logLicenseEditionError(com.xebialabs.license.License license)
    • getProduct

      public String getProduct()
      Specified by:
      getProduct in interface com.xebialabs.license.service.LicenseService
    • isLicenseExpired

      public boolean isLicenseExpired()
      Specified by:
      isLicenseExpired in interface com.xebialabs.license.service.LicenseService
    • getValidPeriod

      public org.joda.time.Period getValidPeriod()
      Specified by:
      getValidPeriod in interface com.xebialabs.license.service.LicenseService
    • validate

      public void validate() throws com.xebialabs.license.LicenseViolationException
      Specified by:
      validate in interface com.xebialabs.license.service.LicenseService
      Overrides:
      validate in class BaseLicenseService
      Throws:
      com.xebialabs.license.LicenseViolationException
    • validate

      public void validate(com.xebialabs.license.License license) throws com.xebialabs.license.LicenseViolationException
      Specified by:
      validate in interface com.xebialabs.license.service.LicenseService
      Overrides:
      validate in class BaseLicenseService
      Throws:
      com.xebialabs.license.LicenseViolationException
    • reload

      public void reload() throws com.xebialabs.license.LicenseViolationException, com.xebialabs.license.LicenseParseException
      Specified by:
      reload in interface com.xebialabs.license.service.LicenseService
      Throws:
      com.xebialabs.license.LicenseViolationException
      com.xebialabs.license.LicenseParseException
    • getLicense

      public com.xebialabs.license.License getLicense()
      Specified by:
      getLicense in interface com.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(File licenseFile) throws com.xebialabs.license.LicenseParseException, com.xebialabs.license.LicenseViolationException
      Throws:
      com.xebialabs.license.LicenseParseException
      com.xebialabs.license.LicenseViolationException