au.gov.tas.dpiwe.mr.bean
Interface SessionEntityBean

All Superinterfaces:
EnterpriseBean, EntityBean, Serializable

public interface SessionEntityBean
extends EntityBean

This is one of the interfaces used in providing security for applications. It encapsulates an attempt to login by a client. i.e. when a LoginEntityBean is stored, a user may have a stronger authorization on subsequent commands.

In order to provide security services, including authentication, Mr Architecture suggests that each container define three entity bean types which can be manipulated by the Architecture as login attempts, user information and session information. The only requirement is that the entity beans involved implement the interfaces LoginEntityBean, UserEntityBean and SessionEntityBean, and that the user information bean's home interface be a subinterface of UserEntityBeanHome.

The authentication process for the command servlet involves the user (i) creating and storing a SessionEntityBean and (ii) creating and storing a LoginEntityBean containing a correct password hashcode according to the MD5 algorithm.

Since:
Mr Architecture 1.0
Version:
1.0.0.1
Author:
Kade Hansson
See Also:
LoginEntityBean, UserEntityBean, UserEntityBeanHome

Method Summary
 Date getEndDateTime()
          This field is not used by the Architecture, because there is no facility for logout.
 long getLoginID()
          Each session has none or one associated login.
 Date getStartDateTime()
          Returns the start timestamp for this session.
 String getUsername()
          Retrieves the name of the user who first claimed this session.
 boolean login(String username, String password)
          Perform a login sequence.
 void setEndDateTime(Date aEndDate)
          This field is not used by the Architecture, because there is no facility for logout.
 void setLoginID(long aLoginID)
          Each session has none or one associated login.
 void setStartDateTime(Date aStartDate)
          Updates the start timestamp for this session.
 void setUsername(String aUser)
          Redundantly stores the name of the user who first claimed this session.
 
Methods inherited from interface javax.ejb.EntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 

Method Detail

getLoginID

long getLoginID()
Each session has none or one associated login. Logins have a unique sequence number, which can be retrieved through this method.

Where a user logs in under a different name (or the same name) in the same session, it is customary for the architecture to only record the first valid login for that session.

Returns:
the unique sequence number for the login which successfully authorized this session.

setLoginID

void setLoginID(long aLoginID)
Each session has none or one associated login. Logins have a unique sequence number, which can be updated through this method.

Where a user logs in under a different name (or the same name) in the same session, it is customary for the architecture to only record the first valid login for that session.


getEndDateTime

Date getEndDateTime()
This field is not used by the Architecture, because there is no facility for logout. It is set to the same timestamp as the start date and time.

Returns:
the date and time of the start of this session.

setEndDateTime

void setEndDateTime(Date aEndDate)
This field is not used by the Architecture, because there is no facility for logout. It is set to the same timestamp as the start date and time.

Parameters:
aEndDate - the date and time of the start of this session.

getStartDateTime

Date getStartDateTime()
Returns the start timestamp for this session.

Returns:
the date and time of the start of this session.

setStartDateTime

void setStartDateTime(Date aStartDate)
Updates the start timestamp for this session.


getUsername

String getUsername()
Retrieves the name of the user who first claimed this session.

Returns:
the name of the user who has attempted to login.

setUsername

void setUsername(String aUser)
Redundantly stores the name of the user who first claimed this session. It is redundant because the identifier of the login record is also stored, which could potentially be used to store the username. Bean implementors may therefore choose a null implementation of this method.


login

boolean login(String username,
              String password)
              throws NotSupportedException,
                     RollbackException,
                     EJBException,
                     CreateException
Perform a login sequence. Some tools provided by the Architecture use this method to log into the command servlet to provide testing or administration functions.

Parameters:
username - the user to log in.
password - the user's password.
Throws:
NotSupportedException
RollbackException
EJBException
CreateException