Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.webchat
Class License

java.lang.Object
  extended by com.jivesoftware.webchat.License

public final class License
extends java.lang.Object

Holds all the data that makes up a license for the Jive Forums software. The signature property of the license is the digital signature that verifies that the data is valid and unchanged. A LicenseFactory must sign the licensse, and a LicenseManager can be used to verify the signature.

All properties of the license must be specified except for name and company, which don't need to be set, and expiresDate, which can be null if the license never expires.

License files are typically stored as base64 encoded XML files. Therefore, static method to convert a License to and from XML are provided. Any text encoding must be done seperately. You must make sure the licensed is signed before writing it out for use by an end-user or the license will not validate later.

See Also:
LicenseManager

Nested Class Summary
static class License.LicenseType
          A typesafe enum class for license types.
 
Method Summary
static License createWorkgroupLicense()
           
 boolean equals(java.lang.Object o)
           
static License fromXML(java.lang.String xml)
          Transforms a valid license XML file into a License object.
 java.lang.String getCompany()
           
 java.util.Date getCreationDate()
           
static java.lang.String getEvaluationLicense(java.lang.String versionNum)
           
 java.util.Date getExpiresDate()
           
 byte[] getFingerprint()
          Returns the fingerprint of the license, which is a byte[] that corresponds to all its property values.
 long getLicenseID()
           
 License.LicenseType getLicenseType()
           
 java.lang.String getName()
           
 int getNumClusterMembers()
           
 int getNumCopies()
           
 int getNumUsers()
           
 java.lang.String getProduct()
           
 java.lang.String getSignature()
           
 java.lang.String getURL()
           
 java.lang.String getVersion()
           
static void main(java.lang.String[] args)
           
 void setCompany(java.lang.String company)
           
 void setCreationDate(java.util.Date creationDate)
           
 void setExpiresDate(java.util.Date expiresDate)
           
 void setLicenseID(long licenseID)
           
 void setLicenseType(License.LicenseType licenseType)
           
 void setName(java.lang.String name)
           
 void setNumClusterMembers(int numClusterMembers)
           
 void setNumCopies(int numCopies)
           
 void setNumUsers(int numUsers)
           
 void setProduct(java.lang.String product)
           
 void setSignature(java.lang.String signature)
           
 void setURL(java.lang.String url)
           
 void setVersion(java.lang.String version)
           
static java.lang.String toXML(License license)
          Transforms a License into an XML file.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLicenseID

public long getLicenseID()

setLicenseID

public void setLicenseID(long licenseID)

getProduct

public java.lang.String getProduct()

setProduct

public void setProduct(java.lang.String product)

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)

getLicenseType

public License.LicenseType getLicenseType()

setLicenseType

public void setLicenseType(License.LicenseType licenseType)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getCompany

public java.lang.String getCompany()

setCompany

public void setCompany(java.lang.String company)

getNumCopies

public int getNumCopies()

setNumCopies

public void setNumCopies(int numCopies)

getNumClusterMembers

public int getNumClusterMembers()

setNumClusterMembers

public void setNumClusterMembers(int numClusterMembers)

getNumUsers

public int getNumUsers()

setNumUsers

public void setNumUsers(int numUsers)

getURL

public java.lang.String getURL()

setURL

public void setURL(java.lang.String url)

getExpiresDate

public java.util.Date getExpiresDate()

setExpiresDate

public void setExpiresDate(java.util.Date expiresDate)

getCreationDate

public java.util.Date getCreationDate()

setCreationDate

public void setCreationDate(java.util.Date creationDate)

getSignature

public java.lang.String getSignature()

setSignature

public void setSignature(java.lang.String signature)

getFingerprint

public byte[] getFingerprint()
Returns the fingerprint of the license, which is a byte[] that corresponds to all its property values. For example, given license a and b, the fingerprints of both will only match if every property of a is equal to b. This value is used when signing and verifying the license.

Returns:
the fingerprint of the license.

createWorkgroupLicense

public static License createWorkgroupLicense()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toXML

public static java.lang.String toXML(License license)
                              throws java.lang.Exception
Transforms a License into an XML file.

Throws:
java.lang.Exception

fromXML

public static License fromXML(java.lang.String xml)
                       throws org.dom4j.DocumentException,
                              java.text.ParseException
Transforms a valid license XML file into a License object.

Throws:
org.dom4j.DocumentException
java.text.ParseException

main

public static void main(java.lang.String[] args)

getEvaluationLicense

public static java.lang.String getEvaluationLicense(java.lang.String versionNum)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.