|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable org.ogf.graap.wsag.server.monitoring.MonitorableAgreement
public class MonitorableAgreement
MonitorableAgreement Supports monitoring of service terms, agreement state and automatic evaluation of guarantee terms.
Field Summary | |
---|---|
static String |
MONITORING_ACTIVE
Key to resolve if monitoring was started for a particular agreement implementation from the agreement execution context. |
static String |
MONITORING_CRON
Key to resolve the monitoring interval for a particular agreement implementation from the agreement execution context. |
static String |
MONITORING_HANDLER
Key to resolve the class names of the monitoring handler for a particular agreement implementation from the agreement execution context. |
static String |
MONITORING_HANDLER_COUNT
Key to resolve the number of the monitoring handler for a particular agreement implementation from the agreement execution context. |
Constructor Summary | |
---|---|
MonitorableAgreement(Agreement agreement)
Creates a new instance of a monitorable agreement. |
|
MonitorableAgreement(PersistentAgreementContainer persistentAgreementContainer)
Recreates an instance of a monitorable agreement. |
Method Summary | |
---|---|
void |
addMonitoringHandler(IServiceTermMonitoringHandler handler)
|
IAccountingSystem |
getAccountingSystem()
|
String |
getAgreementId()
Returns the agreement id. |
Agreement |
getAgreementInstance()
|
AgreementContextType |
getContext()
|
String |
getCronExpression()
|
Map<String,org.apache.xmlbeans.XmlObject> |
getExecutionContext()
Returns the persisted execution context for this agreement. |
GuaranteeTermStateType[] |
getGuaranteeTermStates()
|
Class |
getImplementationClass()
Returns the class of the agreement implementation. |
IAgreementContext |
getMonitoringContext()
Deprecated. |
IServiceTermMonitoringHandler[] |
getMonitoringHandler()
Returns the list of registered monitoring handler. |
String |
getName()
Returns the agreement name. |
ServiceTermStateType[] |
getServiceTermStates()
|
AgreementStateType |
getState()
|
TermTreeType |
getTerms()
|
Map<String,Object> |
getTransientExecutionContext()
Returns the transient execution context for this agreement. |
AgreementPropertiesType |
getXMLObject()
Returns the agreement properties as XmlObject . |
boolean |
isMonitoring()
|
void |
notifyReload()
This method notifies a concrete agreement instance that the monitored agreement instance was reloaded. |
void |
notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
This method allows an agreement instance to get notified after reload. |
void |
setAccountingSystem(IAccountingSystem accountingSystem)
|
void |
setAgreementId(String agreementId)
Sets the ID of the agreement. |
void |
setContext(AgreementContextType context)
Sets the context of the agreement. |
void |
setCronExpression(String cronExpression)
|
void |
setExecutionContext(IAgreementContext executionContext)
|
void |
setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
Sets the guarantee term states of the agreement. |
void |
setName(String name)
Sets the name of the agreement. |
void |
setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
Sets the service term states of the agreement. |
void |
setState(AgreementStateType agreementState)
Sets the state of the agreement. |
void |
setTerms(TermTreeType terms)
Sets the terms of the agreement. |
void |
setXmlObject(AgreementPropertiesType properties)
Sets the properties for this agreement explicitly. |
void |
startMonitoring()
Starts the agreement monitoring process. |
void |
stopMonitoring()
Stops the agreement monitoring. |
void |
terminate(TerminateInputType reason)
Terminates an agreement. |
void |
update(Observable o,
Object arg)
If the monitored agreement receives a state change notification of the concrete agreement implementation (@link Agreement.notifyObservers() ) all observer registered to this monitorable
agreement will be notified of the state change ass well. |
boolean |
validate()
Validates the resource properties document of this instance. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ogf.graap.wsag.api.Agreement |
---|
addObserver, hasChanged, notifyObservers, notifyObservers |
Field Detail |
---|
public static final String MONITORING_ACTIVE
XmlBoolean
. If the boolean value is true monitoring was started
using the MonitorableAgreement
, if false or not present monitoring was not used.
Used for loading persisted agreements.
getAgreementInstance()
,
Agreement.getExecutionContext()
,
Constant Field Valuespublic static final String MONITORING_CRON
XmlString
value.
Used for loading persisted agreements.
getAgreementInstance()
,
Agreement.getExecutionContext()
,
Constant Field Valuespublic static final String MONITORING_HANDLER
XmlString
. The monitoring handler class names are
stored in the agreement execution context with the following strategy:
MONITORING_HANDLER + "." + handler[i].getClass().getName()
Used for loading persisted agreements.
getAgreementInstance()
,
Agreement.getExecutionContext()
,
Constant Field Valuespublic static final String MONITORING_HANDLER_COUNT
XmlInt
.
Used for loading persisted agreements.
getAgreementInstance()
,
Agreement.getExecutionContext()
,
Constant Field ValuesConstructor Detail |
---|
public MonitorableAgreement(Agreement agreement)
agreement
- the agreement object, which should be monitored.public MonitorableAgreement(PersistentAgreementContainer persistentAgreementContainer)
persistentAgreementContainer
- the persisted agreement object, which should be monitored.Method Detail |
---|
public boolean isMonitoring()
@Deprecated public IAgreementContext getMonitoringContext()
public void setExecutionContext(IAgreementContext executionContext)
executionContext
- the executionContext to setpublic void addMonitoringHandler(IServiceTermMonitoringHandler handler)
handler
- monitoring handlerpublic IServiceTermMonitoringHandler[] getMonitoringHandler()
public String getCronExpression()
public void setCronExpression(String cronExpression)
cronExpression
- the cronExpression to setpublic void startMonitoring() throws Exception
Exception
- failed to start monitoringpublic void stopMonitoring() throws Exception
Exception
- error while stopping the agreement monitor schedulerpublic void terminate(TerminateInputType reason)
terminate
in interface Agreement
reason
- termination reasonpublic void notifyReload() throws Exception
Agreement.notifyReload(java.util.Map)
method is invoked.
Implementations of the Agreement
can override the
Agreement#notifyReinitialized(java.util.Map)
in order to implement domain specific
re-initialization logic.
Exception
- indicates an error during the agreement reload processpublic String getAgreementId()
Agreement
getAgreementId
in interface Agreement
Agreement.getAgreementId()
public AgreementContextType getContext()
getContext
in interface Agreement
Agreement.getContext()
public GuaranteeTermStateType[] getGuaranteeTermStates()
getGuaranteeTermStates
in interface Agreement
Agreement.getGuaranteeTermStates()
public String getName()
Agreement
getName
in interface Agreement
Agreement.getName()
public ServiceTermStateType[] getServiceTermStates()
getServiceTermStates
in interface Agreement
Agreement.getServiceTermStates()
public AgreementStateType getState()
getState
in interface Agreement
Agreement.getState()
public TermTreeType getTerms()
getTerms
in interface Agreement
Agreement.getTerms()
public Agreement getAgreementInstance()
public void setAccountingSystem(IAccountingSystem accountingSystem)
accountingSystem
- the accountingSystem to setpublic IAccountingSystem getAccountingSystem()
public void update(Observable o, Object arg)
Agreement.notifyObservers()
) all observer registered to this monitorable
agreement will be notified of the state change ass well.
update
in interface Observer
Observer.update(java.util.Observable, java.lang.Object)
public boolean validate()
Agreement
validate
in interface Agreement
Agreement.validate()
public void notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
Agreement
Agreement.notifyReload(Map)
method sets the execution context (see Agreement.getExecutionContext()
) of
the agreement and invokes the #notifyReinitialized(Map)
method of this agreement instance.
notifyReload
in interface Agreement
executionCtx
- the current execution contextAgreement.notifyReload(java.util.Map)
public void setAgreementId(String agreementId)
Agreement
setAgreementId
in interface Agreement
agreementId
- the agreement id to setAgreement.setAgreementId(java.lang.String)
public void setContext(AgreementContextType context)
Agreement
setContext
in interface Agreement
context
- the agreement context to setAgreement.setContext(org.ogf.schemas.graap.wsAgreement.AgreementContextType)
public void setName(String name)
Agreement
setName
in interface Agreement
name
- the agreement name to setAgreement.setName(java.lang.String)
public void setTerms(TermTreeType terms)
Agreement
setTerms
in interface Agreement
terms
- the agreement terms to setAgreement.setTerms(org.ogf.schemas.graap.wsAgreement.TermTreeType)
public void setState(AgreementStateType agreementState)
Agreement
setState
in interface Agreement
agreementState
- the agreement state to setAgreement.setState(org.ogf.schemas.graap.wsAgreement.AgreementStateType)
public void setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
Agreement
setGuaranteeTermStates
in interface Agreement
guaranteeTermStateList
- the guarantee term states to setAgreement.setGuaranteeTermStates(org.ogf.schemas.graap.wsAgreement.GuaranteeTermStateType[])
public void setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
Agreement
setServiceTermStates
in interface Agreement
serviceTermStateList
- the service term states to setAgreement.setServiceTermStates(org.ogf.schemas.graap.wsAgreement.ServiceTermStateType[])
public AgreementPropertiesType getXMLObject()
Agreement
XmlObject
.
getXMLObject
in interface Agreement
Agreement.getXMLObject()
public void setXmlObject(AgreementPropertiesType properties)
Agreement
setXmlObject
in interface Agreement
properties
- the agreement properties to setAgreement.setXmlObject(org.ogf.schemas.graap.wsAgreement.AgreementPropertiesType)
public Map<String,Object> getTransientExecutionContext()
Agreement
getTransientExecutionContext
in interface Agreement
Agreement.getTransientExecutionContext()
public Class getImplementationClass()
Agreement
getImplementationClass
in interface Agreement
Agreement.getImplementationClass()
public Map<String,org.apache.xmlbeans.XmlObject> getExecutionContext()
Agreement
getExecutionContext
in interface Agreement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |