com.bankframe.services.authentication
Class AuthenticationUtils

java.lang.Object
  extended bycom.bankframe.services.authentication.AuthenticationUtils

public class AuthenticationUtils
extends java.lang.Object

This class provides static utility methods for manipulating logon and logoff DataPackets.


Field Summary
static java.lang.String LOGOFF_FIELD_NAME
           
static java.lang.String LOGON_FIELD_NAME
           
static java.lang.String USER_ID
           
 
Constructor Summary
AuthenticationUtils()
           
 
Method Summary
static boolean checkIsLogoffPacket(DataPacket dp)
          This method checks if a DataPacket is a logoff request.
static boolean checkIsLogonPacket(DataPacket dp)
          This method checks if the DataPacket is a logon request.
static java.lang.String getUserId(DataPacket dp)
          This method gets the userId field from a DataPacket (if it is present).
static void makeLogoffPacket(DataPacket dp, java.lang.String sessionId)
          This method adds the data necessary for a logoff request to the specified DataPacket.
static void makeLogonPacket(DataPacket dp)
          This method adds the data necessary for a logon request to the specified DataPacket.
static void putUserId(DataPacket dp, java.lang.String userId)
          This method puts a userId field into a DataPacket.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGON_FIELD_NAME

public static final java.lang.String LOGON_FIELD_NAME
See Also:
Constant Field Values

LOGOFF_FIELD_NAME

public static final java.lang.String LOGOFF_FIELD_NAME
See Also:
Constant Field Values

USER_ID

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

AuthenticationUtils

public AuthenticationUtils()
Method Detail

checkIsLogoffPacket

public static boolean checkIsLogoffPacket(DataPacket dp)
This method checks if a DataPacket is a logoff request.

Parameters:
dp - the DataPacket to check
Returns:
true if the DataPacket is a logoff request, false otherwise

checkIsLogonPacket

public static boolean checkIsLogonPacket(DataPacket dp)
This method checks if the DataPacket is a logon request.

Parameters:
dp - the DataPacket to check
Returns:
true if the DataPacket is a logon request, false otherwise

getUserId

public static java.lang.String getUserId(DataPacket dp)
This method gets the userId field from a DataPacket (if it is present).

Parameters:
dp - the DataPacket to extract userId from
Returns:
a string containing userId, null if the userId field is not in the DataPacket

makeLogoffPacket

public static void makeLogoffPacket(DataPacket dp,
                                    java.lang.String sessionId)
This method adds the data necessary for a logoff request to the specified DataPacket.

Parameters:
dp - the DataPacket to add logoff request data to
sessionId - the Id of the user session to logoff

makeLogonPacket

public static void makeLogonPacket(DataPacket dp)
This method adds the data necessary for a logon request to the specified DataPacket.

Parameters:
dp - the DataPacket to add logon request data to

putUserId

public static void putUserId(DataPacket dp,
                             java.lang.String userId)
This method puts a userId field into a DataPacket.

Parameters:
dp - the DataPacket to insert userId into.
userId - the user id to insert into the DataPacket.


Copyright © 2005, 2007, Oracle. All rights reserved.