planetj.dataengine.security.http
Class SignOnReceipt

java.lang.Object
  |
  +--planetj.dataengine.security.http.SignOnReceipt
All Implemented Interfaces:
EventListener, javax.servlet.http.HttpSessionBindingListener, IRowEventListener, IUser, Principal, Serializable

public class SignOnReceipt
extends Object
implements javax.servlet.http.HttpSessionBindingListener, IUser, IRowEventListener, Serializable

A SignOnReceipt is created when a user signs on to a secured application. It is used to store information about how the user signed on.

See Also:
Serialized Form

Field Summary
static String USER_ID
           
 
Constructor Summary
SignOnReceipt(ISignOn pSignOn)
          SignOnReceipt constructor
 
Method Summary
 long getElapsedTime()
          Gets the time elapsed since this method was last invoked.
 String getFirstName()
          Gets the name for this user, which should uniquely identify the user in the current context.
 String getGlobalSignOnValue()
          Returns the key value that is stored as a shared session attribute of either connection alias, or operation id If mGlobalSignOnKey is not set, this SignOnReceipt will not be stored in the Shared Session We should be storeing OperatingSystemSignon Receipts keyed by System Alias, and SQLOperationSignOn Receipts by Operation This is used for single signon to multiple applications Creation date: (8/14/2003 6:23:57 PM)
 int getId()
          Gets the id of the application that was signed on to
 String getLastName()
          Gets the name for this user, which should uniquely identify the user in the current context.
 String getName()
          Gets the name of the user.
 int getOwnerId()
          Insert the method's description here.
 Row getPropertiesRow()
          Gets the row stored in this SignOnReceipt during sign on.
 String getPropertyDisplayValue(String fieldName)
          Gets a Field's value from a row stored in this SignOnReceipt during sign on.
 Object getPropertyValue(String fieldName)
          Gets a Field's value from a row stored in this SignOnReceipt during sign on.
 String getPropertyValueAsString(String fieldName)
          Gets a Field's value from a row stored in this SignOnReceipt during sign on.
 int getSecurityLevel()
          Gets the security level of the user
 ISignOn getSignOn()
          Gets the SignOn object for this receipt
 long getSignOnTimestamp()
          Gets the sign on time
 String getSystemAlias()
          Gets the system alias that was signed on to.
 int getTimeoutSeconds()
          Gets the number of seconds for which this sign on can remain inactive and still be valid
 long getTimestamp()
          Gets the sign on time
 String getUserId()
          Gets the userId that was used to sign on
 String getUserMode()
          Gets the MODE of the user.
 String getUserName()
          Gets the name of the user.
 Object getUserSQLValue(String key)
          Gets the value of the specified user field as an Object for use as an SQL parameter
 Object getUserValue(String key)
          Gets the value of the specified user field as an Object
 Object getValueByFieldClass(Class pClass)
           
 Object getValueByUsageId(int usageId)
           
 boolean handleRowEvent(RowEvent pEvent)
          This will handle the RowEvent accordingly (7/11/2002 1:37:05 PM)
 boolean hasSecurityLevel()
          Method that can be used to determine if the user has a security level.
 boolean isAdmin()
          !!A WK (9/4/2002 3:26:12 PM) Admin has not yet been implemented.
 boolean isExpired()
          Tests if this receipt is still valid or if it has expired.
 boolean isPJAdmin()
          !!A WK (9/4/2002 3:26:12 PM) PJ Admin has not yet been implemented.
 void setGlobalSignOnKey(byte newGlobalSignOnKey)
          Must be set to one of the values stored in ISignOn.
 void setId(int newId)
          Sets the id of the application that was signed on to
 void setOwnerId(int newOwnerId)
          Insert the method's description here.
 void setPropertiesRow(Row row)
          Sets the row stored in this SignOnReceipt during sign on.
 void setSystemAlias(String newSystemAlias)
          Sets the system alias that was signed on to.
 void setTimeoutSeconds(int seconds)
          Sets the number of seconds for which this sign on is valid
 void setUserId(String newUserId)
          Sets the userId that was used to sign on
 void setUserMode(String pUserMode)
          Sets the MODE of this user
 void valueBound(javax.servlet.http.HttpSessionBindingEvent arg1)
          Invoked whenever the receipt is added to a session
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent pEvent)
          Invoked whenever the receipt is removed from a session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Field Detail

USER_ID

public static final String USER_ID
See Also:
Constant Field Values
Constructor Detail

SignOnReceipt

public SignOnReceipt(ISignOn pSignOn)
SignOnReceipt constructor

Method Detail

getElapsedTime

public long getElapsedTime()
Gets the time elapsed since this method was last invoked. If this method has never been invoked, then the time elapsed since this object was created is returned.


getFirstName

public String getFirstName()
Gets the name for this user, which should uniquely identify the user in the current context.

Specified by:
getFirstName in interface IUser

getGlobalSignOnValue

public String getGlobalSignOnValue()
Returns the key value that is stored as a shared session attribute of either connection alias, or operation id If mGlobalSignOnKey is not set, this SignOnReceipt will not be stored in the Shared Session We should be storeing OperatingSystemSignon Receipts keyed by System Alias, and SQLOperationSignOn Receipts by Operation This is used for single signon to multiple applications Creation date: (8/14/2003 6:23:57 PM)


getId

public int getId()
Gets the id of the application that was signed on to


getLastName

