public class Contract extends java.lang.Object implements ContractDef
Modifier and Type | Field and Description |
---|---|
protected org.licas_xml.abs.Element |
contract
The service or negotiation contract
|
Constructor and Description |
---|
Contract(org.licas_xml.abs.Element theContract)
Create a new instance of Contract.
|
Modifier and Type | Method and Description |
---|---|
org.licas_xml.abs.Element |
getContract()
Get the negotiation or service contract information.
|
static java.lang.String |
getElementValue(java.lang.String elementName,
Contract theContract)
Parse the contract to retrieve the value for the specified element.
|
static Contract |
getNoContract()
Create and return a negotiation or service contract that always returns 'no'.
|
static Contract |
getTrueContract(java.lang.String clientID,
java.lang.String serviceLevel)
Create a default true contract.
|
static Contract |
getYesContract()
Create and return a negotiation or service contract that always returns 'yes'.
|
static boolean |
isNoContract(Contract theContract)
Return true if the contract is a default 'no' contract.
|
static boolean |
isYesContract(Contract theContract)
Return true if the contract is a default 'yes' contract.
|
org.licas_xml.abs.Element |
toXml()
Get the negotiation or service contract information.
|
protected org.licas_xml.abs.Element contract
public Contract(org.licas_xml.abs.Element theContract)
theContract
- the contract description. This can take any form and
so is represented by an XML element only.public org.licas_xml.abs.Element getContract()
getContract
in interface ContractDef
public org.licas_xml.abs.Element toXml()
public static boolean isYesContract(Contract theContract)
theContract
- the contract to evaluate.public static boolean isNoContract(Contract theContract)
theContract
- the contract to evaluate.public static Contract getYesContract()
public static Contract getNoContract()
public static Contract getTrueContract(java.lang.String clientID, java.lang.String serviceLevel)
clientID
- the id of the calling client.serviceLevel
- the service level.public static java.lang.String getElementValue(java.lang.String elementName, Contract theContract)
elementName
- the name of the element. Can be for example Const.POLICY
,
Const.CLIENT
, Const.SERVICELEVEL
.theContract
- the client contract.