org.jboss.ha.httpsession.beanimpl.interfaces
Interface ClusteredHTTPSessionBusiness

All Known Subinterfaces:
ClusteredHTTPSession (src) , LocalClusteredHTTPSession (src)
All Known Implementing Classes:
ClusteredHTTPSessionBeanAbstract (src)

public interface ClusteredHTTPSessionBusiness

Business methods for the entity bean that will store HTTPSession in a clustered environment.

See Also:
ClusteredHTTPSession (src)

Method Summary
 long getCreationTime()
          Return the time when this session has been created in miliseconds since 1970.
 long getLastAccessedTime()
          Return the last time this session has been accessed in miliseconds since 1970.
 SerializableHttpSession (src) getSession()
          Return the HttpSession object associated to its id.
 java.lang.String getSessionId()
          Get the session identifier associated to this HTTPSession.
 void setSession(SerializableHttpSession (src)  session)
          Associate a new session (set of attributes, ...) to this id.
 

Method Detail

getSessionId

public java.lang.String getSessionId()
                              throws java.rmi.RemoteException
Get the session identifier associated to this HTTPSession. This is the primary key of the entity bean.

Returns:
The session id.
Throws:
java.rmi.RemoteException

getSession

public SerializableHttpSession (src)  getSession()
                                   throws java.rmi.RemoteException
Return the HttpSession object associated to its id. The main difference with the standard class is that this one is Serializable.

Throws:
java.rmi.RemoteException

setSession

public void setSession(SerializableHttpSession (src)  session)
                throws java.rmi.RemoteException
Associate a new session (set of attributes, ...) to this id.

Throws:
java.rmi.RemoteException

getLastAccessedTime

public long getLastAccessedTime()
                         throws java.rmi.RemoteException
Return the last time this session has been accessed in miliseconds since 1970. This method is a shortcut for getSession().getLastAccessedTime (). The reason is that the bean, when directly asked for the time, don't need to deserialize the session representation if not already done (lazy deserialization). If the only thing that changes in an HTTPSession it the last accessed time (and no attributes), the session may not be replicated on other node (to reduce traffic). Nevertheless, the new session is stored in the local bean. Consequently, if a load-balancer with sticky sessions is used, this is no problem (the local, updated, bean is used.

Throws:
java.rmi.RemoteException

getCreationTime

public long getCreationTime()
                     throws java.rmi.RemoteException
Return the time when this session has been created in miliseconds since 1970. This method is a shortcut for getSession().getLastAccessedTime (). The reason is that the bean, when directly asked for the time, don't need to deserialize the session representation if not already done (lazy deserialization)

Throws:
java.rmi.RemoteException