FileDocCategorySizeDatePackage
SnmpIncomingRequest.javaAPI DocJava SE 5 API5046Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.internal

SnmpIncomingRequest

public interface SnmpIncomingRequest

An SnmpIncomingRequest handles both sides of an incoming SNMP request:

  • The request. Unmarshalling of the received message.
  • The response. Marshalling of the message to send.

This API is a Sun Microsystems internal API and is subject to change without notice.

since
1.5

Fields Summary
Constructors Summary
Methods Summary
public voiddecodeMessage(byte[] inputBytes, int byteCount, java.net.InetAddress address, int port)
Decodes the specified bytes and initializes the request with the incoming message.

param
inputBytes The bytes to be decoded.
exception
SnmpStatusException If the specified bytes are not a valid encoding or if the security applied to this request failed and no report is to be sent (typically trap PDU).

public com.sun.jmx.snmp.SnmpPdudecodeSnmpPdu()
Gets the request PDU encoded in the received message.

This method decodes the data field and returns the resulting PDU.

return
The resulting PDU.
exception
SnmpStatusException If the encoding is not valid.

public intencodeMessage(byte[] outputBytes)
Encodes the response message to send and puts the result in the specified byte array.

param
outputBytes An array to receive the resulting encoding.
exception
ArrayIndexOutOfBoundsException If the result does not fit into the specified array.

public com.sun.jmx.snmp.SnmpMsgencodeSnmpPdu(com.sun.jmx.snmp.SnmpPdu p, int maxDataLength)
Initializes the response to send with the passed Pdu.

If the encoding length exceeds maxDataLength, the method throws an exception.

param
p The PDU to be encoded.
param
maxDataLength The maximum length permitted for the data field.
exception
SnmpStatusException If the specified pdu is not valid.
exception
SnmpTooBigException If the resulting encoding does not fit into maxDataLength bytes.
exception
ArrayIndexOutOfBoundsException If the encoding exceeds maxDataLength.

public byte[]getAccessContext()
Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs.

public byte[]getContextEngineId()
Gets the incoming request context engine Id.

return
The context engine Id.

public byte[]getContextName()
Gets the incoming request context name.

return
The context name.

public java.lang.StringgetPrincipal()
Gets the incoming request principal.

return
The request principal.

public intgetSecurityLevel()
Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}.

return
The security level.

public intgetSecurityModel()
Gets the incoming request security model.

return
The security model.

public com.sun.jmx.snmp.SnmpSecurityParametersgetSecurityParameters()
Once the incoming request decoded, returns the decoded security parameters.

return
The decoded security parameters.

public booleanisReport()
Tests if a report is expected.

return
boolean indicating if a report is to be sent.

public booleanisResponse()
Tests if a response is expected.

return
boolean indicating if a response is to be sent.

public voidnoResponse()
Tells this request that no response will be sent.

public java.lang.StringprintRequestMessage()
Returns a stringified form of the received message.

return
The message state string.

public java.lang.StringprintResponseMessage()
Returns a stringified form of the message to send.

return
The message state string.