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

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.impl.AbstractClient
      extended by org.ogf.graap.wsag.client.api.impl.AbstractAgreementFactoryClient
          extended by org.ogf.graap.wsag.client.api.local.LocalAgreementFactoryClient
All Implemented Interfaces:
AgreementFactoryClient

public class LocalAgreementFactoryClient
extends AbstractAgreementFactoryClient

An implementation of the Client API for local invocation of an agreement factory.

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from interface org.ogf.graap.wsag.client.api.AgreementFactoryClient
FACTORY
 
Constructor Summary
LocalAgreementFactoryClient(AgreementFactory factory)
          Creates a client for local invocation of an agreement factory.
LocalAgreementFactoryClient(AgreementFactory factory, Agreement[] source)
           
 
Method Summary
 AgreementFactoryClient clone()
          Creates s copy of this AgreementFactoryClient.
 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.
 RemoteClient getRemoteClient()
          Returns the remote client used by this implementation in order to communicate with the WSAG4J server.
 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.
 NegotiationClient initiateNegotiation(NegotiationContextType context)
          Initiates a Negotiation.
 AgreementClient[] listAgreements()
          Lists all agreements of this factory.
 
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

LocalAgreementFactoryClient

public LocalAgreementFactoryClient(AgreementFactory factory)
Creates a client for local invocation of an agreement factory.

Parameters:
factory - the factory object

LocalAgreementFactoryClient

public LocalAgreementFactoryClient(AgreementFactory factory,
                                   Agreement[] source)
Parameters:
factory - the local factory object
source - the agreements associated with this registry.
Method Detail

clone

public AgreementFactoryClient clone()
                             throws CloneNotSupportedException
Creates s copy of this AgreementFactoryClient.

Specified by:
clone in interface AgreementFactoryClient
Specified by:
clone in class AbstractAgreementFactoryClient
Returns:
the cloned agreement factory client
Throws:
CloneNotSupportedException - this particular client implementation does not support cloning

createAgreement

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

Specified by:
createAgreement in interface AgreementFactoryClient
Specified by:
createAgreement in class AbstractAgreementFactoryClient
Parameters:
offer - the offer to create the agreement for
Returns:
the created agreement
Throws:
AgreementFactoryException - the agreement offer was rejected by the factory

createPendingAgreement

public AgreementClient createPendingAgreement(AgreementOffer offer)
                                       throws AgreementFactoryException
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
Specified by:
createPendingAgreement in class AbstractAgreementFactoryClient
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.

getResourceId

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

Specified by:
getResourceId in interface AgreementFactoryClient
Specified by:
getResourceId in class AbstractAgreementFactoryClient
Returns:
the WSDM resource id

getTemplates

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

Specified by:
getTemplates in interface AgreementFactoryClient
Specified by:
getTemplates in class AbstractAgreementFactoryClient
Returns:
all templates exposed by this agreement factory instance

getTemplate

public AgreementTemplateType getTemplate(String name,
                                         String id)
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
Overrides:
getTemplate in class AbstractAgreementFactoryClient
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.

listAgreements

public AgreementClient[] listAgreements()
Lists all agreements of this factory.

Specified by:
listAgreements in interface AgreementFactoryClient
Specified by:
listAgreements in class AbstractAgreementFactoryClient
Returns:
all agreement clients known by this factory

getRemoteClient

public RemoteClient getRemoteClient()
Description copied from class: AbstractClient
Returns the remote client used by this implementation in order to communicate with the WSAG4J server.

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

createPendingAgreement

public AgreementClient createPendingAgreement(AgreementOffer offer,
                                              EndpointReferenceType acceptanceEPR)
                                       throws AgreementFactoryException
Description copied from class: AbstractAgreementFactoryClient
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
Specified by:
createPendingAgreement in class AbstractAgreementFactoryClient
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.

initiateNegotiation

public NegotiationClient initiateNegotiation(NegotiationContextType context)
                                      throws NegotiationFactoryException
Description copied from class: AbstractAgreementFactoryClient
Initiates a Negotiation. Initiates a new negotiation process.

Specified by:
initiateNegotiation in interface AgreementFactoryClient
Specified by:
initiateNegotiation in class AbstractAgreementFactoryClient
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

getResourceProperties

public AgreementFactoryPropertiesType getResourceProperties()
                                                     throws ResourceUnknownException,
                                                            ResourceUnavailableException
Description copied from class: AbstractAgreementFactoryClient
Returns the resource properties of the agreement factory instance.

Specified by:
getResourceProperties in interface AgreementFactoryClient
Specified by:
getResourceProperties in class AbstractAgreementFactoryClient
Returns:
the agreement factory resource properties
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable


Copyright © 2008-2012. All Rights Reserved.