com.license4j

## Class License

- java.lang.Object
- - com.license4j.License

-     public class License
      extends java.lang.Object

  License class, obtained after license validation and activation methods.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String[]` | `checkForNewMessage()` Method to check for a messages saved for the license or product on Online.License4J.
    `java.lang.String[]` | `checkForNewMessage(java.lang.String licenseServer)` Method to check for new messages saved for the license or product on Auto License Generation and Activation Server.
    `java.lang.String` | `checkForUpdate(java.lang.String productEdition, java.lang.String productVersion)` Method to check for software update on Auto License Generation and Activation Server.
    `java.lang.String` | `checkForUpdate(java.lang.String productEdition, java.lang.String productVersion, java.lang.String licenseServer)` Method to check for software update on Auto License Generation and Activation Server.
    `java.lang.String` | `checkForUpdateMessage(java.lang.String productEdition, java.lang.String newVersion)` Method to check for software update message on Online.License4J for the given new version.
    `java.lang.String` | `checkForUpdateMessage(java.lang.String productEdition, java.lang.String newVersion, java.lang.String licenseServer)` Method to check for software update message on Auto License Generation and Activation Server for the given new version.
    `ActivationStatus` | `getActivationStatus()` Method returns activation status after activation.
    `int` | `getFloatingLicenseServerVersion()` Method to get floating license server version.
    `int` | `getLicenseActivationDaysRemaining(java.util.Date currentDate)` Returns days remaining for activation if license requires activation.
    `int` | `getLicenseActivationPeriod(java.util.Date currentDate)` Returns activation period if license requires activation.
    `LicenseKey` | `getLicenseKey()` Returns LicenseKey object.
    `java.lang.String` | `getLicenseString()` Returns license string in plain text.
    `LicenseText` | `getLicenseText()` Returns LicenseText object.
    `java.lang.String` | `getManualActivationRequestString()` Return activation request string.
    `java.lang.String` | `getManualActivationRequestStringWithCustomHardwareID(java.lang.String customHardwareID)` Return activation request string with given custom hardware ID.
    `java.lang.String` | `getManualActivationRequestStringWithCustomHardwareIDWithUserInformation(java.lang.String customHardwareID, boolean modifyOnlyOnFirstActivation, java.lang.String fullname, java.lang.String registeredto, java.lang.String email, java.lang.String company, java.lang.String street, java.lang.String telnumber, java.lang.String faxnumber, java.lang.String city, java.lang.String zip, java.lang.String country)` Return activation request string with given custom hardware ID and with user information to modify.
    `java.lang.String` | `getManualActivationRequestStringWithUserInformation(boolean modifyOnlyOnFirstActivation, java.lang.String fullname, java.lang.String registeredto, java.lang.String email, java.lang.String company, java.lang.String street, java.lang.String telnumber, java.lang.String faxnumber, java.lang.String city, java.lang.String zip, java.lang.String country)` Return activation request string with user information to modify.
    `java.lang.String` | `getManualDeactivationRequestString()` Return deactivation request string.
    `java.lang.String` | `getManualModificationRequestString(java.lang.String modificationKey)` Return manual modification request string.
    `ModificationStatus` | `getModificationStatus()` Method returns modification status.
    `java.lang.String` | `getPublicKey()` Returns license public key string.
    `int` | `getUseCountAllowed()` If license is a Online License Key Floating Over Internet, and maximum allowed use count is defined, this method returns defined maximum allowed use count otherwise returns 0.
    `int` | `getUseCountCurrent()` If license is an Online License Key Floating Over Internet, and maximum allowed use count is defined, this method returns current use count otherwise returns 0.
    `java.lang.String` | `getUsedModificationKeys()` If license is activated and activation return type is license text, and if it is modified before with one or more than one modification key, this method returns key separated with a space.
    `long` | `getUseTimeCurrent()` If license is a Online License Key Floating Over Internet, and maximum allowed use time limit is defined, this method returns current use time in seconds otherwise returns 0.
    `long` | `getUseTimeLimitAllowed()` If license is a Online License Key Floating Over Internet, and maximum allowed use time limit is defined, this method returns defined maximum allowed use time in seconds otherwise returns 0.
    `ValidationStatus` | `getValidationStatus()` Method returns validation status after validation.
    `boolean` | `isActivationCompleted()` Returns if activation completed, check isActivationRequired before.
    `boolean` | `isActivationRequired()` Returns if activation required.
    `void` | `releaseFloatingLicense()` Method first stops license and server check timer tasks which starts after license validation of Floating License Text and Online License Key Floating Over Internet, then releases obtained license and set License ValidationStatus to LICENSE_INVALID and set license text to null.
    `void` | `stopFloatingLicenseCheckTimers()` Method stops license and server check timer tasks which starts after license validation of Floating License Text and Online License Key Floating Over Internet.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getValidationStatus

          public ValidationStatus getValidationStatus()

      Method returns validation status after validation.
      Returns:
        Validation status

    - #### getModificationStatus

          public ModificationStatus getModificationStatus()

      Method returns modification status.
      Returns:
        Modification status

    - #### getActivationStatus

          public ActivationStatus getActivationStatus()

      Method returns activation status after activation.
      Returns:
        Activation status

    - #### getLicenseString

          public java.lang.String getLicenseString()

      Returns license string in plain text. It either returns license key or license text depending on license type.
      Returns:
        License string

    - #### getManualActivationRequestString

          public java.lang.String getManualActivationRequestString()

      Return activation request string.
      Returns:
        activation request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is ACTIVATION_NOT_REQUIRED.

    - #### getManualActivationRequestStringWithCustomHardwareID

          public java.lang.String getManualActivationRequestStringWithCustomHardwareID(java.lang.String customHardwareID)

      Return activation request string with given custom hardware ID.
      Parameters:
        `customHardwareID` -
      Returns:
        activation request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is ACTIVATION_NOT_REQUIRED.

    - #### getManualActivationRequestStringWithUserInformation

          public java.lang.String getManualActivationRequestStringWithUserInformation(boolean modifyOnlyOnFirstActivation,
                                                                             java.lang.String fullname,
                                                                             java.lang.String registeredto,
                                                                             java.lang.String email,
                                                                             java.lang.String company,
                                                                             java.lang.String street,
                                                                             java.lang.String telnumber,
                                                                             java.lang.String faxnumber,
                                                                             java.lang.String city,
                                                                             java.lang.String zip,
                                                                             java.lang.String country)

      Return activation request string with user information to modify.
      Parameters:
        `modifyOnlyOnFirstActivation` -
        `fullname` -
        `registeredto` -
        `email` -
        `company` -
        `street` -
        `telnumber` -
        `faxnumber` -
        `city` -
        `zip` -
        `country` -
      Returns:
        activation request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is ACTIVATION_NOT_REQUIRED.

    - #### getManualActivationRequestStringWithCustomHardwareIDWithUserInformation

          public java.lang.String getManualActivationRequestStringWithCustomHardwareIDWithUserInformation(java.lang.String customHardwareID,
                                                                                                 boolean modifyOnlyOnFirstActivation,
                                                                                                 java.lang.String fullname,
                                                                                                 java.lang.String registeredto,
                                                                                                 java.lang.String email,
                                                                                                 java.lang.String company,
                                                                                                 java.lang.String street,
                                                                                                 java.lang.String telnumber,
                                                                                                 java.lang.String faxnumber,
                                                                                                 java.lang.String city,
                                                                                                 java.lang.String zip,
                                                                                                 java.lang.String country)

      Return activation request string with given custom hardware ID and with user information to modify.
      Parameters:
        `customHardwareID` -
        `modifyOnlyOnFirstActivation` -
        `fullname` -
        `registeredto` -
        `email` -
        `company` -
        `street` -
        `telnumber` -
        `faxnumber` -
        `city` -
        `zip` -
        `country` -
      Returns:
        activation request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is ACTIVATION_NOT_REQUIRED.

    - #### getManualModificationRequestString

          public java.lang.String getManualModificationRequestString(java.lang.String modificationKey)

      Return manual modification request string.
      Parameters:
        `modificationKey` -
      Returns:
        modification request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is not ACTIVATION_COMPLETED.

    - #### getManualDeactivationRequestString

          public java.lang.String getManualDeactivationRequestString()

      Return deactivation request string.
      Returns:
        deactivation request string to submit on Online.LicenseJ site or Auto License Generation and Activation Server. Returns null if license activation status is not ACTIVATION_COMPLETED.

    - #### getPublicKey

          public java.lang.String getPublicKey()

      Returns license public key string.
      Returns:
        Public key

    - #### isActivationRequired

          public boolean isActivationRequired()

      Returns if activation required.
      Returns:
        activation required boolean

    - #### isActivationCompleted

          public boolean isActivationCompleted()

      Returns if activation completed, check isActivationRequired before.
      Returns:
        activation completed boolean

    - #### getLicenseActivationDaysRemaining

          public int getLicenseActivationDaysRemaining(java.util.Date currentDate)

      Returns days remaining for activation if license requires activation.
      Parameters:
        `currentDate` -
      Returns:
        days remaining for activation

    - #### getLicenseActivationPeriod

          public int getLicenseActivationPeriod(java.util.Date currentDate)

      Returns activation period if license requires activation.
      Parameters:
        `currentDate` -
      Returns:
        activation period

    - #### getLicenseText

          public LicenseText getLicenseText()

      Returns LicenseText object.
      Returns:
        LicenseText object

    - #### getLicenseKey

          public LicenseKey getLicenseKey()

      Returns LicenseKey object.
      Returns:
        LicenseKey object

    - #### getUseCountCurrent

          public int getUseCountCurrent()

      If license is an Online License Key Floating Over Internet, and maximum allowed use count is defined, this method returns current use count otherwise returns 0.
      Returns:
        current use count

    - #### getUseCountAllowed

          public int getUseCountAllowed()

      If license is a Online License Key Floating Over Internet, and maximum allowed use count is defined, this method returns defined maximum allowed use count otherwise returns 0.
      Returns:
        maximum allowed use count

    - #### getUseTimeCurrent

          public long getUseTimeCurrent()

      If license is a Online License Key Floating Over Internet, and maximum allowed use time limit is defined, this method returns current use time in seconds otherwise returns 0.
      Returns:
        current use time in seconds

    - #### getUseTimeLimitAllowed

          public long getUseTimeLimitAllowed()

      If license is a Online License Key Floating Over Internet, and maximum allowed use time limit is defined, this method returns defined maximum allowed use time in seconds otherwise returns 0.
      Returns:
        maximum allowed use time limit in seconds

    - #### getUsedModificationKeys

          public java.lang.String getUsedModificationKeys()

      If license is activated and activation return type is license text, and if it is modified before with one or more than one modification key, this method returns key separated with a space. If license is not modified before returns null.
      Returns:
        list of keys used to modify license

    - #### stopFloatingLicenseCheckTimers

          public void stopFloatingLicenseCheckTimers()

      Method stops license and server check timer tasks which starts after license validation of Floating License Text and Online License Key Floating Over Internet. If you need to revalidate an obtained license (e.g. due to an invalid handler call) call this method to stop previous license and server check timer tasks. Otherwise unnecessary timer tasks left behind.

    - #### releaseFloatingLicense

          public void releaseFloatingLicense()

      Method first stops license and server check timer tasks which starts after license validation of Floating License Text and Online License Key Floating Over Internet, then releases obtained license and set License ValidationStatus to LICENSE_INVALID and set license text to null.

    - #### getFloatingLicenseServerVersion

          public int getFloatingLicenseServerVersion()

      Method to get floating license server version. Returns version number if server version is 4.4.0 and above, otherwise returns 0.
      Returns:
        floating license server version

    - #### checkForNewMessage

          public java.lang.String[] checkForNewMessage()

      Method to check for a messages saved for the license or product on Online.License4J. Returns unread messages as string array and mark them as read on server (depending on display count defined for the message). If there is no unread message, method returns an empty string array. Read and unread information is saved based on ethernet address.
      Returns:
        the unread messages in a string array

    - #### checkForNewMessage

          public java.lang.String[] checkForNewMessage(java.lang.String licenseServer)

      Method to check for new messages saved for the license or product on Auto License Generation and Activation Server. Returns unread message as a string array and mark them as read on server (depending on display count defined for the message). If there is no unread message, method returns an empty string array. Read and unread information is saved based on ethernet address.
      Parameters:
        `licenseServer` -
      Returns:
        the unread messages in a string array

    - #### checkForUpdate

          public java.lang.String checkForUpdate(java.lang.String productEdition,
                                        java.lang.String productVersion)

      Method to check for software update on Auto License Generation and Activation Server. Returns new version as a String if found on server. Returns null if there is no update version.
      Parameters:
        `productEdition` -
        `productVersion` -
      Returns:
        a double number

    - #### checkForUpdate

          public java.lang.String checkForUpdate(java.lang.String productEdition,
                                        java.lang.String productVersion,
                                        java.lang.String licenseServer)

      Method to check for software update on Auto License Generation and Activation Server. Returns new version as a String if found on server. Returns null if there is no update version.
      Parameters:
        `productEdition` -
        `productVersion` -
        `licenseServer` -
      Returns:
        a double number

    - #### checkForUpdateMessage

          public java.lang.String checkForUpdateMessage(java.lang.String productEdition,
                                               java.lang.String newVersion)

      Method to check for software update message on Online.License4J for the given new version. Return the update notification message or null if message is not found.
      Parameters:
        `productEdition` -
        `newVersion` -
      Returns:
        the update message

    - #### checkForUpdateMessage

          public java.lang.String checkForUpdateMessage(java.lang.String productEdition,
                                               java.lang.String newVersion,
                                               java.lang.String licenseServer)

      Method to check for software update message on Auto License Generation and Activation Server for the given new version. Return the update notification message or null if message is not found.
      Parameters:
        `productEdition` -
        `newVersion` -
        `licenseServer` -
      Returns:
        the update message