|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.utils.LogManager
The LogManager class manages the redirecting of debug messages and error messages from the SnmpSession class to client which sends request. The client has to implement the LogInterface. Log Manager will generate the unique id and it will give it to clients whoever registers with LogManager and client has to set the id in SnmpPDU class in case of LLAPI whereas in HLAPI like SnmpTarget and SnmnpRequestServer it is set in the PDU internally. The Log Manager will call the corresponding client's debug method
Field Summary | |
static int |
CRITICAL
|
static int |
DEBUG
|
static int |
DEFAULT
|
static int |
PERF
|
static int |
RESOURCES
|
static int |
SERIOUS
|
Constructor Summary | |
LogManager()
|
Method Summary | |
static int |
addLogClient(LoggerProperties props)
Adds the Log client for redirecting the log messages. |
static int |
addLogClient(LogInterface client)
Subscribe for logging debug message. |
static java.lang.Object |
getLogClient(int id)
Returns the client that have registered to receive log messages or null is returned if no one is registered. |
static java.util.Hashtable |
getLogClients()
Returns the clients that have registered to receive log messages or null is returned if no one is registered. |
static Logger |
getLogger(java.lang.String loggerInstanceName)
Returns the Logger Instance corresponding to the given loggerInstanceName. |
static LogWriter |
getLogWriter(java.lang.String logWriterInstanceName)
Returns the LogWriter Instance corresponding to the given logWriterInstanceName. |
static void |
logErrorMessage(java.lang.String e)
Logging Error message of all clients This method is called by the api internally and no need for api users to implement this method.This method will call err() method of LogInterface implementation. |
static void |
logInfoMessage(java.lang.String e)
Logging Info message of all clients This method is called by the api internally and no need for api users to implement this method.This method will call out() method of LogInterface implementation. |
static void |
logMessage(java.lang.String e)
Calling debug message of all clients This method is called by SnmpSession class and no need for api users to implement this method. |
static void |
logMessage(java.lang.String e,
int id)
Calling debug message of client This method is called by SnmpSession class and no need for api users to implement this method. |
void |
logMessage(java.lang.String msg,
int level,
int clientID)
Logging the messages to the client corresponding to given clientID. |
void |
logMessage(java.lang.String msg,
int level,
java.lang.String loggerInstanceName)
Logging the messages to the client corresponding to the loggerInstanceName. |
static void |
removeLogClient(int id)
Unsubscribe for debug messages. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CRITICAL
public static final int SERIOUS
public static final int DEFAULT
public static final int PERF
public static final int DEBUG
public static final int RESOURCES
Constructor Detail |
public LogManager()
Method Detail |
public static int addLogClient(LogInterface client)
LogInterface
- client client which implements Log Interface.LogInterface
public static java.util.Hashtable getLogClients()
public static java.lang.Object getLogClient(int id)
int
- id client id .public static void removeLogClient(int id)
Log
public static void logMessage(java.lang.String e, int id)
public static void logMessage(java.lang.String e)
public static void logInfoMessage(java.lang.String e)
public static void logErrorMessage(java.lang.String e)
public static int addLogClient(LoggerProperties props) throws LogException
props
- - A LoggerProperties instance having the properties
of needed for a Logger which are grouped together.public void logMessage(java.lang.String msg, int level, java.lang.String loggerInstanceName)
msg
- The message string to be logged.level
- The Loglevel for this corresponding logMessage.loggerInstanceName
- The key of the Logger whose out() method
needs to be invoked with the message & level.public void logMessage(java.lang.String msg, int level, int clientID)
msg
- The message string to be logged.level
- The Loglevel for this corresponding logMessage.clientID
- The unique value mapped to the Logger instance whose
out() method needs to be invoked with the message & level.public static Logger getLogger(java.lang.String loggerInstanceName)
loggerInstanceName
- The LoggerInstanceName corresponding to
which the Logger is to be obtained.public static LogWriter getLogWriter(java.lang.String logWriterInstanceName)
logWriterInstanceName
- The LogWriterInstanceName corresponding to
which the LogWriter is to be obtained.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |