org.ogf.graap.wsag.client.wsrf
Class WsrfAgreementFactoryClient

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.RemoteClient
      extended by org.ogf.graap.wsag.client.wsrf.WsrfAgreementFactoryClient
All Implemented Interfaces:
AgreementFactoryClient

public class WsrfAgreementFactoryClient
extends RemoteClient
implements AgreementFactoryClient

RemoteAgreementFactoryClientImpl

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from interface org.ogf.graap.wsag.client.api.AgreementFactoryClient
FACTORY
 
Constructor Summary
WsrfAgreementFactoryClient(EndpointReferenceType epr, Properties properties, ISecurityProperties securityProperties)
          Creates a new agreement factory client for a given endpoint using the given security properties.
 
Method Summary
 AgreementFactoryClient clone()
          Returns a copy of the client.
 AgreementClient createAgreement(AgreementOffer offer)
          Creates a new agreement instance.
 AgreementClient createPendingAgreement(AgreementOffer offer)
          Creates a new pending agreement instance.
 AgreementClient createPendingAgreement(AgreementOffer offer, EndpointReferenceType acceptanceEPR)
          Creates a new pending agreement instance.
 WsrfAgreementFactoryService getAgreementFactoryClient()
           
 WsrfAgreementRegistryService getAgreementRegistryClient()
           
 EndpointReferenceType getEndpoint()
          
 RemoteClient getRemoteClient()
          Returns the web service client used for communication with the SLA management system.
 String getResourceId()
          Returns the WSDM id of a web-service resource.
 AgreementFactoryPropertiesType getResourceProperties()
          Returns the resource properties of the agreement factory instance.
 AgreementTemplateType getTemplate(String name, String id)
          Returns a template with a particular name and id from the server, or null if the requested template does not exist.
 AgreementTemplateType[] getTemplates()
          Returns the templates supported by this factory.
 RemoteClient getWebServiceClient()
          
 NegotiationClient initiateNegotiation(NegotiationContextType context)
          Initiates a Negotiation.
 AgreementClient[] listAgreements()
          Lists all agreements of this factory.
 void setProperties(Properties properties)
          Sets the properties used for the web-service client.
 void setTrace(boolean trace)
          Turns trace on/off.
 
Methods inherited from class org.ogf.graap.wsag.client.api.RemoteClient
getProperties, getRemoteReference, getSecurityProperties, isUsingTrace, setSecurityProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrfAgreementFactoryClient

public WsrfAgreementFactoryClient(EndpointReferenceType epr,
                                  Properties properties,
                                  ISecurityProperties securityProperties)
Creates a new agreement factory client for a given endpoint using the given security properties.

Parameters:
epr - the agreement factory endpoint
securityProperties - the client security properties
Method Detail

clone

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

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

getWebServiceClient

public RemoteClient getWebServiceClient()


getEndpoint

public EndpointReferenceType getEndpoint()


getRemoteClient

public RemoteClient getRemoteClient()
Description copied from interface: AgreementFactoryClient
Returns the web service client used for communication with the SLA management system.

Specified by:
getRemoteClient in interface AgreementFactoryClient
Returns:
the web service client for this service.

getTemplates

public AgreementTemplateType[] getTemplates()
                                     throws ResourceUnknownException,
                                            ResourceUnavailableException
Returns the templates supported by this factory. Retrieves the templates for supported SLAs from the SLA management system.

Specified by:
getTemplates in interface AgreementFactoryClient
Returns:
all templates exposed by this agreement factory instance
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

createAgreement

public AgreementClient createAgreement(AgreementOffer offer)
                                throws AgreementFactoryException,
                                       ResourceUnknownException,
                                       ResourceUnavailableException
Creates a new agreement instance.

Specified by:
createAgreement in interface AgreementFactoryClient
Parameters:
offer - the offer to create the agreement for
Returns:
the created agreement
Throws:
AgreementFactoryException - the agreement offer was rejected by the factory
ResourceUnavailableException - the requested agreement factory resource is unavailable
ResourceUnknownException - the requested agreement factory resource is unknown

createPendingAgreement

public AgreementClient createPendingAgreement(AgreementOffer offer)
                                       throws AgreementFactoryException,
                                              ResourceUnknownException,
                                              ResourceUnavailableException
