public class ServiceLevel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Contract |
contract
This service level's contract
|
protected ContractManager |
contractHandler
The parent contract handler
|
protected java.lang.String |
serviceLevel
The name of the service level
|
protected java.util.HashMap<java.lang.String,ServiceLevel> |
serviceNegotiations
A list of the current service negotiations
|
protected long |
timeStamp
The time that the current contract was proposed or created
|
Constructor and Description |
---|
ServiceLevel(java.lang.String theServiceLevel,
ContractManager theContractHandler,
Contract theContract)
Create a new instance of ServiceLevel.
|
ServiceLevel(java.lang.String theServiceLevel,
ContractManager theContractHandler,
Contract theContract,
long thisTimeInterval)
Create a new instance of ServiceLevel.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contractIsOK(Contract theContract)
Return true if the contract suggested by the client is OK.
|
Contract |
contractReply(java.lang.String clientID,
Contract theContract)
Process the negotiation contract suggested by the client.
|
java.lang.String |
getServiceLevel()
Get the name of the service level.
|
long |
getTimeStamp()
Get the time the message was logged at.
|
protected static Contract |
processThisContract(ServiceLevel currentContract,
Contract proposedContract)
This can be used as a sort of generic processor of contract.
|
protected long timeStamp
protected java.lang.String serviceLevel
protected java.util.HashMap<java.lang.String,ServiceLevel> serviceNegotiations
protected ContractManager contractHandler
protected Contract contract
public ServiceLevel(java.lang.String theServiceLevel, ContractManager theContractHandler, Contract theContract)
theServiceLevel
- the service level name.theContractHandler
- the parent contract handler.theContract
- this service level contract.public ServiceLevel(java.lang.String theServiceLevel, ContractManager theContractHandler, Contract theContract, long thisTimeInterval)
theServiceLevel
- the service level name.theContractHandler
- the parent contract handler.theContract
- this service level contract.thisTimeInterval
- the time interval for when a contract becomes out of date.public boolean contractIsOK(Contract theContract)
theContract
- the contract to process.public long getTimeStamp()
Date.getTime()
.public java.lang.String getServiceLevel()
public Contract contractReply(java.lang.String clientID, Contract theContract) throws java.lang.Exception
clientID
- the client id.theContract
- the contract to process. This is a wrapper for an
XML-based contract description that is arbitrary with some standard elements.java.lang.Exception
- any error.protected static Contract processThisContract(ServiceLevel currentContract, Contract proposedContract) throws java.lang.Exception
currentContract
- the result of the current negotiations.proposedContract
- the new client contract proposal.java.lang.Exception
- any error.