Class LicenceChecker


  • public class LicenceChecker
    extends java.lang.Object
    Class used to perform periodic licence check and/or upload of statistics data.
    Author:
    Wojciech Kapcia
    • Field Detail

      • INSTALLATION_ID_KEY

        public static final java.lang.String INSTALLATION_ID_KEY
        See Also:
        Constant Field Values
    • Method Detail

      • getCodeForLicenceRetrieval

        public static java.lang.String getCodeForLicenceRetrieval​(java.lang.String component)
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInstallationId

        public static java.lang.String getInstallationId()
      • getLicenceChecker

        public static LicenceChecker getLicenceChecker​(java.lang.String cmpName)
        Creates a LicenceChecker with default update callback LicenceCheckerUpdateCallbackImpl for the component which name was provided as parameter. Component name will be used to find licence file with the pattern of etc/${cmpName}.licence

        Parameters:
        cmpName - name of the component for which LicenceChecker will be instantiated.
        Returns:
        LicenceChecker for the given cmpName
      • getLicencedComponents

        public static java.util.Set<java.lang.String> getLicencedComponents()
      • getLicencingDetails

        public static Element getLicencingDetails​(java.lang.String component)
      • main

        public static void main​(java.lang.String[] args)
      • isLicenceShown

        public boolean isLicenceShown()
      • reloadLicenceFromServer

        public Licence reloadLicenceFromServer()
                                        throws java.security.NoSuchAlgorithmException,
                                               java.io.IOException,
                                               java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.io.IOException
        java.security.spec.InvalidKeySpecException
      • getComponentName

        public java.lang.String getComponentName()
      • getLicenceDigest

        public java.lang.String getLicenceDigest()
        Returns Licence digest
        Returns:
        a Date representation of licence expiration date.
      • getValidUntil

        public java.util.Date getValidUntil()
        Returns date until which licence is valid.
        Returns:
        a Date representation of licence expiration date.
      • setLicenceShown

        public void setLicenceShown()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object