Class DefaultLicense

java.lang.Object
rs.baselib.licensing.AbstractLicense
rs.baselib.licensing.DefaultLicense
All Implemented Interfaces:
java.io.Serializable, ILicense

public class DefaultLicense
extends AbstractLicense
Default implementation of a license.
Author:
ralph
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • init

      public void init​(ILicenseContext context)
      Initialize the license using the given context.
      Parameters:
      context - context containing parameters.
    • getProduct

      public java.lang.String getProduct()
      Returns the product name.
      Returns:
      the product name
    • setProduct

      public void setProduct​(java.lang.String s)
      Sets the product name.
      Parameters:
      s - the product name
    • getExpirationDate

      public java.util.Date getExpirationDate()
      Returns the expiration date.
      Returns:
      the date or null if not set
    • setExpirationDate

      public void setExpirationDate​(java.util.Date d)
      Sets the new expiration date
      Parameters:
      d - the new date or null if no expiration
    • getOwner

      public java.lang.String getOwner()
      Returns the license owner.
      Returns:
      the license owner
    • setOwner

      public void setOwner​(java.lang.String s)
      Sets the license owner.
      Parameters:
      s - the license owner
    • isMinVersionIncluded

      public boolean isMinVersionIncluded()
      Returns whether verification includes the minimum version.
      Returns:
      true when minimum version is included
    • setMinVersionIncluded

      public void setMinVersionIncluded​(boolean b)
      Sets whether verification includes the minimum version.
      Parameters:
      b - true when minimum version is included
    • getMinVersion

      public java.lang.String getMinVersion()
      Returns the minimum version this license is valid for.
      Returns:
      the minimum version or null if no such version
    • setMinVersion

      public void setMinVersion​(java.lang.String s)
      Sets the minimum version this license is valid for.
      Parameters:
      s - the minimum version or null if no such version
    • isMaxVersionIncluded

      public boolean isMaxVersionIncluded()
      Returns whether verification includes the maximum version.
      Returns:
      true when maximum version is included
    • setMaxVersionIncluded

      public void setMaxVersionIncluded​(boolean b)
      Sets whether verification includes the maximum version.
      Parameters:
      b - true when maximum version is included
    • getMaxVersion

      public java.lang.String getMaxVersion()
      Returns the maximum version this license is valid for.
      Returns:
      the maximum version or null if no such version
    • setMaxVersion

      public void setMaxVersion​(java.lang.String s)
      Sets the maximum version this license is valid for.
      Parameters:
      s - the maximum version or null if no such version
    • getDate

      protected long getDate​(java.lang.Object o)
      Returns the time in millis for the given object.
      Parameters:
      o - an object (a date or long value)
      Returns:
      the time in milliseconds
    • verify

      public void verify​(ILicenseContext context)
      Verify the license using the given context
      Parameters:
      context - the context containing verification parameters
    • toString

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