Package org.bgerp.app.dist.lic

# Class License

java.lang.Object
org.bgerp.app.dist.lic.License

public class License extends Object
License for plugins.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FILE_NAME`
  `static final String`
  `KEY_LIC_DATE_TO`
  `static final String`
  `KEY_LIC_EMAIL`
  `static final String`
  `KEY_LIC_ID`
  `static final String`
  `KEY_LIC_LIMIT`
  `static final String`
  `KEY_LIC_PLUGIN`
  `static final String`
  `KEY_LIC_SIGN`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `License(String data)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `check(DynActionForm form)`
  Adds `LicenseEvent` to `form` response case the license has error.
  `boolean`
  `checkSessionLimit()`
  Checks if count of logged in users is less that license limit.
  `String`
  `getData()`
  License content.
  `byte[]`
  `getDigest()`
  Digest for all the license's lines before lic.sign.signature.
  `String`
  `getError()`
  License check result.
  `Set<String>`
  `getPlugins()`
  Plugin IDs.
  `boolean`
  `isCreatedToday()`
  `byte[]`
  `sign(String keyFilePath, String keyFilePswd)`
  License content with signature on the end.
  `String`
  `toString()`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### FILE_NAME

    public static final String FILE_NAME
    See Also:
      - Constant Field Values

  - ### KEY_LIC_ID

    public static final String KEY_LIC_ID
    See Also:
      - Constant Field Values

  - ### KEY_LIC_EMAIL

    public static final String KEY_LIC_EMAIL
    See Also:
      - Constant Field Values

  - ### KEY_LIC_LIMIT

    public static final String KEY_LIC_LIMIT
    See Also:
      - Constant Field Values

  - ### KEY_LIC_DATE_TO

    public static final String KEY_LIC_DATE_TO
    See Also:
      - Constant Field Values

  - ### KEY_LIC_PLUGIN

    public static final String KEY_LIC_PLUGIN
    See Also:
      - Constant Field Values

  - ### KEY_LIC_SIGN

    public static final String KEY_LIC_SIGN
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### License

    public License(String data)

- ## Method Details

  - ### getData

    public String getData()
    License content.
    Returns:

  - ### getDigest

    public byte[] getDigest()
    Digest for all the license's lines before lic.sign.signature.
    Returns:

  - ### getError

    public String getError()
    License check result.
    Returns:
      `null` on correct result, or error text.

  - ### getPlugins

    public Set<String> getPlugins()
    Plugin IDs.
    Returns:

  - ### sign

    public byte[] sign(String keyFilePath, String keyFilePswd) throws Exception
    License content with signature on the end.
    Parameters:
      `keyFilePath` - file of Java resource path to SSH private key file.
      `keyFilePswd` - password to SSH private key file, `null` - no password is used.
    Returns:
      UTF-8 encoded signed license.
    Throws:
      `Exception`

  - ### check

    public void check(DynActionForm form)
    Adds `LicenseEvent` to `form` response case the license has error.
    Parameters:
      `form` -

  - ### checkSessionLimit

    public boolean checkSessionLimit()
    Checks if count of logged in users is less that license limit. When `error` is not blank, returns `true` to allow fix the license. Return `true` when license check is disabled.
    Returns:
      allowance to log in.

  - ### isCreatedToday

    public boolean isCreatedToday()
    Returns:
      is the license object created today.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`