com.adventnet.snmp.rmi
Class LogManagerImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.adventnet.snmp.rmi.LogManagerImpl
All Implemented Interfaces:
LogInterface, LogManager, java.rmi.Remote, java.io.Serializable

public class LogManagerImpl
extends java.rmi.server.UnicastRemoteObject
implements LogInterface, 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 SnmpTarget or SnmpRequestServer The Log Manager will call the corresponding client's debug method

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
LogManagerImpl()
           
 
Method Summary
 void addLogClient(LogInterface client)
          Subscribe for logging debug message.
 void dbg(java.lang.String dbg)
          This is the method for handling debug messages.
 void err(java.lang.String err)
          Error messages are handled by this
 java.lang.Object getLogClient()
          Returns the client that have registered to receive log messages or null is returned if no one is registered.
 int getLogID()
          This method will return Log ID
 void out(java.lang.String out)
          Log messages go here
 void removeLogClient()
          Unsubscribe for debug messages.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogManagerImpl

public LogManagerImpl()
               throws java.rmi.RemoteException
Method Detail

addLogClient

public void addLogClient(LogInterface client)
                  throws java.rmi.RemoteException
Subscribe for logging debug message. This method adds the client to this LogManager session, to invoke the dbg() method of the LogInterface implemented by the client.

Specified by:
addLogClient in interface LogManager
Returns:
int unique client id for setting in SnmpPDU while sending request.
java.rmi.RemoteException
See Also:
LogInterface

getLogClient

public java.lang.Object getLogClient()
                              throws java.rmi.RemoteException
Returns the client that have registered to receive log messages or null is returned if no one is registered.

Specified by:
getLogClient in interface LogManager
Returns:
The client that have registered for debug message or null.
java.rmi.RemoteException

removeLogClient

public void removeLogClient()
                     throws java.rmi.RemoteException
Unsubscribe for debug messages. This method removes the client interface implementation from this Log Manager session.

Specified by:
removeLogClient in interface LogManager
java.rmi.RemoteException
See Also:
Log

err

public void err(java.lang.String err)
Description copied from interface: LogInterface
Error messages are handled by this

Specified by:
err in interface LogInterface

out

public void out(java.lang.String out)
Log messages go here

Specified by:
out in interface LogInterface

dbg

public void dbg(java.lang.String dbg)
This is the method for handling debug messages.

Specified by:
dbg in interface LogInterface

getLogID

public int getLogID()
This method will return Log ID

Specified by:
getLogID in interface LogManager


Copyright (c)2010 ZOHO Corp., All Rights Reserved