com.ibm.b2bi.bfm.base
Class WWFResources

java.lang.Object
  |
  +--com.ibm.b2bi.bfm.base.WWFResources

public class WWFResources
extends java.lang.Object

The WWFResources is utility class. It provides the service to get the values from the WWF_ResourceBundle.properties file, it provides a template for creating the home object for an enterprise bean, it provides services to trace and logging.


Method Summary
static boolean addUserInfo(java.lang.String userId, java.lang.Object uInfo)
          This method adds the logon object for the user to a cache
 java.lang.String getActivityRole(java.lang.String activityName)
          This method gets the role for a given activityName
 java.sql.Connection getConnectionFromPool(java.lang.String _user, java.lang.String _pwd)
           
 com.ibm.epic.LogTrace.EpicLog getLogClient()
          Gets the log client object.
 java.lang.String getNLSMessage(java.lang.String msgId, java.lang.Object[] obj)
          Gets the NLS based string for the given message Id.
 java.lang.Object getResource(java.lang.String name)
          Returns the value for the given string name, defined in the wwf resourcebundle property file.
static WWFResources getSingleton()
          Returns the single instance of the WWFResources object.
static java.lang.Object getUserInfo(java.lang.String userId)
          This method retrieves the logon object for the user from the cache
 java.lang.String getUserPwd(java.lang.String userId)
          Gets the user password from the property file if GSO is not available.
 boolean isGSO()
          Returns boolean based on whether GSO is available or not NOTE: This method will be removed in the future releases.
 boolean isLogging()
          Returns true if logging is enabled, else returns false
 boolean isTraceable()
          Returns true if tracing is enabled, else returns false
 java.lang.String logExceptionToEM(java.lang.String expName, java.lang.String fnName, java.lang.String msgStr)
          Logs the exception to the exception manager.
static void removeAllUsers()
          This method removes the logon object for the user to a cache
static boolean removeUserInfo(java.lang.String userId)
          This method removes the logon object for the user to a cache
static void resetWaitForLogonToComplete(java.lang.String userId)
          Remove the user from the pending list, after a successful logon
 boolean sendEvents()
          Returns true if events is enabled, else returns false
static void waitForLogonToComplete(java.lang.String userId)
          If we receive multiple logon requests for the same user, process one at a time.
 void writeTrace(long level, java.lang.Object obj, java.lang.String clName, java.lang.String msgId)
          Traces a message, by key, with no parameters..
 void writeTrace(long level, java.lang.Object obj, java.lang.String clName, java.lang.String msgId, java.lang.Object[] paramObjs)
          Traces a message, by key, with an array of parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogClient

public com.ibm.epic.LogTrace.EpicLog getLogClient()
Gets the log client object.
Returns:
EpicLog The log client object.

getNLSMessage

public java.lang.String getNLSMessage(java.lang.String msgId,
                                      java.lang.Object[] obj)
Gets the NLS based string for the given message Id.
Parameters:
msgId - The message Id.
obj - An array of objects that gets filled in the NLS string.
Returns:
String The NLS formatted String.

isLogging

public boolean isLogging()
Returns true if logging is enabled, else returns false
Returns:
boolean Returns true if logging is enabled, else returns false

isTraceable

public boolean isTraceable()
Returns true if tracing is enabled, else returns false
Returns:
boolean Returns true if tracing is enabled, else returns false

sendEvents

public boolean sendEvents()
Returns true if events is enabled, else returns false
Returns:
boolean Returns true if events is enabled, else returns false

writeTrace

public void writeTrace(long level,
                       java.lang.Object obj,
                       java.lang.String clName,
                       java.lang.String msgId)
Traces a message, by key, with no parameters.. This call can be used in a non-static method.
Parameters:
level - The trace level.
obj - The logging object ("this").
clName - The name of the logging method.
msgId - The message key.
Returns:
void

writeTrace

public void writeTrace(long level,
                       java.lang.Object obj,
                       java.lang.String clName,
                       java.lang.String msgId,
                       java.lang.Object[] paramObjs)
Traces a message, by key, with an array of parameters. This call can be used in a non-static method.
Parameters:
level - The trace level.
obj - The logging object ("this").
clName - The name of the logging method.
msgId - The message key.
parms - An array of elements to be inserted into the message.
Returns:
void

addUserInfo

public static boolean addUserInfo(java.lang.String userId,
                                  java.lang.Object uInfo)
This method adds the logon object for the user to a cache
Parameters:
userId - User Id
uInfo - The logon object
Returns:
boolean true, if success. false, if failed

getActivityRole

public java.lang.String getActivityRole(java.lang.String activityName)
This method gets the role for a given activityName
Parameters:
activityName - The activity Name
Returns:
String Role

getConnectionFromPool

public java.sql.Connection getConnectionFromPool(java.lang.String _user,
                                                 java.lang.String _pwd)
                                          throws java.sql.SQLException,
                                                 java.lang.Exception

getResource

public java.lang.Object getResource(java.lang.String name)
Returns the value for the given string name, defined in the wwf resourcebundle property file.
Parameters:
name - The name of the string.
Returns:
Object The value for the given name.

getSingleton

public static WWFResources getSingleton()
Returns the single instance of the WWFResources object.
Returns:
WWFResources The single instance of WWFResources object

getUserInfo

public static java.lang.Object getUserInfo(java.lang.String userId)
This method retrieves the logon object for the user from the cache
Parameters:
userId - User Id
Returns:
Object The logon object

getUserPwd

public java.lang.String getUserPwd(java.lang.String userId)
Gets the user password from the property file if GSO is not available. NOTE: This method will be removed in the future releases.
Returns:
String The user password.

isGSO

public boolean isGSO()
Returns boolean based on whether GSO is available or not NOTE: This method will be removed in the future releases.
Returns:
String The name of the wwf resourcebundle file.

logExceptionToEM

public java.lang.String logExceptionToEM(java.lang.String expName,
                                         java.lang.String fnName,
                                         java.lang.String msgStr)
Logs the exception to the exception manager.
Parameters:
expName - The exception name.
fnName - The function name.
msgStr - The message string.
Returns:
void

removeAllUsers

public static void removeAllUsers()
This method removes the logon object for the user to a cache
Parameters:
userId - User Id
Returns:
boolean true, if success. false, if failed

removeUserInfo

public static boolean removeUserInfo(java.lang.String userId)
This method removes the logon object for the user to a cache
Parameters:
userId - User Id
Returns:
boolean true, if success. false, if failed

resetWaitForLogonToComplete

public static void resetWaitForLogonToComplete(java.lang.String userId)
Remove the user from the pending list, after a successful logon

waitForLogonToComplete

public static void waitForLogonToComplete(java.lang.String userId)
If we receive multiple logon requests for the same user, process one at a time. This means that we will make sure that a logon request is completely process before attempting to process the next one.