|
||||||||||
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(AbstractAgreementType 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. |
AbstractAgreementType |
getAgreementInstance()
Returns a domain-specific agreement implementation. |
AgreementContextType |
getContext()
|
String |
getCronExpression()
|
IAgreementContext |
getExecutionContext()
|
GuaranteeTermStateType[] |
getGuaranteeTermStates()
|
IServiceTermMonitoringHandler[] |
getMonitoringHandler()
Returns the list of registered monitoring handler. |
String |
getName()
Returns the agreement name. |
ServiceTermStateType[] |
getServiceTermStates()
|
AgreementStateType |
getState()
|
TermTreeType |
getTerms()
|
boolean |
isMonitoring()
|
void |
notifyReload()
This method notifies a concrete agreement instance that the monitored agreement instance was reloaded. |
void |
setAccountingSystem(IAccountingSystem accountingSystem)
|
void |
setCronExpression(String cronExpression)
|
void |
setExecutionContext(IAgreementContext executionContext)
|
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 Observable.notifyObservers() ) all observer registered to this
monitorable agreement will be notified of the state change ass well. |
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 |
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()
,
AbstractAgreementType.getExecutionContext()
,
Constant Field Valuespublic static final String MONITORING_CRON
XmlString
value.
Used for loading persisted agreements.
getAgreementInstance()
,
AbstractAgreementType.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()
,
AbstractAgreementType.getExecutionContext()
,
Constant Field Valuespublic static final String MONITORING_HANDLER_COUNT
XmlInt
.
Used for loading persisted agreements.
getAgreementInstance()
,
AbstractAgreementType.getExecutionContext()
,
Constant Field ValuesConstructor Detail |
---|
public MonitorableAgreement(AbstractAgreementType 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()
public IAgreementContext getExecutionContext()
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
AbstractAgreementType.notifyReload(java.util.Map)
method is
invoked. Implementations of the AbstractAgreementType
can override the
AbstractAgreementType.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 AbstractAgreementType getAgreementInstance()
AbstractAgreementType
implements the
domain-specific termination method and stored the agreement properties. The
AbstractAgreementType.getXMLObject()
returns the actual properties of an agreement
implementation. These properties must be valid at all time, i.e. if an agreement implementation
overrides the Agreement.getState()
method the implementation must make sure that the agreement
properties are updated with the returned state.
getAgreementInstance
in interface Agreement
public void setAccountingSystem(IAccountingSystem accountingSystem)
accountingSystem
- the accountingSystem to setpublic IAccountingSystem getAccountingSystem()
public void update(Observable o, Object arg)
Observable.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |