org.ogf.graap.wsag.client.remote
Class RemoteAgreementFactoryServiceImpl

java.lang.Object
  extended by org.ogf.graap.wsag.client.remote.WsrfResourceClient
      extended by org.ogf.graap.wsag.client.remote.RemoteAgreementFactoryServiceImpl
All Implemented Interfaces:
AgreementFactoryService, WsClient, WSDMResource

public class RemoteAgreementFactoryServiceImpl
extends WsrfResourceClient
implements AgreementFactoryService

Default implementation of an agreement factory service client.

Author:
Oliver Waeldrich
See Also:
AgreementFactoryService

Field Summary
 
Fields inherited from class org.ogf.graap.wsag.client.remote.WsrfResourceClient
ANONYMOUS_EPR, EXTRA_HEADERS
 
Constructor Summary
RemoteAgreementFactoryServiceImpl(EndpointReferenceType epr, ISecurityProperties securityProperties)
          Instantiates an agreement factory service client for the given EPR.
 
Method Summary
 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.
 String getResourceId()
          Returns the WSDM id of a web-service resource.
 AgreementTemplateType[] getTemplates()
          Retrieves the templates for supported SLAs from the SLA management system.
 WsClient getWebServiceClient()
          Returns the web-service client used for communicating with the SLA management server.
 NegotiationClient initiateNegotiation(NegotiationContextType context)
          Initiates a new negotiation process.
 NegotiationClient initiateNegotiation(NegotiationContextType context, EndpointReferenceType initiatorEPR)
          Initiates a new negotiation process with a wsag4j server.
 
Methods inherited from class org.ogf.graap.wsag.client.remote.WsrfResourceClient
deleteResourceProperty, destroy, getDefaultSOAPClient, getEndpoint, getMultipleResourceProperties, getProperties, getResourceProperty, getResourcePropertyDocument, getSecurityProperties, invoke, isUseDefaultSOAPClient, isUsingTrace, queryResourceProperties, setDefaultSOAPClient, setProperties, setResourceProperties, setTerminationTime, setTrace, setUseDefaultSOAPClient, updateResourceProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteAgreementFactoryServiceImpl

public RemoteAgreementFactoryServiceImpl(EndpointReferenceType epr,
                                         ISecurityProperties securityProperties)
Instantiates an agreement factory service client for the given EPR.

Parameters:
epr - the agreement factory service endpoint reference
securityProperties - the security properties to use
Method Detail

getWebServiceClient

public WsClient getWebServiceClient()
Returns the web-service client used for communicating with the SLA management server.

Specified by:
getWebServiceClient in interface AgreementFactoryService
Returns:
the web service client for this service.

createAgreement

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

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

createPendingAgreement

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

Specified by:
createPendingAgreement in interface AgreementFactoryService
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 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 AgreementFactoryService
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 new negotiation process.

Specified by:
initiateNegotiation in interface AgreementFactoryService
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

initiateNegotiation

public NegotiationClient initiateNegotiation(NegotiationContextType context,
                                             EndpointReferenceType initiatorEPR)
                                      throws NegotiationFactoryException,
                                             ResourceUnknownException,
                                             ResourceUnavailableException
Initiates a new negotiation process with a wsag4j server.

Parameters:
context - the negotiation context
initiatorEPR - the endpoint of the wsag4j server
Returns:
a new negotiation client
Throws:
NegotiationFactoryException - The negotiation process was not initiated.
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getTemplates

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

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

getResourceId

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

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


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