jet.server.api
Interface UserSession

All Superinterfaces:
java.io.Serializable

public interface UserSession
extends java.io.Serializable

Interface UserSession represents an user that login to the report server.


Method Summary
 void addExpiryListener(ExpiryListener l)
          Adds a expiry listener to the session.
 long getCreationTime()
          Return the creation time of the session.
 ExpiryListener getExpiryListener(int index)
          Gets expiry listener from the session.
 int getExpiryListenerCount()
          Gets expiry listener count.
 java.lang.Object getExternalObject()
          Deprecated. replaced by getValue(String name).
 java.lang.String getID()
          Return the session ID.
 long getLastAccessTime()
          Return the last access time of the session.
 int getMaxInactiveInterval()
          Return the max inactive interval of the session.
 java.lang.String getRealm()
          Return the realm that the user belong to.
 java.lang.String getUserID()
          Return the user ID.
 java.lang.Object getValue(java.lang.String name)
          Returns the object bound with the specified name in this session or null if no object of that name exists.
 int indexOf(ExpiryListener l)
          Gets index of a expiry listener in expiry listener array.
 void invalidate()
          invalidate the user session.
 boolean isExternalAuthorized()
          Test if this user session is authorized by an external authenticator.
 boolean isTimeOut()
          Test if this user session expired.
 boolean isValid()
          Test if the session is valid.
 void putValue(java.lang.String name, java.lang.Object value)
          Binds an object to this session, using the name specified.
 void refreshLastAccessTime()
          Refresh the last access time of the session.
 void removeExpiryListener(ExpiryListener l)
          Removes a expiry listener from the session.
 void removeValue(java.lang.String name)
          Removes the object bound with the specified name from this session.
 void setExternalObject(java.lang.Object extObj)
          Deprecated. replaced by putValue(String name, Object value).
 void setMaxInactiveInterval(int interval)
          Set the max inactive interval of the session.
 

Method Detail

getID

java.lang.String getID()
Return the session ID.

Returns:
the session ID.

getRealm

java.lang.String getRealm()
Return the realm that the user belong to.

Returns:
the realm that the user belong to.

getUserID

java.lang.String getUserID()
Return the user ID.

Returns:
the user ID.

isExternalAuthorized

boolean isExternalAuthorized()
Test if this user session is authorized by an external authenticator.

Returns:
true if this user session is authorized by an external authenticator.

getExternalObject

java.lang.Object getExternalObject()
Deprecated. replaced by getValue(String name).

Return the external object.

Returns:
the external object.

setExternalObject

void setExternalObject(java.lang.Object extObj)
Deprecated. replaced by putValue(String name, Object value).

Set the external object.

Parameters:
extObj - the external object.

getValue

java.lang.Object getValue(java.lang.String name)
Returns the object bound with the specified name in this session or null if no object of that name exists.

Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name

putValue

void putValue(java.lang.String name,
              java.lang.Object value)
Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.

Parameters:
name - the name to which the object is bound; cannot be null
value - the object to be bound; cannot be null

removeValue

void removeValue(java.lang.String name)
Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.

Parameters:
name - the name of the object to remove from this session

isValid

boolean isValid()
Test if the session is valid.

Returns:
if the session is valid.

invalidate

void invalidate()
invalidate the user session.


getCreationTime

long getCreationTime()
Return the creation time of the session.

Returns:
the creation time of the session.

getLastAccessTime

long getLastAccessTime()
Return the last access time of the session.

Returns:
the last access time of the session.

refreshLastAccessTime

void refreshLastAccessTime()
                           throws InvalidUserSessionException
Refresh the last access time of the session.

Throws:
InvalidUserSessionException - if a InvalidUserSessionException occurs.

getMaxInactiveInterval

int getMaxInactiveInterval()
Return the max inactive interval of the session.

Returns:
the max inactive interval of the session in milliseconds.

setMaxInactiveInterval

void setMaxInactiveInterval(int interval)
Set the max inactive interval of the session.

Parameters:
interval - the max inactive interval of the session in milliseconds.

addExpiryListener

void addExpiryListener(ExpiryListener l)
Adds a expiry listener to the session.

Parameters:
l - the listener that will be added.

removeExpiryListener

void removeExpiryListener(ExpiryListener l)
Removes a expiry listener from the session.

Parameters:
l - the listener that will be removed.

getExpiryListenerCount

int getExpiryListenerCount()
Gets expiry listener count.

Returns:
the count of ExpiryListener in the session.

getExpiryListener

ExpiryListener getExpiryListener(int index)
Gets expiry listener from the session.

Parameters:
index - the index of expiry listener array.
Returns:
a expiry listener or null. If parameter index out of range of array a null value is returned.

indexOf

int indexOf(ExpiryListener l)
Gets index of a expiry listener in expiry listener array.

Parameters:
l - the listener.
Returns:
the index of -1. If parameter l is not in array -1 is returned.

isTimeOut

boolean isTimeOut()
Test if this user session expired.

Returns:
true if this user session is expired.