Class LicenseGenerator


  • public class LicenseGenerator
    extends java.lang.Object
    A generator of Collaboration Engine licenses.

    This generator produces licensing data from inputs such as license owner, user quota and end-date. It also generates a unique license identifier and calculates the checksum of the license content.

    • Constructor Summary

      Constructors 
      Constructor Description
      LicenseGenerator()
      Creates the license-generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String generateLicense​(java.lang.String owner, int quota, java.time.LocalDate endDate)
      Generates a license in JSON format.
      java.lang.String generateLicense​(java.util.UUID key, java.lang.String owner, int quota, java.time.LocalDate endDate)
      Generates a license in JSON format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LicenseGenerator

        public LicenseGenerator()
        Creates the license-generator.
    • Method Detail

      • generateLicense

        public java.lang.String generateLicense​(java.lang.String owner,
                                                int quota,
                                                java.time.LocalDate endDate)
        Generates a license in JSON format.

        It takes the owner name, the user quota and the license end-date.

        A checksum of the license content will be calculated and appended to the JSON object.

        Parameters:
        owner - the name of the license owner
        quota - the license user quota
        endDate - the license end-date
        Returns:
        the license in JSON format
      • generateLicense

        public java.lang.String generateLicense​(java.util.UUID key,
                                                java.lang.String owner,
                                                int quota,
                                                java.time.LocalDate endDate)
        Generates a license in JSON format.

        It takes in a license key, the owner name, the user quota and the license end-date.

        A checksum of the license content will be calculated and appended to the JSON object.

        Parameters:
        key - the license key
        owner - the name of the license owner
        quota - the license user quota
        endDate - the license end-date
        Returns:
        the license in JSON format