org.ogf.graap.wsag.client.api.local
Class LocalNegotiationClient

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.impl.AbstractClient
      extended by org.ogf.graap.wsag.client.api.impl.NegotiationClientImpl
          extended by org.ogf.graap.wsag.client.api.local.LocalNegotiationClient
All Implemented Interfaces:
NegotiationClient

public class LocalNegotiationClient
extends NegotiationClientImpl

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

Author:
hrasheed

Field Summary
 
Fields inherited from interface org.ogf.graap.wsag.client.api.NegotiationClient
FACTORY
 
Constructor Summary
LocalNegotiationClient(Negotiation negotiation)
           
 
Method Summary
 void advertise(NegotiationOfferType[] quotes)
          Advertises a set of negotiation offers.
 NegotiationClient clone()
          Returns a copy of the client.
 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.
 RemoteClient getRemoteClient()
          Returns the remote client used by this implementation in order to communicate with the WSAG4J server.
 NegotiationOfferType[] negotiate(NegotiationOfferType[] quotes)
          Negotiates a set of agreement offers.
 void terminate()
          Terminates a negotiation.
 
Methods inherited from class org.ogf.graap.wsag.client.api.impl.NegotiationClientImpl
getNegotiationOffer
 
Methods inherited from class org.ogf.graap.wsag.client.api.impl.AbstractClient
getProperties, getRemoteReference, getSecurityProperties, isUsingTrace, setProperties, setTrace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalNegotiationClient

public LocalNegotiationClient(Negotiation negotiation)
Parameters:
negotiation - the negotiation instance
Method Detail

clone

public NegotiationClient clone()
                        throws CloneNotSupportedException
Returns a copy of the client.

Specified by:
clone in interface NegotiationClient
Specified by:
clone in class NegotiationClientImpl
Returns:
the cloned NegotiationClient
Throws:
CloneNotSupportedException - indicates that a particular client implementation does not support cloning

getRemoteClient

public RemoteClient getRemoteClient()
Returns the remote client used by this implementation in order to communicate with the WSAG4J server.

Specified by:
getRemoteClient in interface NegotiationClient
Specified by:
getRemoteClient in class AbstractClient
Returns:
the remote client

getNegotiationContext

public NegotiationContextType getNegotiationContext()
                                             throws ResourceUnknownException,
                                                    ResourceUnavailableException
Description copied from class: NegotiationClientImpl
Returns the context of this negotiation process.

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

getNegotiableTemplates

public AgreementTemplateType[] getNegotiableTemplates()
                                               throws ResourceUnknownException,
                                                      ResourceUnavailableException
Description copied from class: NegotiationClientImpl
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 NegotiationClient
Specified by:
getNegotiableTemplates in class NegotiationClientImpl
Returns:
the negotiable templates
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getNegotiationOffers

public NegotiationOfferType[] getNegotiationOffers()
                                            throws ResourceUnknownException,
                                                   ResourceUnavailableException
Description copied from class: NegotiationClientImpl
Returns a history of exchanged offers in this negotiation process.

Specified by:
getNegotiationOffers in interface NegotiationClient
Specified by:
getNegotiationOffers in class NegotiationClientImpl
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
Description copied from class: NegotiationClientImpl
Negotiates a set of agreement offers.

Specified by:
negotiate in interface NegotiationClient
Specified by:
negotiate in class NegotiationClientImpl
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
Description copied from class: NegotiationClientImpl
Advertises a set of negotiation offers.

Specified by:
advertise in interface NegotiationClient
Specified by:
advertise in class NegotiationClientImpl
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 ResourceUnknownException,
                      ResourceUnavailableException
Description copied from class: NegotiationClientImpl
Terminates a negotiation.

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

destroy

public void destroy()
             throws ResourceUnknownException,
                    ResourceUnavailableException
Description copied from class: NegotiationClientImpl
Destroys this web service object.

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


Copyright © 2008-2012. All Rights Reserved.