org.ogf.graap.wsag.server.rest
Class RestNegotiationFacade

java.lang.Object
  extended by org.ogf.graap.wsag.server.rest.RestNegotiationFacade
All Implemented Interfaces:
RestNegotiation

public class RestNegotiationFacade
extends Object
implements RestNegotiation

Author:
owaeld

Constructor Summary
RestNegotiationFacade(String factoryId, String negotiationId)
           
 
Method Summary
 void advertise(AdvertiseInputDocument input)
          Advertises a set of negotiation offers.
 void destroy()
          Destroys the agreement REST resource.
 NegotiationPropertiesDocument getNegotiableTemplates()
          A negotiation instance supports zero or more templates that can be used to create negotiation offers.
 NegotiationPropertiesDocument getNegotiationContext()
          Returns the context of this negotiation process.
 NegotiationPropertiesDocument getNegotiationOffers()
          Returns a history of exchanged offers in this negotiation process.
 NegotiateOutputDocument negotiate(NegotiateInputDocument input)
          Negotiates a set of agreement offers.
 void terminate(TerminateInputDocument reason)
          Terminates the agreement if permitted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestNegotiationFacade

public RestNegotiationFacade(String factoryId,
                             String negotiationId)
Method Detail

getNegotiationContext

public NegotiationPropertiesDocument getNegotiationContext()
                                                    throws ResourceUnknownException,
                                                           ResourceUnavailableException
Description copied from interface: RestNegotiation
Returns the context of this negotiation process.

Specified by:
getNegotiationContext in interface RestNegotiation
Returns:
the negotiation context
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getNegotiableTemplates

public NegotiationPropertiesDocument getNegotiableTemplates()
                                                     throws ResourceUnknownException,
                                                            ResourceUnavailableException
Description copied from interface: RestNegotiation
A negotiation instance supports zero or more templates that can be used to create negotiation offers. In case of a negotiation process, these templates are a subset of the templates offered by an agreement factory. Only these templates are returned for which a proper negotiation strategy is implemented. in case of agreement re negotiation, a negotiation instance may return one ore more templates to bootstrap the negotiation process.

Specified by:
getNegotiableTemplates in interface RestNegotiation
Returns:
the negotiable templates
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getNegotiationOffers

public NegotiationPropertiesDocument getNegotiationOffers()
                                                   throws ResourceUnknownException,
                                                          ResourceUnavailableException
Description copied from interface: RestNegotiation
Returns a history of exchanged offers in this negotiation process.

Specified by:
getNegotiationOffers in interface RestNegotiation
Returns:
the offers exchanged in this negotiation
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

negotiate

public NegotiateOutputDocument negotiate(NegotiateInputDocument input)
                                  throws NegotiationException,
                                         ResourceUnknownException,
                                         ResourceUnavailableException
Description copied from interface: RestNegotiation
Negotiates a set of agreement offers.

Specified by:
negotiate in interface RestNegotiation
Parameters:
input - the offers to negotiate
Returns:
a set of counter offers
Throws:
NegotiationException - an error occured processing the negotiation request
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

advertise

public void advertise(AdvertiseInputDocument input)
               throws NegotiationException,
                      ResourceUnknownException,
                      ResourceUnavailableException
Description copied from interface: RestNegotiation
Advertises a set of negotiation offers.

Specified by:
advertise in interface RestNegotiation
Parameters:
input - the offers to advertise
Throws:
NegotiationException - an error occured processing the negotiation request
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

terminate

public void terminate(TerminateInputDocument reason)
               throws ResourceUnknownException,
                      ResourceUnavailableException
Description copied from interface: RestNegotiation
Terminates the agreement if permitted.

Specified by:
terminate in interface RestNegotiation
Parameters:
reason - the termination reason
Throws:
ResourceUnknownException - the referenced resource does not exist
ResourceUnavailableException - the referenced resource is not available

destroy

public void destroy()
             throws ResourceUnknownException,
                    ResourceUnavailableException
Description copied from interface: RestNegotiation
Destroys the agreement REST resource.

Specified by:
destroy in interface RestNegotiation
Throws:
ResourceUnknownException - the referenced resource does not exist
ResourceUnavailableException - the referenced resource is not available


Copyright © 2008-2012. All Rights Reserved.