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 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

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

Returns:
the session ID.

getRealm

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

Returns:
the realm that the user belong to.

getUserID

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

Returns:
the user ID.

isExternalAuthorized

public 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

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

Return the external object.

Returns:
the external object.

setExternalObject

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

Set the external object.

Parameters:
extObj - the external object.

getValue

public 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

public 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

public 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

public boolean isValid()
Test if the session is valid.

Returns:
if the session is valid.

invalidate

public void invalidate()
invalidate the user session.


getCreationTime

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

Returns:
the creation time of the session.

getLastAccessTime

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

Returns:
the last access time of the session.

refreshLastAccessTime

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

Throws:
InvalidUserSessionException - if a InvalidUserSessionException occurs.

getMaxInactiveInterval

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

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

setMaxInactiveInterval

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

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

addExpiryListener

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

Parameters:
l - the listener that will be added.

removeExpiryListener

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

Parameters:
l - the listener that will be removed.

getExpiryListenerCount

public int getExpiryListenerCount()
Gets expiry listener count.

Returns:
the count of ExpiryListener in the session.

getExpiryListener

public 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

public 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.