Class AbstractLicenseService

    • 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:
        initialize in interface com.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:
        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​(java.io.File licenseFile)
                                                              throws com.xebialabs.license.LicenseParseException,
                                                                     com.xebialabs.license.LicenseViolationException
        Throws:
        com.xebialabs.license.LicenseParseException
        com.xebialabs.license.LicenseViolationException