|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.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 Values| Constructor 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 set
public void startMonitoring()
throws Exception
Exception - failed to start monitoring
public void stopMonitoring()
throws Exception
Exception - error while stopping the agreement monitor schedulerpublic void terminate(TerminateInputType reason)
terminate in interface Agreementreason - termination reason
public 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 AgreementAgreement.getAgreementId()public AgreementContextType getContext()
getContext in interface AgreementAgreement.getContext()public GuaranteeTermStateType[] getGuaranteeTermStates()
getGuaranteeTermStates in interface AgreementAgreement.getGuaranteeTermStates()public String getName()
Agreement
getName in interface AgreementAgreement.getName()public ServiceTermStateType[] getServiceTermStates()
getServiceTermStates in interface AgreementAgreement.getServiceTermStates()public AgreementStateType getState()
getState in interface AgreementAgreement.getState()public TermTreeType getTerms()
getTerms in interface AgreementAgreement.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 ObserverObserver.update(java.util.Observable, java.lang.Object)public boolean validate()
Agreement
validate in interface AgreementAgreement.validate()public void notifyReload(Map<String,org.apache.xmlbeans.XmlObject> executionCtx)
AgreementAgreement.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 AgreementexecutionCtx - the current execution contextAgreement.notifyReload(java.util.Map)public void setAgreementId(String agreementId)
Agreement
setAgreementId in interface AgreementagreementId - the agreement id to setAgreement.setAgreementId(java.lang.String)public void setContext(AgreementContextType context)
Agreement
setContext in interface Agreementcontext - the agreement context to setAgreement.setContext(org.ogf.schemas.graap.wsAgreement.AgreementContextType)public void setName(String name)
Agreement
setName in interface Agreementname - the agreement name to setAgreement.setName(java.lang.String)public void setTerms(TermTreeType terms)
Agreement
setTerms in interface Agreementterms - the agreement terms to setAgreement.setTerms(org.ogf.schemas.graap.wsAgreement.TermTreeType)public void setState(AgreementStateType agreementState)
Agreement
setState in interface AgreementagreementState - the agreement state to setAgreement.setState(org.ogf.schemas.graap.wsAgreement.AgreementStateType)public void setGuaranteeTermStates(GuaranteeTermStateType[] guaranteeTermStateList)
Agreement
setGuaranteeTermStates in interface AgreementguaranteeTermStateList - the guarantee term states to setAgreement.setGuaranteeTermStates(org.ogf.schemas.graap.wsAgreement.GuaranteeTermStateType[])public void setServiceTermStates(ServiceTermStateType[] serviceTermStateList)
Agreement
setServiceTermStates in interface AgreementserviceTermStateList - the service term states to setAgreement.setServiceTermStates(org.ogf.schemas.graap.wsAgreement.ServiceTermStateType[])public AgreementPropertiesType getXMLObject()
AgreementXmlObject.
getXMLObject in interface AgreementAgreement.getXMLObject()public void setXmlObject(AgreementPropertiesType properties)
Agreement
setXmlObject in interface Agreementproperties - the agreement properties to setAgreement.setXmlObject(org.ogf.schemas.graap.wsAgreement.AgreementPropertiesType)public Map<String,Object> getTransientExecutionContext()
Agreement
getTransientExecutionContext in interface AgreementAgreement.getTransientExecutionContext()public Class getImplementationClass()
Agreement
getImplementationClass in interface AgreementAgreement.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 | |||||||||