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

All Superinterfaces:
EnterpriseBean, EntityBean, Serializable

public interface LoginEntityBean
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 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:
SessionEntityBean, UserEntityBean, UserEntityBeanHome

Method Summary
 String getFailureReason()
          When a login fails, this method returns a human readable description of what went wrong.
 String getIPAddress()
          Recalls the IP address of the user's host or last intermediary at login time.
 Date getLoginAttemptDateTime()
          The date and time of a login attempt can be retrieved through this method.
 long getLoginID()
          Logins have a unique sequence number, which can be retrieved through this method.
 String getUsername()
          Retrieves the name of the user who has attempted to login.
 void putPassword(byte[] aPassword)
          Updates the MD5 hashcode based on the password the user attempted to use for this login.
 byte[] retrievePassword()
          Retrieves the MD5 hashcode of the password the user attempted to use for this login.
 void setFailureReason(String aFailureReason)
          When a login fails, this method records a human readable description of what went wrong.
 void setIPAddress(String aIPAddress)
          Specifies the IP address of the user's host or last intermediary at login time.
 void setLoginAttemptDateTime(Date aTimestamp)
          The date and time of a login attempt can be updated through this method.
 void setLoginID(long aLoginID)
          Logins have a unique sequence number, which can be updated through this method.
 void setUsername(String aUsername)
          Updates the name of the user who has attempted to login.
 
Methods inherited from interface javax.ejb.EntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 

Method Detail

getLoginID

long getLoginID()
Logins have a unique sequence number, which can be retrieved through this method.

Returns:
the unique sequence number for this login.

setLoginID

void setLoginID(long aLoginID)
Logins have a unique sequence number, which can be updated through this method.

Parameters:
aLoginID - the unique sequence number for this login.

getLoginAttemptDateTime

Date getLoginAttemptDateTime()
The date and time of a login attempt can be retrieved through this method.

Returns:
the timestamp for this login.

setLoginAttemptDateTime

void setLoginAttemptDateTime(Date aTimestamp)
The date and time of a login attempt can be updated through this method.

Parameters:
aTimestamp - the timestamp for this login.

getUsername

String getUsername()
Retrieves the name of the user who has attempted to login.

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

setUsername

void setUsername(String aUsername)
Updates the name of the user who has attempted to login.


retrievePassword

byte[] retrievePassword()
Retrieves the MD5 hashcode of the password the user attempted to use for this login.

Returns:
the MD5 hash as a byte array.

putPassword

void putPassword(byte[] aPassword)
Updates the MD5 hashcode based on the password the user attempted to use for this login.

Parameters:
aPassword - the MD5 hash as a byte array.

getFailureReason

String getFailureReason()
When a login fails, this method returns a human readable description of what went wrong. Normally, this is not presented to the user, it is simply stored in the database to allow for better intrusion investigation.

Returns:
why the login was unsuccessful, or null if it was successful.

setFailureReason

void setFailureReason(String aFailureReason)
When a login fails, this method records a human readable description of what went wrong. Normally, this is not presented to the user, it is simply stored in the database to allow for better intrusion investigation.

Parameters:
aFailureReason - why the login was unsuccessful, or null if it was successful.

getIPAddress

String getIPAddress()
Recalls the IP address of the user's host or last intermediary at login time. This is used for security audit purposes.

Returns:
the IP address in the octet format or equivalent v6 format.

setIPAddress

void setIPAddress(String aIPAddress)
Specifies the IP address of the user's host or last intermediary at login time. This is used for security audit purposes, and the Architecture will report in the server logs if the IP changes during the course of a session.