public class License extends XMLMessage
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LICENSE_DOCNAME
The name of the root element.
|
static java.lang.String |
LICENSE_DTD
The underlying DTD.
|
Constructor and Description |
---|
License()
Constructs an instance based on a given DTD.
|
License(java.lang.String version,
java.util.Properties props,
Agreement[] agreements,
java.lang.String agreementid)
Constructs a message instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
calculateSignature(boolean update)
Generates the signature for this license.
|
protected void |
finalize()
Clean-up method to help the gc.
|
Agreement[] |
getAgreements()
Provides the license agreements in various localizations.
|
Configuration |
getConfiguration()
Provides the application configuration included in the license document.
|
java.util.Properties |
getProperties()
Provides the license data as
Properties . |
java.lang.String |
getSignature()
Provides the signature for this license.
|
void |
setAgreements(Agreement[] agreements,
java.lang.String id)
Sets the given license agreements in various locales.
|
void |
setSignature(java.lang.String signature)
Sets the signature for this license.
|
canProcess, getAttribute, getAttributeValue, getContents, getDocument, getDTD, getElement, getElements, getElementValue, getEncoding, getIntFunctionResult, isArmed, isValid, printDocument, read, read, setEncoding, setFormat, write, write
public static final java.lang.String LICENSE_DTD
public static final java.lang.String LICENSE_DOCNAME
public License()
public License(java.lang.String version, java.util.Properties props, Agreement[] agreements, java.lang.String agreementid)
childs are specified product_id
,
product_type
, product_orderid
, and product_npgrade
since several child tags can be used for multiple blocks.
version
- Currently only "1.0", requiredprops
- Container with license data, must not be null
agreements
- Array with license agreementsagreementid
- The agreement identifierjava.lang.NullPointerException
- If parameters are null
java.lang.IllegalArgumentException
- If at least one of the parameters is invalidprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Error indicationpublic java.util.Properties getProperties()
Properties
.
The supported properties follow the underlying DTD and use a prefix according to the data
block. For instance the
childs are specified product_id
,
product_type
, product_orderid
, and product_npgrade
since several child tags can be used for multiple blocks.
The configuration variables are not included here. Call getConfiguration()
to obtain the configuration variables.
null
or emptygetConfiguration()
public Agreement[] getAgreements()
null
or emptypublic void setAgreements(Agreement[] agreements, java.lang.String id)
agreements
- The license agreementsid
- The agreement identifier (e.g. date)java.lang.NullPointerException
- If parameters are null
java.lang.IllegalArgumentException
- If at least one of the parameters is invalidpublic Configuration getConfiguration()
public java.lang.String getSignature()
null
indicates errorpublic void setSignature(java.lang.String signature)
signature
- The signaturepublic java.lang.String calculateSignature(boolean update)
update
- Update license signature with the calculated value?null
indicates errorCopyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.