com.sas.drugdev.remote.session
Interface Session


public interface Session

Interface that stores the state of the connection to the server. It is also where the ServiceManager can be found. A session is created and initialized by calling SessionFactory.newSession(URL, Credentials). Once you have created a session, you can use isValid() to tell whether the session is still active. A session can become invalid due to a server-side timeout, or due to a call to invalidate().


Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Get an object that was previously placed in the session by a call to setAttribute(String, Object), null if the object isn't in the session.
 ServiceManager getServiceManager()
          Get the single service manager for this session.
 void invalidate()
          Invalidate the session and free any server-side resources being held.
 boolean isValid()
          Check whether this is session is still valid.
 java.lang.Object removeAttribute(java.lang.String name)
          Remove the given object from the session.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          Set an object on the sesion that can later be retrieved using getAttribute(String).
 

Method Detail

isValid

boolean isValid()
Check whether this is session is still valid. A session can become invalid by either timing out or a call to invalidate().

Returns:
whether this session is still valid.

invalidate

void invalidate()
Invalidate the session and free any server-side resources being held.


getServiceManager

ServiceManager getServiceManager()
Get the single service manager for this session. The service manager is the access point for all services provided by the API.

Returns:
the single service manager for this session.

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Get an object that was previously placed in the session by a call to setAttribute(String, Object), null if the object isn't in the session.

Parameters:
name - name that the attribute set with
Returns:
the object with the specified name, null if the object doesn't exist

setAttribute

java.lang.Object setAttribute(java.lang.String name,
                              java.lang.Object value)
Set an object on the sesion that can later be retrieved using getAttribute(String). If an object of the same name is already bound to the session, the object is replaced, and the previous value is returned from this method.

Parameters:
name - name of the object
value - the object itself
Returns:
the object that was previously in the session with the given name, null if no object with the given name was in the session

removeAttribute

java.lang.Object removeAttribute(java.lang.String name)
Remove the given object from the session.

Parameters:
name - name of the object to remove.
Returns:
The object that was removed, null if no object was in the session with the given name.