SiteMinder
Java SDK r12.51


com.netegrity.policyserver.smapi
Class SmAPIContextLogger

java.lang.Object
  extended by com.netegrity.policyserver.smapi.APIContext
      extended by com.netegrity.policyserver.smapi.APIContextLogger
          extended by com.netegrity.policyserver.smapi.SmAPIContextLogger

public class SmAPIContextLogger
extends APIContextLogger

This class is a wrapper for the SmLogger class from common/smerrlog-java, which provides logging and tracing access to the common C++ logging facility. This class is meant to be used internally within the policy server, and not by customer plugins. A separate instance of this class should be used for each thread (due to transaction ID logging). Currently, this is handled by the code which sets up the APIContext before calling a component which uses it.


Field Summary
 
Fields inherited from class com.netegrity.policyserver.smapi.APIContext
SM_API_VERSION_V3, SM_API_VERSION_V4, SM_API_VERSION_V4_1
 
Constructor Summary
SmAPIContextLogger(long lpApiContext)
          Construct an APIContextLogger from the SiteMinder context pointer.
 
Method Summary
 java.lang.String getTransactionId()
          Get the transaction ID for this logger.
 void log(java.lang.String sFName, int iMsgId)
          Log an info or error message.
 void log(java.lang.String sFName, int iMsgId, java.lang.String sArg)
          Log an info or error message.
 void log(java.lang.String sFName, int iMsgId, java.lang.String[] sArgs)
          Log an info or error message.
 void setComponentId(int iComponentId)
          Set the component ID to be used for log and trace messages for this context logger.
 void setGenericErrorMessageId(int iMsgId)
          Set the message ID to be used for an error message from a customer plugin.
 void setGenericInfoMessageId(int iMsgId)
          Set the message ID to be used for an info message from a customer plugin.
 void setTransactionId(java.lang.String transactionId)
          Set the request transaction ID for this logger.
 boolean shouldTraceComponent(int iComponentId)
          Is tracing enabled for this component?
 void trace(java.lang.String sFName, java.lang.String sFuncName, int iComponentId, java.lang.String sMsg)
          Log a trace message.
 void trace(java.lang.String sFName, java.lang.String sFuncName, java.lang.String sMsg)
          Log a trace message.
 
Methods inherited from class com.netegrity.policyserver.smapi.APIContextLogger
error, log
 
Methods inherited from class com.netegrity.policyserver.smapi.APIContext
error, getAppSpecificContext, getAttrMap, getVersion, log, trace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmAPIContextLogger

public SmAPIContextLogger(long lpApiContext)
Construct an APIContextLogger from the SiteMinder context pointer.

Parameters:
lpApiContext - the C++ pointer to lpApiContext.
Method Detail

getTransactionId

public java.lang.String getTransactionId()
Get the transaction ID for this logger.

Returns:
String - the transaction ID for this logger.

setTransactionId

public void setTransactionId(java.lang.String transactionId)
Set the request transaction ID for this logger. This should only be done once per logger. This routine should only be accessible to this package.

Parameters:
transactionId - the request Transaction ID.

setGenericErrorMessageId

public void setGenericErrorMessageId(int iMsgId)
Set the message ID to be used for an error message from a customer plugin.

Parameters:
iMsgId - the message ID

setGenericInfoMessageId

public void setGenericInfoMessageId(int iMsgId)
Set the message ID to be used for an info message from a customer plugin.

Parameters:
iMsgId - the message ID

setComponentId

public void setComponentId(int iComponentId)
Set the component ID to be used for log and trace messages for this context logger.

Parameters:
the - component ID

log

public void log(java.lang.String sFName,
                int iMsgId)
Log an info or error message.

Parameters:
sFName - the file name which is logging this message.
iMsgId - the message ID of the message to log.

log

public void log(java.lang.String sFName,
                int iMsgId,
                java.lang.String sArg)
Log an info or error message.

Parameters:
sFName - the file name which is logging this message.
iMsgId - the message ID of the message to log.
sArg - an additional argument to the message.

log

public void log(java.lang.String sFName,
                int iMsgId,
                java.lang.String[] sArgs)
Log an info or error message.

Parameters:
sFName - the file name which is logging this message.
iMsgId - the message ID of the message to log.
sArgs - a String array of additional arguments to the message.

trace

public void trace(java.lang.String sFName,
                  java.lang.String sFuncName,
                  java.lang.String sMsg)
Log a trace message.

Overrides:
trace in class APIContextLogger
Parameters:
sFName - the file name which is logging this message.
sFuncName - the name of the function logging this message.
sMsg - an additional argument to the message.

trace

public void trace(java.lang.String sFName,
                  java.lang.String sFuncName,
                  int iComponentId,
                  java.lang.String sMsg)
Log a trace message.

Parameters:
sFName - the file name which is logging this message.
sFuncName - the name of the function logging this message.
iComponentId - the component ID to use for this trace message.
sMsg - an additional argument to the message.

shouldTraceComponent

public boolean shouldTraceComponent(int iComponentId)
Is tracing enabled for this component?

Parameters:
iComponentId - the component ID to use for this trace message.

SiteMinder
Java SDK r12.51

Mon 04/08/2013

http://ca.com
Copyright (c) 2013 CA.