Class LicenseInfo
- java.lang.Object
-
- com.opencloud.license.LicenseInfo
-
- All Implemented Interfaces:
Serializable
public final class LicenseInfo extends Object implements Serializable
A LicenseInfo object contains the license details for a single license. It is encapsulated by a SignedObject (signed by the license private key) and serialized to produce the actual license file.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longUNLIMITED_CAPACITYstatic DateUNLIMITED_DURATION
-
Constructor Summary
Constructors Constructor Description LicenseInfo(String serialString, String issuedTo, ArrayList<LicenseComponent> allowedComponents, Date createdAt, Date validAfter, Date validUntil, String[] supercedes, HashMap<String,Object> metaData, ArrayList<com.opencloud.license.HostInfo> licensedHosts, ArrayList<com.opencloud.license.CertificateInfo> certificateInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckValidity()Check the state of this LicenseInfo for basic consistency.static StringdescribeCertificate(Certificate certificate)Returns a short description of the specified certificate.String[]getAllowedFunctions()Returns the list of functions allowed by this license.String[]getAllowedVersions()Returns the list of versions allowed by this license.com.opencloud.license.CertificateInfo[]getCertificateInfo()Returns the certificate info contained in this license.DategetFrom()com.opencloud.license.HostInfo.LicensedgetHostLicensedState(com.opencloud.license.HostInfo host)Check whether this license allows the given host to start RhinoStringgetIssuedTo()LicenseComponent[]getLicenseComponents()Returns a non-empty array of LicenseComponents.com.opencloud.license.HostInfo[]getLicensedHosts()Returns the list of licensed hostsHashMap<String,Object>getMetaData()StringgetSerial()String[]getSupercededLicenses()DategetUntil()booleanhasLicensedHostRestrictions()Returns whether or not this license enforces host based restrictionsbooleanisValid()Returns true if this license is currently valid with respect to be 'from' and 'until' fields.static voidmain(String[] args)Command-line interface: verify and display licenses given by URLs on the command line.voidshowBrief(PrintStream writer)Write a brief summary of this license to a PrintStreamvoidshowDetailed(PrintStream writer)Write detailed information on this license to a PrintStreamStringtoString()
-
-
-
Field Detail
-
UNLIMITED_CAPACITY
public static final long UNLIMITED_CAPACITY
- See Also:
- Constant Field Values
-
UNLIMITED_DURATION
public static final Date UNLIMITED_DURATION
-
-
Constructor Detail
-
LicenseInfo
public LicenseInfo(String serialString, String issuedTo, ArrayList<LicenseComponent> allowedComponents, Date createdAt, Date validAfter, Date validUntil, String[] supercedes, HashMap<String,Object> metaData, ArrayList<com.opencloud.license.HostInfo> licensedHosts, ArrayList<com.opencloud.license.CertificateInfo> certificateInfo) throws LicenseException
- Throws:
LicenseException
-
-
Method Detail
-
checkValidity
public void checkValidity() throws LicenseExceptionCheck the state of this LicenseInfo for basic consistency. Note that this does not check that the license is valid on the current date.
- Throws:
LicenseException
-
showBrief
public void showBrief(PrintStream writer)
Write a brief summary of this license to a PrintStream
-
showDetailed
public void showDetailed(PrintStream writer)
Write detailed information on this license to a PrintStream
-
describeCertificate
public static String describeCertificate(Certificate certificate)
Returns a short description of the specified certificate.
-
isValid
public boolean isValid()
Returns true if this license is currently valid with respect to be 'from' and 'until' fields. This does NOT check whether the license function or capacity are correct.
- Returns:
- true if the license is currently valid
-
getFrom
public Date getFrom()
-
getUntil
public Date getUntil()
-
getLicenseComponents
public LicenseComponent[] getLicenseComponents()
Returns a non-empty array of LicenseComponents.
-
getHostLicensedState
public com.opencloud.license.HostInfo.Licensed getHostLicensedState(com.opencloud.license.HostInfo host)
Check whether this license allows the given host to start Rhino
-
hasLicensedHostRestrictions
public boolean hasLicensedHostRestrictions()
Returns whether or not this license enforces host based restrictions
-
getLicensedHosts
public com.opencloud.license.HostInfo[] getLicensedHosts()
Returns the list of licensed hosts
-
getCertificateInfo
public com.opencloud.license.CertificateInfo[] getCertificateInfo()
Returns the certificate info contained in this license.
-
getAllowedFunctions
public String[] getAllowedFunctions()
Returns the list of functions allowed by this license. This function exists mainly for backwards compatibility with existing code.
-
getAllowedVersions
public String[] getAllowedVersions()
Returns the list of versions allowed by this license. This function exists mainly for backwards compatibility with existing code.
-
getSerial
public String getSerial()
-
getSupercededLicenses
public String[] getSupercededLicenses()
-
getIssuedTo
public String getIssuedTo()
-
-