org.ogf.graap.wsag.client.impl
Class NegotiationClientImpl

java.lang.Object
  extended by org.ogf.graap.wsag.client.impl.NegotiationClientImpl
All Implemented Interfaces:
NegotiationClient, NegotiationService, WsClient
Direct Known Subclasses:
LocalNegotiationClientImpl, RemoteNegotiationClientImpl

public abstract class NegotiationClientImpl
extends Object
implements NegotiationClient

NegotiationClientImpl

Author:
hrasheed

Constructor Summary
protected NegotiationClientImpl(NegotiationService negotiationClient)
          Creates a new negotiation client for the given negotiation service implementation.
 
Method Summary
 void advertise(NegotiationOfferType[] quotes)
          Advertises a set of negotiation offers.
abstract  NegotiationClient clone()
          Returns a copy of the client.
 void destroy()
          Destroys this web service object.
 EndpointReferenceType getEndpoint()
          Returns the endpoint of the client instance.
 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 getNegotiationOffer(String offerID)
          Returns the Negotiation Offer with the given offer id
 NegotiationOfferType[] getNegotiationOffers()
          Returns a history of exchanged offers in this negotiation process.
 Properties getProperties()
          Returns the properties used by the web-service client.
 ISecurityProperties getSecurityProperties()
          Returns the security properties used by the web-service client.
 boolean isUsingTrace()
          Determines whether or not a client prints the web-service messages to the console.
 NegotiationOfferType[] negotiate(NegotiationOfferType[] quotes)
          Negotiates a set of agreement offers.
 void setProperties(Properties properties)
          Sets the properties used for the web-service client.
 void setTrace(boolean trace)
          Sets the clients trace mode.
 void terminate()
          Terminates a negotiation.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ogf.graap.wsag.api.client.NegotiationService
getWebServiceClient
 

Constructor Detail

NegotiationClientImpl

protected NegotiationClientImpl(NegotiationService negotiationClient)
Creates a new negotiation client for the given negotiation service implementation.

Parameters:
negotiationClient - the negotiation service client implemenation
Method Detail

clone

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

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

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

getNegotiationOffer

public NegotiationOfferType getNegotiationOffer(String offerID)
                                         throws ResourceUnknownException,
                                                ResourceUnavailableException
Returns the Negotiation Offer with the given offer id

Specified by:
getNegotiationOffer in interface NegotiationClient
Parameters:
offerID - the offerID of the negotiation offer to retrieve
Returns:
the negotiation offer with the given offer id
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

terminate

public void terminate()
               throws ResourceUnknownException,
                      ResourceUnavailableException
Terminates a negotiation.

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

destroy

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

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

getEndpoint

public EndpointReferenceType getEndpoint()
Returns the endpoint of the client instance.

Specified by:
getEndpoint in interface WsClient
Returns:
Returns the endpoint reference for this WS resource.

getProperties

public Properties getProperties()
Returns the properties used by the web-service client.

Specified by:
getProperties in interface WsClient
Returns:
a list of properties associated with the client

setProperties

public void setProperties(Properties properties)
Sets the properties used for the web-service client.

Specified by:
setProperties in interface WsClient
Parameters:
properties - Sets the properties for this client

isUsingTrace

public boolean isUsingTrace()
Determines whether or not a client prints the web-service messages to the console.

Specified by:
isUsingTrace in interface WsClient
Returns:
true, if the web service client traces the incoming/outgoing messages.

setTrace

public void setTrace(boolean trace)
Sets the clients trace mode.

Specified by:
setTrace in interface WsClient
Parameters:
trace - true, if the web service client should traces incoming/outgoing messages.

getSecurityProperties

public ISecurityProperties getSecurityProperties()
Returns the security properties used by the web-service client.

Specified by:
getSecurityProperties in interface WsClient
Returns:
the security properties for this client
See Also:
WsrfResourceClient.getSecurityProperties()


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