|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> ikrs.util.MapDelegation<K,V> ikrs.util.EnvironmentDelegation<K,V> ikrs.util.session.AbstractSession<K,V,U>
public abstract class AbstractSession<K,V,U>
A simple session interface. Basically a session is nothing more than a named environment that is bound to a specific system user (remote or local). Each session is identified by its unique session ID.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
java.util.UUID |
sessionID
The session's ID (must not be null and must never change). |
Constructor Summary | |
---|---|
AbstractSession(U userID,
Environment<K,V> environment)
Creates a new AbstractSession. |
|
AbstractSession(U userID,
EnvironmentFactory<K,V> environmentFactory)
Creates a new AbstractSession. |
Method Summary | |
---|---|
boolean |
allowsMultipleChildNames()
This method indicates if the environment allows multiple names for child environments. |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
Environment<K,V> |
createChild(java.lang.String name)
This method creates a new child environment and returns it. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
V |
get(java.lang.Object key)
|
java.util.List<Environment<K,V>> |
getAllChildren()
This method simply returns a list containing _all_ children. |
Environment<K,V> |
getChild(java.lang.String name)
Get the child environment with the given name; there might be different children with the same name! The method will return the first match then. |
int |
getChildCount()
This method returns the number of all children. |
java.util.List<Environment<K,V>> |
getChildren(java.lang.String name)
Get *all* children with the given name. |
java.util.Date |
getCreationTime()
This method return the date/time of the session's creation. |
java.util.Date |
getLastAccessTime()
This method returns the date/time of the last read OR write access to this session. |
java.util.Date |
getLastModified()
This method returns the date/time of the last write access to this session. |
Environment<K,V> |
getParent()
Get the environments parent. |
java.util.UUID |
getSessionID()
Get the session's unique ID. |
U |
getUserID()
Get the session's user ID. |
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Set<K> |
keySet()
|
V |
put(K key,
V value)
|
void |
putAll(java.util.Map<? extends K,? extends V> m)
|
V |
remove(java.lang.Object key)
|
Environment<K,V> |
removeChild(java.lang.String name)
This method removes the child with the given name and returns its old value. |
int |
size()
|
java.lang.String |
toString()
|
java.lang.StringBuffer |
toString(java.lang.StringBuffer b)
|
java.util.Collection<V> |
values()
|
Methods inherited from class ikrs.util.EnvironmentDelegation |
---|
locateChild, removeAllChildren |
Methods inherited from class java.util.AbstractMap |
---|
clone |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ikrs.util.Environment |
---|
locateChild, removeAllChildren |
Field Detail |
---|
public java.util.UUID sessionID
Constructor Detail |
---|
public AbstractSession(U userID, EnvironmentFactory<K,V> environmentFactory) throws java.lang.NullPointerException
userID
- The session's user ID.environment
- A factory to create the base environment to use.
java.lang.NullPointerException
- If the userID or the environment factory are null.public AbstractSession(U userID, Environment<K,V> environment) throws java.lang.NullPointerException
userID
- The session's user ID.environment
- The base environment to use.
java.lang.NullPointerException
- If the userID or the environment factory are null.Method Detail |
---|
public java.util.UUID getSessionID()
getSessionID
in interface Session<K,V,U>
public U getUserID()
getUserID
in interface Session<K,V,U>
public java.util.Date getCreationTime()
getCreationTime
in interface Session<K,V,U>
public java.util.Date getLastModified()
getLastModified
in interface Session<K,V,U>
public java.util.Date getLastAccessTime()
getLastAccessTime
in interface Session<K,V,U>
public boolean allowsMultipleChildNames()
allowsMultipleChildNames
in interface Environment<K,V>
allowsMultipleChildNames
in class EnvironmentDelegation<K,V>
public Environment<K,V> getParent()
getParent
in interface Environment<K,V>
getParent
in class EnvironmentDelegation<K,V>
public Environment<K,V> getChild(java.lang.String name)
getChild
in interface Environment<K,V>
getChild
in class EnvironmentDelegation<K,V>
name
- The child's name (if the child search is case sensitive
depends on the actual implementation).DefaultEnvironment
public java.util.List<Environment<K,V>> getAllChildren()
getAllChildren
in interface Environment<K,V>
getAllChildren
in class EnvironmentDelegation<K,V>
public java.util.List<Environment<K,V>> getChildren(java.lang.String name)
getChildren
in interface Environment<K,V>
getChildren
in class EnvironmentDelegation<K,V>
name
- The child's name (if the child search is case sensitive
depends on the actual implementation).DefaultEnvironment
public Environment<K,V> createChild(java.lang.String name)
createChild
in interface Environment<K,V>
createChild
in class EnvironmentDelegation<K,V>
name
- The child's name.public Environment<K,V> removeChild(java.lang.String name)
removeChild
in interface Environment<K,V>
removeChild
in class EnvironmentDelegation<K,V>
name
- The child's name.public int getChildCount()
getChildCount
in interface Environment<K,V>
getChildCount
in class EnvironmentDelegation<K,V>
public void clear()
clear
in interface java.util.Map<K,V>
clear
in class MapDelegation<K,V>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
containsKey
in class java.util.AbstractMap<K,V>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
containsValue
in class java.util.AbstractMap<K,V>
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
entrySet
in class MapDelegation<K,V>
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map<K,V>
equals
in class java.util.AbstractMap<K,V>
public V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
get
in class java.util.AbstractMap<K,V>
public int hashCode()
hashCode
in interface java.util.Map<K,V>
hashCode
in class java.util.AbstractMap<K,V>
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
isEmpty
in class java.util.AbstractMap<K,V>
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
keySet
in class java.util.AbstractMap<K,V>
public V put(K key, V value)
put
in interface java.util.Map<K,V>
put
in class MapDelegation<K,V>
public void putAll(java.util.Map<? extends K,? extends V> m)
putAll
in interface java.util.Map<K,V>
putAll
in class MapDelegation<K,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
remove
in class MapDelegation<K,V>
public int size()
size
in interface java.util.Map<K,V>
size
in class java.util.AbstractMap<K,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
values
in class java.util.AbstractMap<K,V>
public java.lang.String toString()
toString
in class MapDelegation<K,V>
public java.lang.StringBuffer toString(java.lang.StringBuffer b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |