|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.sessions.impl.SafeSession
Adapts the InternalSession
interface to the Session
interface. This protects the management operations defined in the InternalSession
interface.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE |
private InternalSession |
mSession |
Constructor Summary | |
SafeSession(InternalSession session) Constructs a safe session wrapping the specified internal session. |
Method Summary | |
void |
addExternalInput(java.lang.String name, Pipe input) Adds an external input session stream. |
void |
addExternalOutput(java.lang.String name, Pipe output) Adds an external output session stream. |
boolean |
containsAttribute(javax.xml.namespace.QName name) Indicates whether or not the session contains a session attribute with the specified name. |
int |
countAttributes() Returns the number of session attributes contained in the session. |
SessionAttribute |
getAttribute(javax.xml.namespace.QName name) Gets the session attribute for the given name or null if no such attribute exists. |
java.util.Set |
getAttributeNames() Returns a set of the names of the session attributes contained in the session. |
java.lang.Object |
getAttributeValue(javax.xml.namespace.QName name) Gets the actual value of the session attribute with the given name. |
Pipe |
getExternalInput(java.lang.String name) Gets the Pipe for the external input with the specified name allowing data to be written into the pipe or read from it. |
Pipe |
getExternalOutput(java.lang.String name) Gets the Pipe for the external output with the specified name allowing data to be written to it of read from it. |
SessionID |
getID() Returns the SessionID object identifying the session. |
Properties |
getProperties() Gets the set of data service resource properties that are available to this session. |
ProcessingStatus |
getRequestStatus() Gets the session request processing status. |
boolean |
hasExternalInput(java.lang.String name) Checks whether the context contains a Pipe for an external input with the specified name. |
boolean |
hasExternalOutput(java.lang.String name) Checks whether the context contains a Pipe for an external output with the specified name. |
void |
removeAttribute(javax.xml.namespace.QName name) Removes a named session attribute from the session unless it is a static session attribute. |
void |
removeExternalInput(java.lang.String name) Removes an external input session stream. |
void |
removeExternalOutput(java.lang.String name) Removes an external output session stream. |
void |
setAttribute(SessionAttribute property) Sets the specified session attribute, storing it in the session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private final InternalSession mSession
Constructor Detail |
public SafeSession(InternalSession session)
session
- The InternalSession
to wrap.java.lang.IllegalArgumentException
- if session
is null
.Method Detail |
public boolean containsAttribute(javax.xml.namespace.QName name)
Session
containsAttribute
in interface Session
name
- The name of the session attribute as a QName
.true
if the session attribute exists, false
otherwise.public int countAttributes()
Session
countAttributes
in interface Session
public SessionAttribute getAttribute(javax.xml.namespace.QName name)
Session
null
if no such attribute exists.
getAttribute
in interface Session
name
- The name of the session attribute as a QName
.null
.public java.util.Set getAttributeNames()
Session
getAttributeNames
in interface Session
QName
objects.public java.lang.Object getAttributeValue(javax.xml.namespace.QName name)
Session
Session attributes encapsulate a name-value pair, so this method is provided as a convenient way to access the session attribute value directly. It is equivalent to getSessionAttribute().getValue()
.
getAttributeValue
in interface Session
name
- The name of the session attribute as a QName
.Object
that is the session attribute value or null
if the attribute does not exist (or the attribute value is actually null
).public SessionID getID()
Session
SessionID
object identifying the session.
getID
in interface Session
SessionID
public void removeAttribute(javax.xml.namespace.QName name) throws StaticSessionAttrException
Session
Static session attributes are identified by the false
return value of their isChangable
method. If the named session attribute does not exist then no action is taken.
removeAttribute
in interface Session
name
- The QName
of the session attribute to remove.StaticSessionAttrException
- If name
identifies a static session attribute.public void setAttribute(SessionAttribute property) throws StaticSessionAttrException
Session
If an attribute with the same name already exists, then the existing attribute is overwritten, unless it is a static session attribute. Static session attributes cannot be overwritten.
setAttribute
in interface Session
property
- The SessionAttribute
to store in the session.StaticSessionAttrException
- If name
identifies a static session attribute.public Properties getProperties()
Session
Session participants, such as activities, may query, add and remove properties from this at runtime.
getProperties
in interface Session
Properties
objectpublic ProcessingStatus getRequestStatus()
Session
This is the status of the current request that is processing in the session.
getRequestStatus
in interface Session
ProcessingStatus
.public boolean hasExternalInput(java.lang.String name)
Session
Pipe
for an external input with the specified name.
hasExternalInput
in interface Session
name
- The name of the external input.true
if the input exists, false
otherwise.public boolean hasExternalOutput(java.lang.String name)
Session
Pipe
for an external output with the specified name.
hasExternalOutput
in interface Session
name
- The name of the external output.true
if the output exists, false
otherwise.public Pipe getExternalOutput(java.lang.String name)
Session
Pipe
for the external output with the specified name allowing data to be written to it of read from it.
getExternalOutput
in interface Session
name
- The name of the external output.Pipe
from which data can be read or null
if there is no output with the specified name.public Pipe getExternalInput(java.lang.String name)
Session
Pipe
for the external input with the specified name allowing data to be written into the pipe or read from it.
getExternalInput
in interface Session
name
- The name of the external input.Pipe
to which data can be written or null
if there is no input with the specified name.public void addExternalInput(java.lang.String name, Pipe input) throws SessionStreamDuplicateException
Session
This is a Pipe
that can receive input data from an external agent and be read from by an activity or session participant.
addExternalInput
in interface Session
name
- The name of the session stream.input
- The pipe for the data.SessionStreamDuplicateException
- if an external input session stream with the same name has already been added to the session.public void addExternalOutput(java.lang.String name, Pipe output) throws SessionStreamDuplicateException
Session
This is a Pipe
that can receive input data from an activity or session participant. This data can then be read by an external agent.
addExternalOutput
in interface Session
name
- The name of the session stream.output
- The pipe for the data.SessionStreamDuplicateException
- if an external output session stream with the same name has already been added to the session.public void removeExternalInput(java.lang.String name)
Session
After this method has returned the session stream will no longer be available to external agents.
removeExternalInput
in interface Session
name
- The name of the session stream. If no stream exists with this name then no action is taken.public void removeExternalOutput(java.lang.String name)
Session
After this method has returned the session stream will no longer be available to external agents.
removeExternalOutput
in interface Session
name
- The name of the session stream. If no stream exists with this name then no action is taken.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |