com.adventnet.snmp.mibs.agent
Class AgentClause

java.lang.Object
  |
  +--com.adventnet.snmp.mibs.AgentClauseUtil
        |
        +--com.adventnet.snmp.mibs.agent.AgentClause

public class AgentClause
extends AgentClauseUtil

The AgentClause class is used to parse and then use the AGENTCLAUSE construct of the OBJECT-TYPE macro in a MIB module.

It contains all the COMMAND (e.g. READ-COMMAND, WRITE-COMMAND etc) informations required to implement the AgentClause construct.

API users will not use this class directly. This class is instantiated by AgentMibMacro.


Fields inherited from class com.adventnet.snmp.mibs.AgentClauseUtil
_CLASS, _CORBA, _DATABASE, _FILE, _PROXY, _READ, _SIMULATE, _WRITE, arguments, commandTable, description, fileString, node
 
Constructor Summary
AgentClause()
          This null constructor is used by SnmpAgent.addClient() for instantiating an AgentClause Object.
AgentClause(java.lang.String str)
          One Argument constructor which accepts the fileString.
AgentClause(java.lang.String str, AgentMibNode node)
          This constructor is used by MibMacro class if it encounters AGENTCLAUSE construct in the mibfile.
AgentClause(java.lang.String str, AgentMibNode node, boolean runTime)
          This constructor is used by MibMacro class if it encounters AGENTCLAUSE construct in the mibfile.
 
Method Summary
protected  java.lang.String getResponseString(byte type, AgentMibOperations mibops)
          Returns the response as a string which will be encoded and then sent back to the manager in appropriate format.
(package private)  java.lang.String getResponseString(byte type, SnmpVarBind varbind, AgentMibOperations mibops)
          Returns the response as a string which will be encoded and then sent back to the manager in appropriate format.
 
Methods inherited from class com.adventnet.snmp.mibs.AgentClauseUtil
getAgentClauseCommand, getArguments, getCommandTable, isRuntime, min, parseClause, parseClause, setArguments, setMibNode, setRuntime
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentClause

public AgentClause()
This null constructor is used by SnmpAgent.addClient() for instantiating an AgentClause Object.

AgentClause

public AgentClause(java.lang.String str,
                   AgentMibNode node,
                   boolean runTime)
            throws MibException
This constructor is used by MibMacro class if it encounters AGENTCLAUSE construct in the mibfile.
Parameters:
str - String to be parsed
node - the AgentMibNode associated with this AgentClause
Runtime - flag which is set to true by default
Throws:
Snmp.MibException - thrown while parsing

AgentClause

public AgentClause(java.lang.String str,
                   AgentMibNode node)
            throws MibException
This constructor is used by MibMacro class if it encounters AGENTCLAUSE construct in the mibfile.
Parameters:
str - String to be parsed
node - the AgentMibNode associated with this AgentClause
Throws:
Snmp.MibException - thrown while parsing

AgentClause

public AgentClause(java.lang.String str)
            throws MibException
One Argument constructor which accepts the fileString.
Parameters:
the - string to be parsed
Method Detail

getResponseString

protected java.lang.String getResponseString(byte type,
                                             AgentMibOperations mibops)
                                      throws AgentSnmpException
Returns the response as a string which will be encoded and then sent back to the manager in appropriate format. Used by read, write and file(non-table implementation) commands.
Parameters:
byte - GET, GETNEXT or SET request types
Returns:
response of the request as a string

getResponseString

java.lang.String getResponseString(byte type,
                                   SnmpVarBind varbind,
                                   AgentMibOperations mibops)
                             throws AgentSnmpException
Returns the response as a string which will be encoded and then sent back to the manager in appropriate format.

This method requires associated varbind. Needed for file commands(table implementation) and class.

Parameters:
byte - GET, GETNEXT or SET request types
varbind - associated variable bindings
Returns:
response of the request as a string