amwebarsentitlementservice.client
Interface AMWebARSClient

All Superinterfaces:
java.lang.Cloneable, PoolElement
All Known Implementing Classes:
FixedProviderClient

public interface AMWebARSClient
extends PoolElement

A AMWebARSClient manages all the communciation with dynADI providers. We use an interface as superclass, because this allows mix-ins of other classes.


Method Summary
 void addContainer(AMWebARSContainer container)
          Adds a AMWebARSContainer to the client.
 void addContainerDescriptor(AMWebARSContainerDescriptor descriptor)
          Adds a container descriptor to the client.
 void clear()
          Removed all AMWebARSContainerDescriptors from the client.
 boolean containsContainerDescriptor(AMWebARSContainerDescriptor descriptor)
          Tests the client contains a certain descriptor.
 java.util.Iterator elements()
          Returns an Enumeration of the AMWebARSContainerDescriptors, stored in the client.
 AMWebARSClientMemento generateMemento()
          Generates a new AMWebARSClientMemento which represents the clients current state.
 java.util.Map getAppContext()
          Gets the app_context.
 AMWebARSProtocol getProtocol()
          Gets the protocol.
 AMWebARSProvider getProvider()
          Gets the provider.
 java.net.URL getRequestedURL()
          Gets the requestedURL.
 Session getSession()
          Gets the session.
 Subject getSubject()
          Gets the subject.
 ClientInitStatus init()
          Inits the client and the corresponding protocol.
 boolean isEmpty()
          Tests whether this client contains no AMWebARSContainerDescriptors.
 java.util.Iterator keys()
          Returns an Enumeration of the container_type_ids, stored in the client.
 AMWebARSContainerDescriptor removeContainerDescriptor(AMWebARSContainerDescriptor descriptor)
          Removes a container descriptor from the client.
 ClientRunStatus run()
          Runs the client.
 void setMemento(AMWebARSClientMemento memento)
          Resets the client to the state that is saved in the given memento.
 void setProtocol(AMWebARSProtocol protocol)
          Sets the protocol.
 void setProvider(AMWebARSProvider provider)
          Sets the provider.
 void setRequestedURL(java.net.URL requested_url)
          Sets the requestedURL.
 void setSession(Session session)
          Sets the session.
 void setSubject(Subject subject)
          Sets the subject.
 ClientShutdownStatus shutdown()
          Shuts the client down.
 int size()
          Detirmined the number of AMWebARSContainerDescriptors this client contains.
 
Methods inherited from interface amwebarsentitlementservice.elementpool.PoolElement
clearInternalState, clone, getPoolIndex, setPoolIndex
 

Method Detail

generateMemento

public AMWebARSClientMemento generateMemento()
Generates a new AMWebARSClientMemento which represents the clients current state.

setMemento

public void setMemento(AMWebARSClientMemento memento)
Resets the client to the state that is saved in the given memento.

getSubject

public Subject getSubject()
Gets the subject.
Returns:
Returns a Subject

setSubject

public void setSubject(Subject subject)
Sets the subject.
Parameters:
subject - The subject to set

getAppContext

public java.util.Map getAppContext()
Gets the app_context.
Returns:
Returns a Map of the app_context

getRequestedURL

public java.net.URL getRequestedURL()
Gets the requestedURL.
Returns:
Returns a URL

setRequestedURL

public void setRequestedURL(java.net.URL requested_url)
Sets the requestedURL.
Parameters:
requestedURL - The requestedURL to set

getProvider

public AMWebARSProvider getProvider()
Gets the provider.
Returns:
Returns a AMWebARSProvider

setProvider

public void setProvider(AMWebARSProvider provider)
Sets the provider.
Parameters:
provider - The provider to set

getProtocol

public AMWebARSProtocol getProtocol()
Gets the protocol.
Returns:
Returns a AMWebARSProtocol

setProtocol

public void setProtocol(AMWebARSProtocol protocol)
Sets the protocol.
Parameters:
protocol - The protocol to set

addContainerDescriptor

public void addContainerDescriptor(AMWebARSContainerDescriptor descriptor)
                            throws java.lang.UnsupportedOperationException
Adds a container descriptor to the client. The container descriptor has to match the clients combination of protocol_id and provider_id. Otherwise the method throws an exception.
Parameters:
descriptor - ContainerDescriptor, which shall be retrieved by this client.
Throws:
java.lang.UnsupportedOperationException - if the protocol_id or provider_id doesn't match.
NullPointerException - if the descriptor is null.

removeContainerDescriptor

public AMWebARSContainerDescriptor removeContainerDescriptor(AMWebARSContainerDescriptor descriptor)
                                                      throws java.util.NoSuchElementException
Removes a container descriptor from the client.
Parameters:
descriptor - AMWebARScontainerDescriptor to be removed
Returns:
removed descriptor
Throws:
NullPointerException - if the descriptor is null
java.util.NoSuchElementException - if the descriptor isn't contained in the client

containsContainerDescriptor

public boolean containsContainerDescriptor(AMWebARSContainerDescriptor descriptor)
Tests the client contains a certain descriptor.
Parameters:
descriptor - AMWebARScontainerDescriptor to looked for.
Returns:
true is the client contains the descriptor
Throws:
NullPointerException - if the descriptor is null

size

public int size()
Detirmined the number of AMWebARSContainerDescriptors this client contains.
Returns:
number of descriptors

isEmpty

public boolean isEmpty()
Tests whether this client contains no AMWebARSContainerDescriptors.
Returns:
true if the client contains no container descriptors

clear

public void clear()
Removed all AMWebARSContainerDescriptors from the client.

elements

public java.util.Iterator elements()
Returns an Enumeration of the AMWebARSContainerDescriptors, stored in the client.
Returns:
Enumeration of descriptors

keys

public java.util.Iterator keys()
Returns an Enumeration of the container_type_ids, stored in the client.
Returns:
Enumeration of container_type_ids

addContainer

public void addContainer(AMWebARSContainer container)
Adds a AMWebARSContainer to the client.
Parameters:
container - to be added

getSession

public Session getSession()
Gets the session.
Returns:
Returns a Session

setSession

public void setSession(Session session)
Sets the session.
Parameters:
session - The session to set

init

public ClientInitStatus init()
Inits the client and the corresponding protocol.

run

public ClientRunStatus run()
Runs the client.

shutdown

public ClientShutdownStatus shutdown()
Shuts the client down.