com.caucho.server.snmp
Class SnmpRequest

java.lang.Object
  extended by com.caucho.server.snmp.SnmpRequest
All Implemented Interfaces:
ServerRequest

public class SnmpRequest
extends java.lang.Object
implements ServerRequest


Field Summary
static int BAD_VALUE
           
static int GENERAL_ERROR
           
static int NO_ERROR
           
static int NO_SUCH_NAME
           
static int READ_ONLY
           
static int TOO_BIG
           
 
Constructor Summary
SnmpRequest(Connection connection, java.util.HashMap<java.lang.String,Oid> mibMap, OctetStringValue community)
           
 
Method Summary
protected  void authenticate(SnmpMessageValue req)
           
protected  void checkVersion(SnmpMessageValue req)
           
protected  SnmpMessageValue composeResponse(SnmpMessageValue req)
           
protected  SnmpValue getMBean(ObjectIdentifierValue objectIdentifier)
           
protected  javax.management.MBeanServer getMBeanServer()
           
 java.util.HashMap<java.lang.String,Oid> getMib()
           
 boolean handleRequest()
          Handles a new connection.
 boolean handleResume()
          Resumes processing after a wait.
 void init()
          Initialize the connection.
 boolean isWaitForRead()
          Return true if the connection should wait for a read before handling the request.
 void protocolCloseEvent()
          Handles a close event when the connection is closed.
protected  void sendResponse(SnmpValue response)
           
 void setVersion(int version)
           
 void startConnection()
          Called when the connection starts, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR
See Also:
Constant Field Values

TOO_BIG

public static final int TOO_BIG
See Also:
Constant Field Values

NO_SUCH_NAME

public static final int NO_SUCH_NAME
See Also:
Constant Field Values

BAD_VALUE

public static final int BAD_VALUE
See Also:
Constant Field Values

READ_ONLY

public static final int READ_ONLY
See Also:
Constant Field Values

GENERAL_ERROR

public static final int GENERAL_ERROR
See Also:
Constant Field Values
Constructor Detail

SnmpRequest

public SnmpRequest(Connection connection,
                   java.util.HashMap<java.lang.String,Oid> mibMap,
                   OctetStringValue community)
Method Detail

init

public void init()
Initialize the connection. At this point, the current thread is the connection thread.

Specified by:
init in interface ServerRequest

isWaitForRead

public boolean isWaitForRead()
Return true if the connection should wait for a read before handling the request.

Specified by:
isWaitForRead in interface ServerRequest

startConnection

public void startConnection()
Description copied from interface: ServerRequest
Called when the connection starts, i.e. just after the accept

Specified by:
startConnection in interface ServerRequest

handleRequest

public boolean handleRequest()
                      throws java.io.IOException
Handles a new connection. The controlling TcpServer may call handleConnection again after the connection completes, so the implementation must initialize any variables for each connection.

Specified by:
handleRequest in interface ServerRequest
Throws:
java.io.IOException

checkVersion

protected final void checkVersion(SnmpMessageValue req)

authenticate

protected final void authenticate(SnmpMessageValue req)

sendResponse

protected final void sendResponse(SnmpValue response)
                           throws java.io.IOException
Throws:
java.io.IOException

composeResponse

protected final SnmpMessageValue composeResponse(SnmpMessageValue req)

getMBean

protected SnmpValue getMBean(ObjectIdentifierValue objectIdentifier)

getMBeanServer

protected javax.management.MBeanServer getMBeanServer()

handleResume

public boolean handleResume()
                     throws java.io.IOException
Resumes processing after a wait.

Specified by:
handleResume in interface ServerRequest
Throws:
java.io.IOException

protocolCloseEvent

public void protocolCloseEvent()
Handles a close event when the connection is closed.

Specified by:
protocolCloseEvent in interface ServerRequest

setVersion

public void setVersion(int version)

getMib

public java.util.HashMap<java.lang.String,Oid> getMib()