org.ogf.graap.wsag.client.api
Interface AgreementFactoryClient

All Known Implementing Classes:
AbstractAgreementFactoryClient, LocalAgreementFactoryClient, RestAgreementFactoryClient, WsrfAgreementFactoryClient

public interface AgreementFactoryClient

Client interface to interact with an agreement factory.

Author:
Oliver Waeldrich

Field Summary
static ClientLocator<AgreementFactoryClient> FACTORY
          Default builder.
 
Method Summary
 AgreementFactoryClient clone()
          Returns a copy of the client.
 AgreementClient createAgreement(AgreementOffer offer)
          Creates a new agreement instance with the SLA management server.
 AgreementClient createPendingAgreement(AgreementOffer offer)
          Creates a pending agreement instance.
 AgreementClient createPendingAgreement(AgreementOffer offer, EndpointReferenceType acceptanceEPR)
          Creates a pending agreement instance.
 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()
          Retrieves the templates for supported SLAs from the SLA management system.
 NegotiationClient initiateNegotiation(NegotiationContextType context)
          Initiates a new negotiation process.
 AgreementClient[] listAgreements()
          Lists the agreement instances of a particular agreement factory.
 

Field Detail

FACTORY

static final ClientLocator<AgreementFactoryClient> FACTORY
Default builder.

Method Detail

getResourceId

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

Returns:
the WSDM resource id
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getTemplates

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

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

createAgreement

AgreementClient createAgreement(AgreementOffer offer)
                                throws AgreementFactoryException,
                                       ResourceUnknownException,
                                       ResourceUnavailableException
Creates a new agreement instance with the SLA management server.

Parameters:
offer - the agreement offer
Returns:
a client for the created agreement
Throws:
AgreementFactoryException - indicates that the agreement was rejected by the factory
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

createPendingAgreement

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

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

AgreementClient createPendingAgreement(AgreementOffer offer,
                                       EndpointReferenceType acceptanceEPR)
                                       throws AgreementFactoryException,
                                              ResourceUnknownException,
                                              ResourceUnavailableException
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.

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

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

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

listAgreements

AgreementClient[] listAgreements()
                                 throws ResourceUnknownException,
                                        ResourceUnavailableException
Lists the agreement instances of a particular agreement factory.

Returns:
a set of registered agreements
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getTemplate

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

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.
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getResourceProperties

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

Returns:
the agreement factory resource properties
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getRemoteClient

RemoteClient getRemoteClient()
Returns the web service client used for communication with the SLA management system.

Returns:
the web service client for this service.

clone

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

Returns:
the cloned AgreementFactoryClient
Throws:
CloneNotSupportedException - indicates that the particular client implementation does not support cloning


Copyright © 2008-2012. All Rights Reserved.