gov.nih.nci.common.search.session
Class SecureSessionImpl

java.lang.Object
  extended by gov.nih.nci.common.search.session.SecureSessionImpl
All Implemented Interfaces:
Directable, SecureSession, java.io.Serializable, java.lang.Cloneable

public class SecureSessionImpl
extends java.lang.Object
implements SecureSession, java.io.Serializable, Directable

Author:
joshua
See Also:
Serialized Form

Field Summary
protected  boolean _active
           
protected  SecureSessionManager _mgr
           
protected  java.lang.String _sessionId
           
protected  long _startTime
           
 
Constructor Summary
SecureSessionImpl()
           
SecureSessionImpl(SecureSessionImpl toCopy)
           
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this object.
 void direct(java.lang.String searchLocation)
           
 void end()
          Invalidates the session.
 void extend()
          Extends the current session by SecureSessionManager.DEFAULT_SESSION_LENGTH milliseconds.
 java.lang.String getSessionId()
          Gets the internal session ID for this session.
 long getStartTime()
          Gets the time in milliseconds when the session was started or the last time refresh was called.
 long getTimeToLive()
          Gets the time in milliseconds until this session will be invalidated.
 void refresh()
          Sets the startTime to the current time.
 void setSessionId(java.lang.String id)
          Sets the internal ID of this session.
 boolean start(java.lang.String username, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sessionId

protected java.lang.String _sessionId

_startTime

protected long _startTime

_mgr

protected transient SecureSessionManager _mgr

_active

protected boolean _active
Constructor Detail

SecureSessionImpl

public SecureSessionImpl()

SecureSessionImpl

public SecureSessionImpl(SecureSessionImpl toCopy)
Parameters:
impl -
Method Detail

start

public boolean start(java.lang.String username,
                     java.lang.String password)
Specified by:
start in interface SecureSession

getSessionId

public java.lang.String getSessionId()
Description copied from interface: SecureSession
Gets the internal session ID for this session.

Specified by:
getSessionId in interface SecureSession
Returns:
session ID

getTimeToLive

public long getTimeToLive()
                   throws SessionException
Description copied from interface: SecureSession
Gets the time in milliseconds until this session will be invalidated.

Specified by:
getTimeToLive in interface SecureSession
Returns:
time to live
Throws:
SessionException

extend

public void extend()
            throws SessionException
Description copied from interface: SecureSession
Extends the current session by SecureSessionManager.DEFAULT_SESSION_LENGTH milliseconds.

Specified by:
extend in interface SecureSession
Throws:
SessionException

refresh

public void refresh()
Description copied from interface: SecureSession
Sets the startTime to the current time.

Specified by:
refresh in interface SecureSession

end

public void end()
         throws SessionException
Description copied from interface: SecureSession
Invalidates the session.

Specified by:
end in interface SecureSession
Throws:
SessionException

getStartTime

public long getStartTime()
Description copied from interface: SecureSession
Gets the time in milliseconds when the session was started or the last time refresh was called.

Specified by:
getStartTime in interface SecureSession
Returns:
start time

clone

public java.lang.Object clone()
Description copied from interface: SecureSession
Returns a deep copy of this object.

Specified by:
clone in interface SecureSession
Overrides:
clone in class java.lang.Object
Returns:
Object - SecureSession

setSessionId

public void setSessionId(java.lang.String id)
Description copied from interface: SecureSession
Sets the internal ID of this session.

Specified by:
setSessionId in interface SecureSession

direct

public void direct(java.lang.String searchLocation)
Specified by:
direct in interface Directable