com.ibm.b2bi.bfm.base
Class BFMResources

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

public class BFMResources
extends java.lang.Object

The BFMResources is singleton utility class.


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
 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 bfm resourcebundle property file.
static BFMResources getSingleton()
          Returns the single instance of the BFMResources 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 boolean removeUserInfo(java.lang.String userId)
          This method removes the logon object for the user to a cache
 boolean sendEvents()
          Returns true if events is enabled, else returns false
 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.

getSingleton

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

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

getResource

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

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 bfm 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

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