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

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.impl.AbstractClient
      extended by org.ogf.graap.wsag.client.api.impl.AgreementClientImpl
          extended by org.ogf.graap.wsag.client.wsrf.WsrfAgreementClient
All Implemented Interfaces:
AgreementClient

public class WsrfAgreementClient
extends AgreementClientImpl

AgreementImpl

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from interface org.ogf.graap.wsag.client.api.AgreementClient
FACTORY
 
Constructor Summary
WsrfAgreementClient(EndpointReferenceType epr, Properties properties, ISecurityProperties securityProperties)
          Instantiates a new agreement client for the given EPR.
 
Method Summary
 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()
          
 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 of the remote client.
 WsrfResourceClient getRemoteClient()
          Returns the remote client used by this implementation in order to communicate with the WSAG4J server.
 AgreementPropertiesType getResourceProperties()
          Returns the resource properties of the agreement instance.
 ISecurityProperties getSecurityProperties()
          Returns the security properties of the remote 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()
          Returns whether or not the remote client traces the messages to the console.
 void setProperties(Properties properties)
          Sets the properties for the remote client.
 void setTrace(boolean trace)
          Sets whether or not the remote client traces the messages to the console.
 void terminate()
          Terminates an agreement.
 void terminate(TerminateInputType reason)
          Terminates the agreement instance.
 
Methods inherited from class org.ogf.graap.wsag.client.api.impl.AbstractClient
getRemoteReference
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrfAgreementClient

public WsrfAgreementClient(EndpointReferenceType epr,
                           Properties properties,
                           ISecurityProperties securityProperties)
Instantiates a new agreement client for the given EPR.

Parameters:
epr - the agreement endpoint reference.
securityProperties - the security properties
Method Detail

clone

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

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

getRemoteClient

public WsrfResourceClient 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 AgreementClient
Specified by:
getRemoteClient in class AbstractClient
Returns:
the remote client

getContext

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

Specified by:
getContext in interface AgreementClient
Specified by:
getContext in class AgreementClientImpl
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 AgreementClient
Specified by:
getGuaranteeTermStates in class AgreementClientImpl
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
Overrides:
getGuaranteeTermState in class AgreementClientImpl
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 AgreementClient
Specified by:
getAgreementId in class AgreementClientImpl
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 AgreementClient
Specified by:
getName in class AgreementClientImpl
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 AgreementClient
Specified by:
getServiceTermStates in class AgreementClientImpl
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
Overrides:
getServiceTermState in class AgreementClientImpl
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 AgreementClient
Specified by:
getState in class AgreementClientImpl
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 AgreementClient
Specified by:
getTerms in class AgreementClientImpl
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
Overrides:
terminate in class AgreementClientImpl
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 AgreementClient
Specified by:
terminate in class AgreementClientImpl
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 AgreementClient
Specified by:
destroy in class AgreementClientImpl
Throws:
ResourceUnknownException - the remote resource is unknown
ResourceUnavailableException - the remote resource is unavailable

getEndpoint

public EndpointReferenceType getEndpoint()


getProperties

public Properties getProperties()
Returns the properties of the remote client.

Overrides:
getProperties in class AbstractClient
Returns:
the remote client properties

setProperties

public void setProperties(Properties properties)
Sets the properties for the remote client.

Overrides:
setProperties in class AbstractClient
Parameters:
properties - the remote client properties

isUsingTrace

public boolean isUsingTrace()
Returns whether or not the remote client traces the messages to the console.

Overrides:
isUsingTrace in class AbstractClient
Returns:
trace mode enabled

setTrace

public void setTrace(boolean trace)
Sets whether or not the remote client traces the messages to the console.

Overrides:
setTrace in class AbstractClient
Parameters:
trace - trace mode

getSecurityProperties

public ISecurityProperties getSecurityProperties()
Returns the security properties of the remote client.

Overrides:
getSecurityProperties in class AbstractClient
Returns:
the security properties for this client
See Also:
WsrfResourceClient.getSecurityProperties()

getResourceProperties

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

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


Copyright © 2008-2012. All Rights Reserved.