|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--amwebarsentitlementservice.session.Session
A Session manages all AMWebARSClient of one getEntitlement request. It generates for each combination of AMWebARSProtocol and AMWebARSProvider required a AMWebARSClient. It distributes the container_type_ids that are to be retrieved to the different clients. The Session fulfills Single Instance by ID Pattern. The Session works in cooperation with a SessionTable. This table organizes the creation of the Sessions.
Field Summary | |
static boolean |
BOUND_NUMBER_OF_CLIENTS
|
static java.lang.String |
CLIENT_KEY_DELIMETER
|
static int |
MAX_NUMBER_OF_CLIENTS
|
Method Summary | |
void |
addContainer(AMWebARSContainer container)
Adds a retrieved container to this Session. |
void |
addContainerDescriptor(AMWebARSContainerDescriptor descriptor)
Adds an AMWebARSContainerDescriptor to this Session. |
void |
addContainerTypeID(java.lang.String container_type_id)
Adds an AMWebARSContainerDescriptor of an certain container_type_id to this Session. |
void |
addContainerTypeIDNotFound(java.lang.String container_type_id)
|
void |
clear()
Removed all container descriptors from the Session, but not the corresponding clients. |
void |
clear(boolean remove_clients)
Removed all container descriptors from the Session. |
void |
clearInternalState()
|
java.lang.Object |
clone()
|
java.util.Enumeration |
containersNotFound()
|
boolean |
containsClient(java.lang.String protocol_id,
java.lang.String provider_id)
Tests whether there is a client responsible for the work with a given protocol_id and provider_id. |
boolean |
containsContainerDescriptor(AMWebARSContainerDescriptor descriptor)
Tests whether the Session contains a container descriptor. |
boolean |
containsContainerTypeID(java.lang.String container_type_id)
Tests whether the Session contains a container descriptor of the given container type id. |
boolean |
equals(java.lang.Object other_object)
Tests whether this Session is equal to another. |
java.util.Map |
getAppContext()
Returns the app_context. |
AMWebARSClient |
getClient(java.lang.String protocol_id,
java.lang.String provider_id)
Returns the AMWebARSClient that is responsible for the work with a given protocol_id and provider_id. |
int |
getClientNumber()
Returns the number of AMWebARSClients this Session contains. |
java.lang.String |
getContainersNotFoundString()
|
static Session |
getInstance(java.lang.String session_id)
Returns the only instance of Session with this session_id. |
int |
getPoolIndex()
|
java.net.URL |
getRequestUrl()
Gets the request_url. |
java.lang.String |
getSessionID()
Gets the session_id of this Session. |
Subject |
getSubject()
Gets the subject. |
TimeInterval |
getValidityInterval()
Gets the validity_time. |
boolean |
hasNoClients()
Tests whether the Session contains no AMWebARSClients. |
boolean |
isContainersNotFoundEmpty()
|
boolean |
isEmpty()
Tests whether the Session contains no AMWebARSContainerDescriptors. |
boolean |
isValidAt(java.util.Date current_date)
Tests whether the Session is still valid. |
boolean |
isValidAt(long current_date)
|
AMWebARSContainerDescriptor |
removeContainerDescriptor(AMWebARSContainerDescriptor descriptor)
Removes a AMWebARSContainerDescriptor from this Session. |
AMWebARSContainerDescriptor |
removeContainerTypeID(java.lang.String container_type_id)
Removes a AMWebARSContainerDescriptor for a container_type_id from this Session. |
java.util.Enumeration |
retrievedContainers()
returns an Enumeration of all retrieved Containers. |
SessionStatus |
run()
Shows the session, that the adding of the container descriptors is completed and that the protocol runs can be started. |
void |
setAppContext(java.util.Map app_context)
Sets the app_context. |
void |
setPoolIndex(int index)
|
void |
setRequestUrl(java.net.URL request_url)
Sets the request_url. |
void |
setSubject(Subject subject)
Sets the subject. |
void |
setValidityInterval(TimeInterval validity_interval)
Sets the validity_time. |
int |
size()
Returns the number of AMWebARSContainerDescriptors this Session contains. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final boolean BOUND_NUMBER_OF_CLIENTS
public static final int MAX_NUMBER_OF_CLIENTS
public static final java.lang.String CLIENT_KEY_DELIMETER
Method Detail |
public static Session getInstance(java.lang.String session_id)
public java.lang.Object clone()
clone
in interface PoolElement
clone
in class java.lang.Object
public java.lang.String getSessionID()
public TimeInterval getValidityInterval()
public void setValidityInterval(TimeInterval validity_interval)
validity_time
- The validity_time to setpublic boolean isValidAt(java.util.Date current_date)
current_date
- current DateNullPointerException
- if null is given as parameterpublic boolean isValidAt(long current_date)
public void addContainerDescriptor(AMWebARSContainerDescriptor descriptor) throws java.lang.CloneNotSupportedException, java.util.NoSuchElementException
descriptor
- AMWebARSContainerDescriptor to be addedNullPointerException
- is parameter is nulljava.util.NoSuchElementException
- if the you add a descriptor whose protocol_id or
provider_id isn't in the corresponding table.java.lang.CloneNotSupportedException
- if a protocol doesn't support cloning.public void addContainerTypeID(java.lang.String container_type_id) throws java.lang.CloneNotSupportedException, java.util.NoSuchElementException
container_type_id
- of the conatiner descriptor to be addedNullPointerException
- is parameter is nulljava.lang.CloneNotSupportedException
- if a protocol doesn't support cloning.java.util.NoSuchElementException
- if the you add a descriptor whose protocol_id or
provider_id isn't in the corresponding table.public AMWebARSContainerDescriptor removeContainerDescriptor(AMWebARSContainerDescriptor descriptor)
descriptor
- AMWebARSContainerDescriptor to be removedjava.util.NoSuchElementException
- if the descriptor wasn't foundNullPointerException
- if the parameter is nullpublic AMWebARSContainerDescriptor removeContainerTypeID(java.lang.String container_type_id)
container_type_id
- String type of the container descriptor to be removedjava.util.NoSuchElementException
- if the descriptor wasn't foundNullPointerException
- if the parameter is nullpublic boolean containsContainerDescriptor(AMWebARSContainerDescriptor descriptor)
descriptor
- AMWebARSContainerDescriptor to be looked for.NullPointerException
- if the parameter is nullpublic boolean containsContainerTypeID(java.lang.String container_type_id)
container_type_id
- String typt of the container to be looked for.NullPointerException
- if the parameter is nullpublic AMWebARSClient getClient(java.lang.String protocol_id, java.lang.String provider_id) throws java.util.NoSuchElementException
protocol_id
- String ID of the AMWebARSProtocol the client uses.provider_id
- String ID of the AMWebARSProvider the client communicates with.java.util.NoSuchElementException
- if the client isn't contained in the session.NullPointerException
- if one of the params is null.public boolean containsClient(java.lang.String protocol_id, java.lang.String provider_id)
protocol_id
- String ID of the AMWebARSProtocol the client uses.provider_id
- String ID of the AMWebARSProvider the client communicates with.NullPointerException
- if one of the params is null.public int size()
getClientNumber()
public int getClientNumber()
size()
public boolean isEmpty()
hasNoClients()
public boolean hasNoClients()
isEmpty()
public void clear()
public void clear(boolean remove_clients)
public void clearInternalState()
clearInternalState
in interface PoolElement
public void setPoolIndex(int index)
setPoolIndex
in interface PoolElement
public int getPoolIndex()
getPoolIndex
in interface PoolElement
public void addContainer(AMWebARSContainer container)
container
- to be addedpublic java.util.Enumeration retrievedContainers()
public void addContainerTypeIDNotFound(java.lang.String container_type_id)
public java.util.Enumeration containersNotFound()
public java.lang.String getContainersNotFoundString()
public boolean isContainersNotFoundEmpty()
public Subject getSubject()
public void setSubject(Subject subject)
subject
- The subject to setpublic java.util.Map getAppContext()
public void setAppContext(java.util.Map app_context)
app_context
- The app_context to setpublic java.net.URL getRequestUrl()
public void setRequestUrl(java.net.URL request_url)
request_url
- The request_url to setpublic SessionStatus run()
NullPointerException
- if the subject isn't set.public boolean equals(java.lang.Object other_object)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |