|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SubAgentSession
This class represents a AgentX subagent session
SnmpAgentX.connect(java.lang.String, int)
Method Summary | |
---|---|
SnmpError |
allocateTableIndices(SnmpVarBind[] indices)
Allocates table indices, with NEW_INDEX and ANY_INDEX clear. |
SnmpError |
allocateTableIndices(SnmpVarBind[] indices,
int mode)
Allocates table indices. |
void |
close()
Closes this subagent session |
SnmpError |
deallocateTableIndices(SnmpVarBind[] indices)
Deallocates table indices |
java.lang.String |
getContext()
Returns context string |
boolean |
isActive()
Returns the state of this session |
boolean |
pingMasterAgent()
Sends PING pdu to master agent in order to monitor the master agent's ability to receive and send AgentX PDUs over AgentX session. |
int |
register(java.lang.String subtree)
Registers a subtree with master agent. |
int |
register(java.lang.String subtree,
int range_subid,
long upper_bound,
int timeout)
Registers subtree. |
boolean |
sendTrap(SnmpTrap trap)
Sends out trap to master agent (not to trap receiver directly). |
boolean |
sendTrap(SnmpVarBind[] varbinds)
Sends out trap to master agent (not to trap receiver directly). |
void |
setContext(java.lang.String context)
Sets context string |
void |
unregister()
Unregisters all previously registered subtrees |
boolean |
unregister(int index)
Unregisters subtree, asks master agent to remove the MIB region that was previously registered on this session. |
boolean |
unregister(java.lang.String subtree)
Unregisters subtree |
boolean |
unregister(java.lang.String subtree,
int range_subid,
long upper_bound)
Unregisters subtree |
Method Detail |
---|
int register(java.lang.String subtree) throws java.io.IOException
Subagent needs to register for each region of the MIB variable naming tree that it wishes to support.
The choice of what to register is implementation-specific. Standard practice however is for a subagent to register at the highest level of the naming tree that makes sense. Registration of fully-qualified instances is typically done only when a subagent can perform management operations only on particular rows of a conceptual table.
If any of the subtree is exactly the same as any subtree currently registered within the master agent, this subtree is termed "duplicate subtrees" and master agent might reject this register message.
If the subtree is overlapped by any subtree registered within the master agent, this subtree is termed "overlapping subtrees" and master agent might reject this register message.
subtree
- An Object Identifier that names the basic subtree of a MIB region for which a subagent indicates its support. The term "subtree" is used generically here, it may represent a fully-qualified instance name, a partial instance name, a MIB table, an entire MIB, etc.
java.io.IOException
- raised if socket error occurredunregister(int index)
int register(java.lang.String subtree, int range_subid, long upper_bound, int timeout) throws java.io.IOException
Subagent needs to register for each region of the MIB variable naming tree that it wishes to support.
The choice of what to register is implementation-specific. Standard practice however is for a subagent to register at the highest level of the naming tree that makes sense. Registration of fully-qualified instances is typically done only when a subagent can perform management operations only on particular rows of a conceptual table.
If any of the subtree is exactly the same as any subtree currently registered within the master agent, this subtree is termed "duplicate subtrees" and master agent might reject this register message.
If the subtree is overlapped by any subtree registered within the master agent, this subtree is termed "overlapping subtrees" and master agent might reject this register message.
The use of range_subid and upper_bound provide a general shorthand mechanism for specifying a MIB region. For example, if subtree is the OID 1.3.6.1.2.1.2.2.1.1.7, range_subid is 10, and upper_bound is 22, the specified MIB region can be denoted 1.3.6.1.2.1.2.2.1.[1-22].7. Registering this region is equivalent to registering the union of subtrees
1.3.6.1.2.1.2.2.1.1.7 1.3.6.1.2.1.2.2.1.2.7 1.3.6.1.2.1.2.2.1.3.7 ... 1.3.6.1.2.1.2.2.1.22.7One expected use of this mechanism is registering a conceptual row with a single PDU. In the example above, the MIB region happens to be row 7 of the RFC 1573 ifTable.
subtree
- An Object Identifier that names the basic subtree of a MIB region for which a subagent indicates its support. The term "subtree" is used generically here, it may represent a fully-qualified instance name, a partial instance name, a MIB table, an entire MIB, etc.range_subid
- range_subid indicates the (1-based) index of this
sub-identifier within the OID represented by subtreeupper_bound
- The upper bound of a sub-identifier's range. This argument is
effective only if range_subid is not 0.timeout
- timeout value, in seconds
java.io.IOException
- raised if socket error occurredvoid unregister() throws java.io.IOException
java.io.IOException
- raised if socket error occurredboolean unregister(int index) throws java.io.IOException
index
- the index of registered subtree (the return value of register methods)
java.io.IOException
- raised if socket error occurredregister(java.lang.String)
boolean unregister(java.lang.String subtree) throws java.io.IOException
subtree
- An Object Identifier that names the basic subtree of a MIB region for which a subagent indicates its support. The term "subtree" is used generically here, it may represent a fully-qualified instance name, a partial instance name, a MIB table, an entire MIB, etc.
java.io.IOException
- raised if socket error occurredregister(java.lang.String)
boolean unregister(java.lang.String subtree, int range_subid, long upper_bound) throws java.io.IOException
subtree
- An Object Identifier that names the basic subtree of a MIB region for which a subagent indicates its support. The term "subtree" is used generically here, it may represent a fully-qualified instance name, a partial instance name, a MIB table, an entire MIB, etc.range_subid
- range_subid indicates the (1-based) index of this
sub-identifier within the OID represented by subtreeupper_bound
- The upper bound of a sub-identifier's range. This argument is
effective only if range_subid is not 0.timeout
- timeout value, in seconds
java.io.IOException
- raised if socket error occurredregister(java.lang.String)
SnmpError allocateTableIndices(SnmpVarBind[] indices) throws java.io.IOException
Index allocation is a service provided by an AgentX master agent. It provides generic support for sharing MIB conceptual tables among subagents who are assumed to have no knowledge of each other. By convention, subagents use the MIB variable listed in the INDEX clause as the index object for which values must be allocated.
It is important to note that index allocation and MIB region registration are not coupled in the master agent. The current state of index allocations is not considered when processing registration requests, and the current registry is not considered when processing index allocation requests.
AgentX subagents can follow the model of "first request allocation of an index, then register the corresponding region". Then a successful index allocation request gives a subagent a good hint (but no guarantee) of what it should be able to register. The registration may fail (with `duplicateRegistration') because some other subagent session has already registered that row of the table.
Note that index allocation is necessary only when the index in question is an arbitrary value, and hence the subagent has no other reasonable way to determine which index values to use. When index values have intrinsic meaning it is not expected that subagents will allocate their index values.
For example, RFC 1514's table of running software processes (hrSWRunTable) is indexed by the system's native process identifier (pid). A subagent implementing the row of hrSWRunTable corresponding to its own process would simply register the region defining that row's object instances without allocating index values.
indices
- indices to be allocated. Variable binding's name is the OID prefix
of the MIB OBJECT-TYPE for which a value is to be allocated.
java.io.IOException
- raised if socket error occurredSnmpError allocateTableIndices(SnmpVarBind[] indices, int mode) throws java.io.IOException
mode
- indices
- indices to be allocated. Variable binding's name is the OID prefix
of the MIB OBJECT-TYPE for which a value is to be allocated. If the mode is
NEW_INDEX or ANY_INDEX, this argument will be updated with the variable bindings
sent from master agent.
java.io.IOException
- raised if socket error occurredallocateTableIndices(SnmpVarBind[] indices)
SnmpError deallocateTableIndices(SnmpVarBind[] indices) throws java.io.IOException
indices
- indices to be allocated.
java.io.IOException
- raised if socket error occurredboolean sendTrap(SnmpVarBind[] varbinds) throws java.io.IOException
varbinds
- variable bindings. The first one's OID has to be sysUpTime or snmpTrapOID.
If the first one's OID is sysUpTime, the second one's OID has to be snmpTrapOID.
java.io.IOException
- raised if trap can not be sent out
java.lang.IllegalArgumentException
- raise if passed varbinds is not validboolean sendTrap(SnmpTrap trap) throws java.io.IOException
trap
- trap to be sent
java.io.IOException
- raised if trap can not be sent outvoid setContext(java.lang.String context)
java.lang.String getContext()
boolean pingMasterAgent() throws java.io.IOException
java.io.IOException
- raised if there is socket errorvoid close()
boolean isActive()
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |