com.caucho.server.snmp
Class SnmpRequest

java.lang.Object
  extended by com.caucho.network.listen.AbstractProtocolConnection
      extended by com.caucho.server.snmp.SnmpRequest
All Implemented Interfaces:
ProtocolConnection

public class SnmpRequest
extends AbstractProtocolConnection


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(SocketLink connection, java.util.TreeMap<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.TreeMap<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 onCloseConnection()
          Handles a close event when the connection is closed.
protected  void sendResponse(SnmpValue response)
           
 void setVersion(int version)
           
 void startConnection()
           
 
Methods inherited from class com.caucho.network.listen.AbstractProtocolConnection
getProtocolRequestURL, onStartConnection
 
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(SocketLink connection,
                   java.util.TreeMap<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 ProtocolConnection
Overrides:
init in class AbstractProtocolConnection

isWaitForRead

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


startConnection

public void startConnection()

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 ProtocolConnection
Specified by:
handleRequest in class AbstractProtocolConnection
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 ProtocolConnection
Overrides:
handleResume in class AbstractProtocolConnection
Throws:
java.io.IOException

onCloseConnection

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

Specified by:
onCloseConnection in interface ProtocolConnection
Overrides:
onCloseConnection in class AbstractProtocolConnection

setVersion

public void setVersion(int version)

getMib

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