|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.ors.info.SessionInfoImpl
public class SessionInfoImpl
A store for key-value pairs specific to a session: implementation.
This class is not intended to be thread-safe.
| Field Summary |
|---|
| Fields inherited from interface org.marketcetera.ors.info.SessionInfo |
|---|
ACTOR, ACTOR_ID, SESSION_ID |
| Constructor Summary | |
|---|---|
SessionInfoImpl(String name,
SystemInfo systemInfo)
Creates a new store with the given name and encompassed by the given system store. |
|
SessionInfoImpl(SystemInfo systemInfo)
Creates a new store with an automatically assigned name and encompassed by the given system store. |
|
| Method Summary | ||
|---|---|---|
boolean |
contains(String key)
Checks whether the given key is associated with a value (which may or may not be null) in the receiver's map. |
|
String |
getName()
Returns the receiver's name. |
|
String |
getPath()
Returns the receiver's path name. |
|
SystemInfo |
getSystemInfo()
Returns the receiver's system store. |
|
Object |
getValue(String key)
Returns the value associated with the given key in the receiver's map. |
|
|
getValueIfInstanceOf(String key,
Class<T> cls)
Returns the value associated with the given key in the receiver's map, provided one is set and is either null or an object of the given class. |
|
Object |
getValueIfNonNull(String key)
Returns the value associated with the given key in the receiver's map, provided one is set and is not null. |
|
|
getValueIfNonNullInstanceOf(String key,
Class<T> cls)
Returns the value associated with the given key in the receiver's map, provided one is set and is non-null and an object of the given class. |
|
Object |
getValueIfSet(String key)
Returns the value associated with the given key in the receiver's map, provided one (which may be null) is set. |
|
void |
removeValue(String key)
Removes the value associated with the given key in the receiver's map. |
|
void |
removeValueIfSet(String key)
Removes the value associated with the given key in the receiver's map. |
|
void |
setValue(String key,
Object value)
Sets the value associated with the given key to the given value in the receiver's map. |
|
void |
setValueIfUnset(String key,
Object value)
Sets the value associated with the given key to the given value in the receiver's map. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.marketcetera.ors.info.ReadWriteInfo |
|---|
removeValue, removeValueIfSet, setValue, setValueIfUnset |
| Methods inherited from interface org.marketcetera.ors.info.ReadInfo |
|---|
contains, getName, getPath, getValue, getValueIfInstanceOf, getValueIfNonNull, getValueIfNonNullInstanceOf, getValueIfSet |
| Constructor Detail |
|---|
public SessionInfoImpl(SystemInfo systemInfo)
systemInfo - The system store.
public SessionInfoImpl(String name,
SystemInfo systemInfo)
name - The store name.systemInfo - The system store.| Method Detail |
|---|
public SystemInfo getSystemInfo()
SessionInfo
getSystemInfo in interface SessionInfopublic String getPath()
ReadInfo
getPath in interface ReadInfo
public void setValue(String key,
Object value)
ReadWriteInfo
setValue in interface ReadWriteInfokey - The key.value - The value. It may be null.
public void setValueIfUnset(String key,
Object value)
throws InfoException
ReadWriteInfo
setValueIfUnset in interface ReadWriteInfokey - The key.value - The value. It may be null.
InfoException - Thrown if a value is already associated
with the given key.public void removeValue(String key)
ReadWriteInfo
removeValue in interface ReadWriteInfokey - The key.
public void removeValueIfSet(String key)
throws InfoException
ReadWriteInfo
removeValueIfSet in interface ReadWriteInfokey - The key.
InfoException - Thrown if no value is associated with the
given key.public String getName()
ReadInfo
getName in interface ReadInfopublic boolean contains(String key)
ReadInfo
contains in interface ReadInfokey - The key.
public Object getValue(String key)
ReadInfo
getValue in interface ReadInfokey - The key.
ReadInfo.contains(String) to distinguish these
two cases.
public Object getValueIfSet(String key)
throws InfoException
ReadInfo
getValueIfSet in interface ReadInfokey - The key.
InfoException - Thrown if no value is associated with the
given key.
public Object getValueIfNonNull(String key)
throws InfoException
ReadInfo
getValueIfNonNull in interface ReadInfokey - The key.
InfoException - Thrown if no or a null value is
associated with the given key.
public <T> T getValueIfInstanceOf(String key,
Class<T> cls)
throws InfoException
ReadInfo
getValueIfInstanceOf in interface ReadInfokey - The key.cls - The class.
InfoException - Thrown if a no value is associated with
the given key, or if the value is non-null and of a class other
than the given one.
public <T> T getValueIfNonNullInstanceOf(String key,
Class<T> cls)
throws InfoException
ReadInfo
getValueIfNonNullInstanceOf in interface ReadInfokey - The key.cls - The class.
InfoException - Thrown if a no value is associated with
the given key, or if the value is null or of a class other than
the given one.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||