php.java.servlet
Class HttpSessionFacade

java.lang.Object
  extended by php.java.servlet.HttpSessionFacade
All Implemented Interfaces:
ISession

public class HttpSessionFacade
extends java.lang.Object
implements ISession


Constructor Summary
HttpSessionFacade(javax.servlet.http.HttpSession session, int timeout)
           
 
Method Summary
 void destroy()
          Causes this representation of the session to be invalidated an removed from its context.
 java.lang.Object get(java.lang.Object ob)
          Returns the object bound to the given name in the session's application layer data.
 java.util.Map getAll()
          Returns a map of all bindings maintained by this session.
 int getSessionCount()
          Returns the number of active sessions.
 int getTimeout()
          Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.
 boolean isNew()
          A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session.
 void put(java.lang.Object ob1, java.lang.Object ob2)
          Binds the specified object into the session's application layer data with the given name.
 void putAll(java.util.Map vars)
          Copies all bindings to the session's application layer data.
 java.lang.Object remove(java.lang.Object ob)
          Removes the object bound to the given name in the session's application layer data.
 void setTimeout(int timeout)
          Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionFacade

public HttpSessionFacade(javax.servlet.http.HttpSession session,
                         int timeout)
Method Detail

get

public java.lang.Object get(java.lang.Object ob)
Description copied from interface: ISession
Returns the object bound to the given name in the session's application layer data. Returns null if there is no such binding.

Specified by:
get in interface ISession
Returns:
the value bound to that name, or null if the binding does not exist.

put

public void put(java.lang.Object ob1,
                java.lang.Object ob2)
Description copied from interface: ISession
Binds the specified object into the session's application layer data with the given name. Any existing binding with the same name is replaced.

Specified by:
put in interface ISession

remove

public java.lang.Object remove(java.lang.Object ob)
Description copied from interface: ISession
Removes the object bound to the given name in the session's application layer data. Does nothing if there is no object bound to the given name.

Specified by:
remove in interface ISession

setTimeout

public void setTimeout(int timeout)
Description copied from interface: ISession
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.

Specified by:
setTimeout in interface ISession

getTimeout

public int getTimeout()
Description copied from interface: ISession
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setTimeout method. A negative time indicates the session should never timeout.

Specified by:
getTimeout in interface ISession
Returns:
an integer specifying the number of seconds this session remains open between client requests
See Also:
ISession.setTimeout(int)

getSessionCount

public int getSessionCount()
Description copied from interface: ISession
Returns the number of active sessions.

Specified by:
getSessionCount in interface ISession
Returns:
# of active sessions.

isNew

public boolean isNew()
Description copied from interface: ISession
A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session. For example, if the server supported only cookie-based sessions and the client had completely disabled the use of cookies, then calls to JavaBridge.getSession() would always return "new" sessions.

Specified by:
isNew in interface ISession
Returns:
true if the session has been created by the server but the client has not yet acknowledged joining the session; false otherwise

destroy

public void destroy()
Description copied from interface: ISession
Causes this representation of the session to be invalidated an removed from its context.

Specified by:
destroy in interface ISession

putAll

public void putAll(java.util.Map vars)
Description copied from interface: ISession
Copies all bindings to the session's application layer data. Any existing binding with the same name is replaced.

Specified by:
putAll in interface ISession
Parameters:
vars - the map parameter cannot be null.

getAll

public java.util.Map getAll()
Description copied from interface: ISession
Returns a map of all bindings maintained by this session.

Specified by:
getAll in interface ISession
Returns:
the map