public String getLastName()
Gets the name for this user, which should uniquely identify the user in the current context.

Specified by:
getLastName in interface IUser

getName

public String getName()
Gets the name of the user.

Specified by:
getName in interface Principal

getOwnerId

public int getOwnerId()
Insert the method's description here. Creation date: (7/2/2002 2:18:30 AM)

Specified by:
getOwnerId in interface IUser
Returns:
int

getPropertiesRow

public Row getPropertiesRow()
Gets the row stored in this SignOnReceipt during sign on. If no row was stored, then null is returned.


getPropertyDisplayValue

public String getPropertyDisplayValue(String fieldName)
Gets a Field's value from a row stored in this SignOnReceipt during sign on. If no row was stored, then null is returned.


getPropertyValue

public Object getPropertyValue(String fieldName)
Gets a Field's value from a row stored in this SignOnReceipt during sign on. If no row was stored, then null is returned.


getPropertyValueAsString

public String getPropertyValueAsString(String fieldName)
Gets a Field's value from a row stored in this SignOnReceipt during sign on. If no row was stored, then null is returned.


getSecurityLevel

public int getSecurityLevel()
Gets the security level of the user

Specified by:
getSecurityLevel in interface IUser

getSignOn

public final ISignOn getSignOn()
Gets the SignOn object for this receipt


getSignOnTimestamp

public long getSignOnTimestamp()
Gets the sign on time


getSystemAlias

public String getSystemAlias()
Gets the system alias that was signed on to.

Specified by:
getSystemAlias in interface IUser

getTimeoutSeconds

public int getTimeoutSeconds()
Gets the number of seconds for which this sign on can remain inactive and still be valid


getTimestamp

public long getTimestamp()
Gets the sign on time


getUserId

public String getUserId()
Gets the userId that was used to sign on


getUserName

public String getUserName()
Gets the name of the user.

Specified by:
getUserName in interface IUser

getUserSQLValue

public Object getUserSQLValue(String key)
                       throws CMException
Description copied from interface: IUser
Gets the value of the specified user field as an Object for use as an SQL parameter

Specified by:
getUserSQLValue in interface IUser
CMException

getUserValue

public Object getUserValue(String key)
Description copied from interface: IUser
Gets the value of the specified user field as an Object

Specified by:
getUserValue in interface IUser

getValueByFieldClass

public Object getValueByFieldClass(Class pClass)
                            throws CMException
CMException

getValueByUsageId

public Object getValueByUsageId(int usageId)
                         throws CMException
Specified by:
getValueByUsageId in interface IUser
CMException

handleRowEvent

public boolean handleRowEvent(RowEvent pEvent)
Description copied from interface: IRowEventListener
This will handle the RowEvent accordingly (7/11/2002 1:37:05 PM)

Specified by:
handleRowEvent in interface IRowEventListener
Parameters:
pEvent - planetj.database.RowEvent
Returns:
boolean true if everything was a success.
See Also:
IRowEventListener

hasSecurityLevel

public boolean hasSecurityLevel()
Method that can be used to determine if the user has a security level.

Specified by:
hasSecurityLevel in interface IUser
Returns:
true if the user has a security level; false otherwise

isAdmin

public boolean isAdmin()
!!A WK (9/4/2002 3:26:12 PM) Admin has not yet been implemented. This method is just a place holder. Currently, there are no Admins.

Specified by:
isAdmin in interface IUser

isExpired

public boolean isExpired()
Tests if this receipt is still valid or if it has expired.


isPJAdmin

public boolean isPJAdmin()
!!A WK (9/4/2002 3:26:12 PM) PJ Admin has not yet been implemented. This method is just a place holder. Currently, there are no PJ Admins.

Specified by:
isPJAdmin in interface IUser

setGlobalSignOnKey

public void setGlobalSignOnKey(byte newGlobalSignOnKey)
Must be set to one of the values stored in ISignOn. For instance this value could be set to: ISignOn.GLOBAL_SIGNON_KEY_SYSTEM_ALIAS ISignOn.GLOBAL_SIGNON_KEY_OPERATION_ID Creation date: (8/14/2003 6:42:09 PM)

Parameters:
newGlobalSignOnKey - byte

setId

public void setId(int newId)
Sets the id of the application that was signed on to


setOwnerId

public void setOwnerId(int newOwnerId)
Insert the method's description here. Creation date: (7/2/2002 2:18:30 AM)

Parameters:
newOwnerId - int

setPropertiesRow

public void setPropertiesRow(Row row)
Sets the row stored in this SignOnReceipt during sign on.


setSystemAlias

public void setSystemAlias(String newSystemAlias)
Sets the system alias that was signed on to.


setTimeoutSeconds

public void setTimeoutSeconds(int seconds)
Sets the number of seconds for which this sign on is valid


setUserId

public void setUserId(String newUserId)
Sets the userId that was used to sign on


valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent arg1)
Invoked whenever the receipt is added to a session

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent pEvent)
Invoked whenever the receipt is removed from a session

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

getUserMode

public String getUserMode()
Description copied from interface: IUser
Gets the MODE of the user. This has to do with usability. NOVICE, ADVANCED

Specified by:
getUserMode in interface IUser
See Also:
IUser.getUserMode()

setUserMode

public void setUserMode(String pUserMode)
Description copied from interface: IUser
Sets the MODE of this user

Specified by:
setUserMode in interface IUser
See Also:
IUser.setUserMode(java.lang.String)