public class SnmpRequest extends AbstractProtocolConnection
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SnmpRequest(SocketLink connection,
java.util.TreeMap<java.lang.String,Oid> mibMap,
OctetStringValue community) |
Modifier and Type | Method and Description |
---|---|
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() |
getProtocolRequestURL, onAttachThread, onDetachThread, onStartConnection
public static final int NO_ERROR
public static final int TOO_BIG
public static final int NO_SUCH_NAME
public static final int BAD_VALUE
public static final int READ_ONLY
public static final int GENERAL_ERROR
public SnmpRequest(SocketLink connection, java.util.TreeMap<java.lang.String,Oid> mibMap, OctetStringValue community)
public void init()
init
in interface ProtocolConnection
init
in class AbstractProtocolConnection
public boolean isWaitForRead()
public void startConnection()
public boolean handleRequest() throws java.io.IOException
handleRequest
in interface ProtocolConnection
handleRequest
in class AbstractProtocolConnection
java.io.IOException
protected final void checkVersion(SnmpMessageValue req)
protected final void authenticate(SnmpMessageValue req)
protected final void sendResponse(SnmpValue response) throws java.io.IOException
java.io.IOException
protected final SnmpMessageValue composeResponse(SnmpMessageValue req)
protected SnmpValue getMBean(ObjectIdentifierValue objectIdentifier)
protected javax.management.MBeanServer getMBeanServer()
public boolean handleResume() throws java.io.IOException
handleResume
in interface ProtocolConnection
handleResume
in class AbstractProtocolConnection
java.io.IOException
public void onCloseConnection()
onCloseConnection
in interface ProtocolConnection
onCloseConnection
in class AbstractProtocolConnection
public void setVersion(int version)
public java.util.TreeMap<java.lang.String,Oid> getMib()