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

java.lang.Object
  extended by org.ogf.graap.wsag.client.impl.AgreementImpl
All Implemented Interfaces:
AgreementClient, AgreementService, WsClient
Direct Known Subclasses:
LocalAgreementClientImpl, RemoteAgreementClientImpl

public abstract class AgreementImpl
extends Object
implements AgreementClient

AgreementImpl

Author:
Oliver Waeldrich

Constructor Summary
protected AgreementImpl(AgreementService agreementClient)
          Creates an agreement client for the given agreement service implementation.
 
Method Summary
abstract  AgreementClient clone()
          Returns a copy of the client.
 void destroy()
          Destroys agreement instance.
 String getAgreementId()
          Returns the id of the agreement instance.
 AgreementContextType getContext()
          Returns the context of the agreement instance.
 EndpointReferenceType getEndpoint()
          Returns the endpoint of the client instance.
 GuaranteeTermStateType getGuaranteeTermState(String name)
          Returns the guarantee term with the given name.
 GuaranteeTermStateType[] getGuaranteeTermStates()
          Returns the state for the individual guarantee terms of the agreement instance.
 String getName()
          Returns the name of the agreement instance.
 Properties getProperties()
          Returns the properties used by the web-service client.
 ISecurityProperties getSecurityProperties()
          Returns the security properties used by the web-service client.
 ServiceTermStateType getServiceTermState(String name)
          Returns the service description term with the given name.
 ServiceTermStateType[] getServiceTermStates()
          Returns the state for the individual service terms of the agreement instance.
 AgreementStateType getState()
          Returns the state of the agreement instance.
 TermTreeType getTerms()
          Returns the terms of the agreement instance.
 boolean isUsingTrace()
          Determines whether or not a client prints the web-service messages to the console.
 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 an agreement.
 void terminate(TerminateInputType reason)
          Terminates the agreement instance.
 
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.AgreementService
getWebServiceClient
 

Constructor Detail

AgreementImpl

protected AgreementImpl(AgreementService agreementClient)
Creates an agreement client for the given agreement service implementation.

Parameters:
agreementClient - the agreement service client
Method Detail

clone

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

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

getContext

public AgreementContextType getContext()
                                throws ResourceUnknownException,
                                       ResourceUnavailableException
Returns the context of the agreement instance.

Specified by:
getContext in interface AgreementService
Returns:
the agreement context
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getGuaranteeTermStates

public GuaranteeTermStateType[] getGuaranteeTermStates()
                                                throws ResourceUnknownException,
                                                       ResourceUnavailableException
Returns the state for the individual guarantee terms of the agreement instance.

Specified by:
getGuaranteeTermStates in interface AgreementService
Returns:
the guarantee term states
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getGuaranteeTermState

public GuaranteeTermStateType getGuaranteeTermState(String name)
                                             throws ResourceUnknownException,
                                                    ResourceUnavailableException
Returns the guarantee term with the given name.

Specified by:
getGuaranteeTermState in interface AgreementClient
Parameters:
name - the name of the guarantee term to retrieve
Returns:
the guarantee term with the given name
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getAgreementId

public String getAgreementId()
                      throws ResourceUnknownException,
                             ResourceUnavailableException
Returns the id of the agreement instance.

Specified by:
getAgreementId in interface AgreementService
Returns:
the agreement id
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getName

public String getName()
               throws ResourceUnknownException,
                      ResourceUnavailableException
Returns the name of the agreement instance.

Specified by:
getName in interface AgreementService
Returns:
the agreement name
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getServiceTermStates

public ServiceTermStateType[] getServiceTermStates()
                                            throws ResourceUnknownException,
                                                   ResourceUnavailableException
Returns the state for the individual service terms of the agreement instance.

Specified by:
getServiceTermStates in interface AgreementService
Returns:
the service term states
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getServiceTermState

public ServiceTermStateType getServiceTermState(String name)
                                         throws ResourceUnknownException,
                                                ResourceUnavailableException
Returns the service description term with the given name.

Specified by:
getServiceTermState in interface AgreementClient
Parameters:
name - the name of the service description term to retrieve
Returns:
the service description term with the given name
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getState

public AgreementStateType getState()
                            throws ResourceUnknownException,
                                   ResourceUnavailableException
Returns the state of the agreement instance.

Specified by:
getState in interface AgreementService
Returns:
the agreement state
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getTerms

public TermTreeType getTerms()
                      throws ResourceUnknownException,
                             ResourceUnavailableException
Returns the terms of the agreement instance.

Specified by:
getTerms in interface AgreementService
Returns:
the agreement terms
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

terminate

public void terminate()
               throws ResourceUnknownException,
                      ResourceUnavailableException
Terminates an agreement.

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

terminate

public void terminate(TerminateInputType reason)
               throws ResourceUnknownException,
                      ResourceUnavailableException
Terminates the agreement instance.

Specified by:
terminate in interface AgreementService
Parameters:
reason - a domain-specific termination reason
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

destroy

public void destroy()
             throws ResourceUnknownException,
                    ResourceUnavailableException
Destroys agreement instance.

Specified by:
destroy in interface AgreementService
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.