Creates a new pending agreement instance. Creates a pending agreement instance. The decision whether to accept or reject the agreement is deferred.

Specified by:
createPendingAgreement in interface AgreementFactoryClient
Parameters:
offer - The agreement offer passed from the agreement initiator.
Returns:
An AgreementClient for the new created agreement.
Throws:
AgreementFactoryException - An error occurred during the the agreement creation. The agreement was rejected.
ResourceUnknownException - No pending agreement factory exists at the specified endpoint.
ResourceUnavailableException - The agreement factory at the specified endpoint is not accessible.

createPendingAgreement

public AgreementClient createPendingAgreement(AgreementOffer offer,
                                              EndpointReferenceType acceptanceEPR)
                                       throws AgreementFactoryException,
                                              ResourceUnknownException,
                                              ResourceUnavailableException
Creates a new pending agreement instance. Creates a pending agreement instance. The decision whether to accept or reject the agreement is deferred. Once the decision has been made the client is notified via the given notification endpoint.

Specified by:
createPendingAgreement in interface AgreementFactoryClient
Parameters:
offer - The agreement offer passed from the agreement initiator.
acceptanceEPR - An endpoint to an agreement acceptance instance.
Returns:
An AgreementClient for the new created agreement.
Throws:
AgreementFactoryException - An error occurred during the the agreement creation. The agreement was rejected.
ResourceUnknownException - No pending agreement factory exists at the specified endpoint.
ResourceUnavailableException - The agreement factory at the specified endpoint is not accessible.

initiateNegotiation

public NegotiationClient initiateNegotiation(NegotiationContextType context)
                                      throws NegotiationFactoryException,
                                             ResourceUnknownException,
                                             ResourceUnavailableException
Initiates a Negotiation. Initiates a new negotiation process.

Specified by:
initiateNegotiation in interface AgreementFactoryClient
Parameters:
context - the context for the negotiation to initialize
Returns:
the new initiated negotiation instance
Throws:
NegotiationFactoryException - indicates that the creation of a negotiation process was rejected
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getResourceId

public String getResourceId()
                     throws ResourceUnknownException,
                            ResourceUnavailableException
Returns the WSDM id of a web-service resource.

Specified by:
getResourceId in interface AgreementFactoryClient
Returns:
the WSDM resource id
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getTemplate

public AgreementTemplateType getTemplate(String name,
                                         String id)
                                  throws ResourceUnknownException,
                                         ResourceUnavailableException
Description copied from interface: AgreementFactoryClient
Returns a template with a particular name and id from the server, or null if the requested template does not exist.

Specified by:
getTemplate in interface AgreementFactoryClient
Parameters:
name - the name of the requested template
id - the id of the requested template
Returns:
a template with the given name and id, or null if no appropriate template was found. a template with the given name and id, or null if no appropriate template was found.
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

listAgreements

public AgreementClient[] listAgreements()
                                 throws ResourceUnknownException,
                                        ResourceUnavailableException
Lists all agreements of this factory.

Specified by:
listAgreements in interface AgreementFactoryClient
Returns:
all agreement clients known by this factory
Throws:
ResourceUnavailableException - the requested agreement factory resource is unavailable
ResourceUnknownException - the requested agreement factory resource is unknown

setTrace

public void setTrace(boolean trace)
Turns trace on/off.

Overrides:
setTrace in class RemoteClient
Parameters:
trace - turns trace on/off.

setProperties

public void setProperties(Properties properties)
Description copied from class: RemoteClient
Sets the properties used for the web-service client.

Overrides:
setProperties in class RemoteClient
Parameters:
properties - The properties to set.

getAgreementFactoryClient

public WsrfAgreementFactoryService getAgreementFactoryClient()
Returns:
Returns the agreement factory client.

getAgreementRegistryClient

public WsrfAgreementRegistryService getAgreementRegistryClient()
Returns:
Returns the agreement registry client.

getResourceProperties

public AgreementFactoryPropertiesType getResourceProperties()
                                                     throws ResourceUnknownException,
                                                            ResourceUnavailableException
Returns the resource properties of the agreement factory instance.

Specified by:
getResourceProperties in interface AgreementFactoryClient
Returns:
the agreement factory resource properties
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable
See Also:
AgreementFactoryClient.getResourceProperties()


Copyright © 2008-2012. All Rights Reserved.