org.ogf.graap.wsag.client.local
Class LocalNegotiationServiceImpl

java.lang.Object
  extended by org.ogf.graap.wsag.client.local.LocalWsClient
      extended by org.ogf.graap.wsag.client.local.LocalNegotiationServiceImpl
All Implemented Interfaces:
NegotiationService, WsClient

public class LocalNegotiationServiceImpl
extends LocalWsClient
implements NegotiationService

Default implementation of a negotiation service client for local access to a negotiation service instance. Internal use only.

Author:
hrasheed

Constructor Summary
LocalNegotiationServiceImpl(Negotiation negotiation)
           
 
Method Summary
 void advertise(NegotiationOfferType[] quotes)
          Advertises a set of negotiation offers.
 void destroy()
          Destroys this web service object.
 AgreementTemplateType[] getNegotiableTemplates()
          A negotiation instance supports zero or more templates that can be used to create negotiation offers.
 NegotiationContextType getNegotiationContext()
          Returns the context of this negotiation process.
 NegotiationOfferType[] getNegotiationOffers()
          Returns a history of exchanged offers in this negotiation process.
 NegotiationOfferType[] negotiate(NegotiationOfferType[] quotes)
          Negotiates a set of agreement offers.
 void terminate()
          Terminates a negotiation process.
 
Methods inherited from class org.ogf.graap.wsag.client.local.LocalWsClient
getEndpoint, getProperties, getSecurityProperties, getWebServiceClient, isUsingTrace, setProperties, setTrace
 
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.client.NegotiationService
getWebServiceClient
 

Constructor Detail

LocalNegotiationServiceImpl

public LocalNegotiationServiceImpl(Negotiation negotiation)
Parameters:
negotiation - the negotiation service
Method Detail

getNegotiationContext

public NegotiationContextType getNegotiationContext()
                                             throws ResourceUnknownException,
                                                    ResourceUnavailableException
Returns the context of this negotiation process.

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

getNegotiableTemplates

public AgreementTemplateType[] getNegotiableTemplates()
                                               throws ResourceUnknownException,
                                                      ResourceUnavailableException
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 NegotiationService
Returns:
the negotiable templates
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getNegotiationOffers

public NegotiationOfferType[] getNegotiationOffers()
                                            throws ResourceUnknownException,
                                                   ResourceUnavailableException
Returns a history of exchanged offers in this negotiation process.

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

negotiate

public NegotiationOfferType[] negotiate(NegotiationOfferType[] quotes)
                                 throws NegotiationException,
                                        ResourceUnknownException,
                                        ResourceUnavailableException
Negotiates a set of agreement offers.

Specified by:
negotiate in interface NegotiationService
Parameters:
quotes - 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(NegotiationOfferType[] quotes)
               throws NegotiationException,
                      ResourceUnknownException,
                      ResourceUnavailableException
Advertises a set of negotiation offers.

Specified by:
advertise in interface NegotiationService
Parameters:
quotes - 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()
               throws ResourceUnavailableException,
                      ResourceUnknownException
Terminates a negotiation process.

Specified by:
terminate in interface NegotiationService
Throws:
ResourceUnavailableException - the remote resource is unavailable
ResourceUnknownException - the remote resource is unknown

destroy

public void destroy()
             throws ResourceUnavailableException,
                    ResourceUnknownException
Destroys this web service object.

Specified by:
destroy in interface NegotiationService
Throws:
ResourceUnavailableException - the remote resource is unavailable
ResourceUnknownException - the remote resource is unknown


Copyright © 2008-2012 Fraunhofer Institute SCAI. All Rights Reserved.