It is possible to use wsag4j only as webservice engine and replace the default WS-Agreement engine with a custom implementation. By doing that, mechanisms for e.g. validating agreement offers, are not available.
To configure a new wsag4j implementation you have to unzip the distribution war file, add your implementation jar to the webapp/WEB-INF/lib directory and change the wsag4j.properties file in the webapp/WEB-INF/classes folder in order to use your implementation.
The easiest way to implement a new AgreementFactory or Agreement is to inherit from one of the following classes:
The following samples provide an overview how a server implementation could look like.
This sample shows how to get informations about state
@Override public GuaranteeTermStateType[] getGuaranteeTermStates() { GuaranteeTermStateType[] state = new GuaranteeTermStateType[2]; state[0] = GuaranteeTermStateType.Factory.newInstance(); state[1] = GuaranteeTermStateType.Factory.newInstance(); state[0].setState( GuaranteeTermStateDefinition.NOT_DETERMINED ); state[0].setTermName( "term_0" ); state[1].setState( GuaranteeTermStateDefinition.FULFILLED ); state[1].setTermName( "term_1" ); return state; }
Real world implementations need to access the credentials clients used to authenticate at a service. A common example is a wsag4j based service, that allows or denies the creation service level agreements based on the clients access rights. In wsag4j the client credentials can be retrieved via the org.ogf.graap.wsag.api.engine.WsagMessageContext class.
The message context stores a set of parameters, which can be used by implementations to access functionalities of the basic frameworks. The most important parameters are listed below: