|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.ors.info.RequestInfoImpl
public class RequestInfoImpl
A store for key-value pairs specific to a request: implementation.
This class is not intended to be thread-safe.
| Field Summary |
|---|
| Fields inherited from interface org.marketcetera.ors.info.RequestInfo |
|---|
BROKER, BROKER_ID, CURRENT_MESSAGE, FIX_MESSAGE_FACTORY, ORIGINATOR |
| Constructor Summary | |
|---|---|
RequestInfoImpl(SessionInfo sessionInfo)
Creates a new store with an automatically assigned name and encompassed by the given session store. |
|
RequestInfoImpl(String name,
SessionInfo sessionInfo)
Creates a new store with the given name and encompassed by the given session 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. |
|
SessionInfo |
getSessionInfo()
Returns the receiver's session 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 RequestInfoImpl(SessionInfo sessionInfo)
sessionInfo - The session store.
public RequestInfoImpl(String name,
SessionInfo sessionInfo)
name - The store name.sessionInfo - The session store.| Method Detail |
|---|
public SessionInfo getSessionInfo()
RequestInfo
getSessionInfo in interface RequestInfopublic 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 | |||||||||