org.ogf.graap.wsag.client.api.impl
Class AgreementClientImpl

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.impl.AbstractClient
      extended by org.ogf.graap.wsag.client.api.impl.AgreementClientImpl
All Implemented Interfaces:
AgreementClient
Direct Known Subclasses:
LocalAgreementClient, RestAgreementClient, WsrfAgreementClient

public abstract class AgreementClientImpl
extends AbstractClient
implements AgreementClient

Default implementation of an agreement client. Concrete implementations must provide a proper implementation of the server interaction.

Author:
Oliver Waeldrich

Field Summary
 
Fields inherited from interface org.ogf.graap.wsag.client.api.AgreementClient
FACTORY
 
Constructor Summary
AgreementClientImpl()
           
 
Method Summary
abstract  AgreementClient clone()
          Returns a copy of the client.
abstract  void destroy()
          Destroys agreement instance.
abstract  String getAgreementId()
          Returns the id of the agreement instance.
abstract  AgreementContextType getContext()
          Returns the context of the agreement instance.
 GuaranteeTermStateType getGuaranteeTermState(String name)
          Returns the guarantee term with the given name.
abstract  GuaranteeTermStateType[] getGuaranteeTermStates()
          Returns the state for the individual guarantee terms of the agreement instance.
abstract  String getName()
          Returns the name of the agreement instance.
abstract  AgreementPropertiesType getResourceProperties()
          Returns the resource properties of the agreement instance.
 ServiceTermStateType getServiceTermState(String name)
          Returns the service description term with the given name.
abstract  ServiceTermStateType[] getServiceTermStates()
          Returns the state for the individual service terms of the agreement instance.
abstract  AgreementStateType getState()
          Returns the state of the agreement instance.
abstract  TermTreeType getTerms()
          Returns the terms of the agreement instance.
 void terminate()
          Terminates an agreement.
abstract  void terminate(TerminateInputType reason)
          Terminates the agreement instance.
 
Methods inherited from class org.ogf.graap.wsag.client.api.impl.AbstractClient
getProperties, getRemoteClient, getRemoteReference, getSecurityProperties, isUsingTrace, setProperties, setTrace
 
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.client.api.AgreementClient
getRemoteClient
 

Constructor Detail

AgreementClientImpl

public AgreementClientImpl()
Method Detail

getContext

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

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

getGuaranteeTermStates

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

Specified by:
getGuaranteeTermStates in interface AgreementClient
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 abstract String getAgreementId()
                               throws ResourceUnknownException,
                                      ResourceUnavailableException
Returns the id of the agreement instance.

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

getName

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

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

getServiceTermStates

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

Specified by:
getServiceTermStates in interface AgreementClient
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 abstract AgreementStateType getState()
                                     throws ResourceUnknownException,
                                            ResourceUnavailableException
Returns the state of the agreement instance.

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

getTerms

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

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

getResourceProperties

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

Specified by:
getResourceProperties in interface AgreementClient
Returns:
the agreement resource properties
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 abstract void terminate(TerminateInputType reason)
                        throws ResourceUnknownException,
                               ResourceUnavailableException
Terminates the agreement instance.

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

destroy

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

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

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


Copyright © 2008-2012. All Rights Reserved.