|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Snmp
The SNMP control is used to implement SNMP Management Applications and SNMP Agent Applications.
The SNMP control implements a standard SNMP Manager and/or Agent as specified in the SNMP RFCs. Both SNMP v1 and SNMP v2c are supported.
The control provides both encoding/decoding and transport capabilities, making the task of developing a custom SNMP agent or manager as simple as setting a few key properties and handling a few events. SNMP data, such as for instance SNMP object id-s (OID-s) are exchanged as text strings, thus further simplifying the task of handling them.
The control is activated/deactivated by first setting the LocalPort
to 161 or 162, depending on whether you want to implement an SNMP agent or
SNMP manager, and then setting the Active
property. This property enables or
disables sending or receiving. It operates completely asynchronously.
Messages are sent to other agents or managers by using control's methods or the Action
property, and are recieved through events such as GetRequest
, GetResponse
, or Trap
.
SNMP object ids, types, and values are provided in arrays such as ObjId
, ObjType
, and ObjValue
, for both sent and received packets. ObjCount
provides the number of elements in each of the arrays. Other
packet information is provided through corresponding properties, such as Community
, or RequestId
, or similarly named parameters
in events.
The control may behave as an SNMP agent or SNMP manager, depending
on the value of the LocalPort
property. If the control listens to port 161
it may act as an SNMP agent by responding to SNMP requests from SNMP managers,
and sending traps through the Action
property. If the LocalPort
is set
to 162, the control listens for SNMP traps, and may send requests to
SNMP agents listening on port 161.
SNMP Traps are received through the Trap
event, and may
be sent through the Action
property by specifying appropriate values
in the various trap properties, such as TrapAgentAddress
, TrapEnterprise
, TrapGenericType
, TrapSpecificType
, and TrapTimeStamp
.
Field Summary | |
static int |
otCounter32
|
static int |
otCounter64
|
static int |
otGauge32
|
static int |
otInteger
|
static int |
otIPAddress
|
static int |
otNSAP
|
static int |
otNull
|
static int |
otObjectId
|
static int |
otOctetString
|
static int |
otOpaque
|
static int |
otTimeTicks
|
static int |
otUnsignedInteger32
|
static int |
snmpReset
|
static int |
snmpSendGetBulkRequest
|
static int |
snmpSendGetNextRequest
|
static int |
snmpSendGetRequest
|
static int |
snmpSendGetResponse
|
static int |
snmpSendInformRequest
|
static int |
snmpSendSetRequest
|
static int |
snmpSendTrap
|
static int |
snmpverDefault
|
static int |
snmpverV1
|
static int |
snmpverV2c
|
static int |
tgtAuthenticationFailure
|
static int |
tgtColdStart
|
static int |
tgtEGPNeighborLoss
|
static int |
tgtEnterpriseSpecific
|
static int |
tgtLinkDown
|
static int |
tgtLinkUp
|
static int |
tgtWarmStart
|
Constructor Summary | |
Snmp()
|
Method Summary | |
void |
addSnmpEventListener(SnmpEventListener l)
|
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireGetBulkRequest(int requestId,
java.lang.String community,
int nonRepeaters,
int maxRepetitions,
java.lang.String sourceAddress,
int sourcePort)
Fired when a GetBulkRequest packet is received. |
void |
fireGetNextRequest(int requestId,
java.lang.String community,
java.lang.String sourceAddress,
int sourcePort)
Fired when a GetNextRequest packet is received. |
void |
fireGetRequest(int requestId,
java.lang.String community,
java.lang.String sourceAddress,
int sourcePort)
Fired when a GetRequest packet is received. |
void |
fireGetResponse(int requestId,
java.lang.String community,
int errorStatus,
int errorIndex,
java.lang.String sourceAddress,
int sourcePort)
Fired when a GetResponse packet is received. |
void |
fireInformRequest(int requestId,
java.lang.String community,
int errorStatus,
int errorIndex,
java.lang.String sourceAddress,
int sourcePort)
Fired when a SetRequest packet is received. |
void |
firePDUTrace(byte[] PDU,
java.lang.String sourceAddress)
Fired for every packet sent or received. |
void |
fireReadyToSend()
Fired when the component is ready to send data. |
void |
fireSetRequest(int requestId,
java.lang.String community,
java.lang.String sourceAddress,
int sourcePort)
Fired when a SetRequest packet is received. |
void |
fireTrap(java.lang.String community,
java.lang.String enterprise,
java.lang.String agentAddress,
int genericType,
int specificType,
int timeStamp,
java.lang.String sourceAddress,
int sourcePort)
Fired when a SNMP trap packet is received. |
int |
getAction()
An action code for the component. |
java.lang.String |
getCommunity()
The community string used to authenticate SNMP packets. |
int |
getErrorIndex()
Index of the first variable (object) that caused an error. |
int |
getErrorStatus()
Status code for outgoing 'GET RESPONSE' packets. |
int |
getInBufferSize()
The size in bytes of the incoming queue of the socket. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
int |
getLocalPort()
The UDP port in the local host where the SNMP component listens to. |
int |
getMaxRepetitions()
Used by 'BULK REQUEST' packets. |
int |
getNonRepeaters()
Used by 'BULK REQUEST' packets. |
int |
getObjCount()
Number of objects in the current request. |
java.lang.String |
getObjId(int objIndex)
Array of OIDs encoded as strings. |
int |
getObjType(int objIndex)
Array of object types. |
byte[] |
getObjValue(int objIndex)
Array of object values. |
int |
getOutBufferSize()
The size in bytes of the outgoing queue of the socket. |
java.lang.String |
getRemoteHost()
The address of the remote host. |
int |
getRemotePort()
The UDP port where the remote SNMP agent is listening. |
int |
getRequestId()
The request-id to mark outgoing packets with. |
int |
getSNMPVersion()
Version of SNMP used for outgoing packets. |
java.lang.String |
getTrapAgentAddress()
The address of the object generating the trap. |
java.lang.String |
getTrapEnterprise()
The type of the object generating the trap. |
int |
getTrapGenericType()
The generic type of the trap being sent. |
int |
getTrapSpecificType()
The specific type of the trap being sent. |
int |
getTrapTimeStamp()
Time passed since the agent was initialized (in hundredths of a second). |
boolean |
isAcceptData()
Enables or disables data reception. |
boolean |
isActive()
Enables or disables sending and receiving of SNMP packets. |
boolean |
isShareLocalPort()
If set to True, allows more than one instance of the component to be Active on the same LocalPort . |
void |
removeSnmpEventListener(SnmpEventListener l)
|
void |
reset()
Clears the object arrays. |
void |
sendGetBulkRequest()
Send a GetBulkRequest packet. |
void |
sendGetNextRequest()
Send GetNextRequest packet. |
void |
sendGetRequest()
Send GetRequest packet. |
void |
sendGetResponse()
Send Get Response packet. |
void |
sendInformRequest()
Send an InformRequest packet. |
void |
sendSetRequest()
Send Set Request packet. |
void |
sendTrap()
Send Trap packet. |
void |
setAcceptData(boolean acceptData)
Enables or disables data reception. |
void |
setAction(int action)
An action code for the component. |
void |
setActive(boolean active)
Enables or disables sending and receiving of SNMP packets. |
void |
setCommunity(java.lang.String community)
The community string used to authenticate SNMP packets. |
void |
setErrorIndex(int errorIndex)
Index of the first variable (object) that caused an error. |
void |
setErrorStatus(int errorStatus)
Status code for outgoing 'GET RESPONSE' packets. |
void |
setInBufferSize(int inBufferSize)
The size in bytes of the incoming queue of the socket. |
void |
setLocalHost(java.lang.String localHost)
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
void |
setLocalPort(int localPort)
The UDP port in the local host where the SNMP component listens to. |
void |
setMaxRepetitions(int maxRepetitions)
Used by 'BULK REQUEST' packets. |
void |
setNonRepeaters(int nonRepeaters)
Used by 'BULK REQUEST' packets. |
void |
setObjCount(int objCount)
Number of objects in the current request. |
void |
setObjId(int objIndex,
java.lang.String objId)
Array of OIDs encoded as strings. |
void |
setObjType(int objIndex,
int objType)
Array of object types. |
void |
setObjValue(int objIndex,
byte[] objValue)
Array of object values. |
void |
setOutBufferSize(int outBufferSize)
The size in bytes of the outgoing queue of the socket. |
void |
setRemoteHost(java.lang.String remoteHost)
The address of the remote host. |
void |
setRemotePort(int remotePort)
The UDP port where the remote SNMP agent is listening. |
void |
setRequestId(int requestId)
The request-id to mark outgoing packets with. |
void |
setShareLocalPort(boolean shareLocalPort)
If set to True, allows more than one instance of the component to be Active on the same LocalPort . |
void |
setSNMPVersion(int SNMPVersion)
Version of SNMP used for outgoing packets. |
void |
setTrapAgentAddress(java.lang.String trapAgentAddress)
The address of the object generating the trap. |
void |
setTrapEnterprise(java.lang.String trapEnterprise)
The type of the object generating the trap. |
void |
setTrapGenericType(int trapGenericType)
The generic type of the trap being sent. |
void |
setTrapSpecificType(int trapSpecificType)
The specific type of the trap being sent. |
void |
setTrapTimeStamp(int trapTimeStamp)
Time passed since the agent was initialized (in hundredths of a second). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int snmpReset
public static final int snmpSendGetRequest
public static final int snmpSendGetNextRequest
public static final int snmpSendSetRequest
public static final int snmpSendGetResponse
public static final int snmpSendTrap
public static final int snmpSendGetBulkRequest
public static final int snmpSendInformRequest
public static final int otInteger
public static final int otOctetString
public static final int otNull
public static final int otObjectId
public static final int otIPAddress
public static final int otCounter32
public static final int otGauge32
public static final int otTimeTicks
public static final int otOpaque
public static final int otNSAP
public static final int otCounter64
public static final int otUnsignedInteger32
public static final int snmpverDefault
public static final int snmpverV1
public static final int snmpverV2c
public static final int tgtColdStart
public static final int tgtWarmStart
public static final int tgtLinkDown
public static final int tgtLinkUp
public static final int tgtAuthenticationFailure
public static final int tgtEGPNeighborLoss
public static final int tgtEnterpriseSpecific
Constructor Detail |
public Snmp()
Method Detail |
public boolean isAcceptData()
public void setAcceptData(boolean acceptData) throws IPWorksException
public int getAction()
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
For every action except snmpReset the control creates an SNMP
packet based on the values provided in the correspoding
properties (described below), and attempts to send it to RemoteHost
at the port specified by RemotePort
.
The control attempts to send the packet as a complete message. If the socket buffer is full, or the message cannot be delivered for any other reason, an error is returned, and no portion of the packet is sent. You may then try to resend the packet later.
The same thing may happend if you are sending packets to the remote host
faster than it can process them, or faster than the network's bandwidth
allows. If this is the case, the assignment to Action
The following are the possible values for the Action
property:
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
Community
, TrapEnterprise
, TrapAgentAddress
, TrapGenericType
, TrapSpecificType
, TrapTimeStamp
, ObjId
, ObjType
, ObjValue
, ObjCount
. Depending upon the value of SNMPVersion
,
the packet is constructed as an SNMPv1 or SNMPv2 Trap.
RequestId
, Community
, NonRepeaters
, MaxRepetitions
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ObjId
, ObjType
, ObjCount
.
public void setAction(int action) throws IPWorksException
Action
property to a valid action code makes
the control perform the associated action. If the action completes
successfully, execution continues normally, and Action
is
reset to 0 (Idle). If an error happens, then
an IPWorksException exception is raised.
For every action except snmpReset the control creates an SNMP
packet based on the values provided in the correspoding
properties (described below), and attempts to send it to RemoteHost
at the port specified by RemotePort
.
The control attempts to send the packet as a complete message. If the socket buffer is full, or the message cannot be delivered for any other reason, an error is returned, and no portion of the packet is sent. You may then try to resend the packet later.
The same thing may happend if you are sending packets to the remote host
faster than it can process them, or faster than the network's bandwidth
allows. If this is the case, the assignment to Action
The following are the possible values for the Action
property:
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
Community
, TrapEnterprise
, TrapAgentAddress
, TrapGenericType
, TrapSpecificType
, TrapTimeStamp
, ObjId
, ObjType
, ObjValue
, ObjCount
. Depending upon the value of SNMPVersion
,
the packet is constructed as an SNMPv1 or SNMPv2 Trap.
RequestId
, Community
, NonRepeaters
, MaxRepetitions
, ObjId
, ObjType
, ObjCount
.
RequestId
, Community
, ObjId
, ObjType
, ObjCount
.
public boolean isActive()
Active
property must be set to True before any SNMP
requests or traps may be sent through the Action
property.
or received through the respective events.
public void setActive(boolean active) throws IPWorksException
Active
property must be set to True before any SNMP
requests or traps may be sent through the Action
property.
or received through the respective events.
public java.lang.String getCommunity()
Typical values are "public" or "private".
This property is used when SNMP packets are sent via the Action
property. When
a packet is received through events such as Trap
, GetRequest
etc.., the corresponding
value is provided through the respective event parameter.
public void setCommunity(java.lang.String community) throws IPWorksException
Typical values are "public" or "private".
This property is used when SNMP packets are sent via the Action
property. When
a packet is received through events such as Trap
, GetRequest
etc.., the corresponding
value is provided through the respective event parameter.
public int getErrorIndex()
ErrorStatus
property and is used to construct outgoing 'GET RESPONSE' packets.
For 'GET RESPONSE' packets received through the GetResponse
event, the corresponding value is provided as an event parameter.
Variable indexes start with 0. The ErrorIndex
property has
no meaning when the ErrorStatus
property is 0 (no error).
public void setErrorIndex(int errorIndex) throws IPWorksException
ErrorStatus
property and is used to construct outgoing 'GET RESPONSE' packets.
For 'GET RESPONSE' packets received through the GetResponse
event, the corresponding value is provided as an event parameter.
Variable indexes start with 0. The ErrorIndex
property has
no meaning when the ErrorStatus
property is 0 (no error).
public int getErrorStatus()
ErrorIndex
property and is used to construct outgoing 'GET RESPONSE' packets.
For 'GET RESPONSE' packets received through the GetResponse
event, the corresponding value is provided as an event parameter.
Possible values include:
The default value is 0 (no error).
public void setErrorStatus(int errorStatus) throws IPWorksException
ErrorIndex
property and is used to construct outgoing 'GET RESPONSE' packets.
For 'GET RESPONSE' packets received through the GetResponse
event, the corresponding value is provided as an event parameter.
Possible values include:
The default value is 0 (no error).
public int getInBufferSize()
InBufferSize
property can provide significant improvements in
performance in some cases.
Some TCP/IP implementations do not support variable buffer sizes.
If that is the case, when control is activated
the InBufferSize
property reverts to its defined size.
The same happens if you attempt to make it too large or too small.
public void setInBufferSize(int inBufferSize) throws IPWorksException
InBufferSize
property can provide significant improvements in
performance in some cases.
Some TCP/IP implementations do not support variable buffer sizes.
If that is the case, when control is activated
the InBufferSize
property reverts to its defined size.
The same happens if you attempt to make it too large or too small.
public java.lang.String getLocalHost()
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the control initiate connections (or accept in the case of server controls) only through that interface.
If the control is connected, the LocalHost
property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost
is not persistent. You must always set it in
code, and never in the property window.
public void setLocalHost(java.lang.String localHost) throws IPWorksException
LocalHost
property contains the name of the local host
as obtained by the gethostname() Winsock call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the control initiate connections (or accept in the case of server controls) only through that interface.
If the control is connected, the LocalHost
property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost
is not persistent. You must always set it in
code, and never in the property window.
public int getLocalPort()
LocalPort
property must be set before the SNMP control is
activated ( Active
is set to True). It instructs the
control to bind to a specific port (or communication
endpoint) in the local machine.
Setting it to 0 (default) allows Winsock to choose a port
at random. The value chosen is provided via the $rpLocalPort;
property after the control is activated through the Active
property.
If you are implementing an SNMP Agent, then LocalPort
must
be set to 161 to listen for SNMP requests, or 162 to listen
for SNMP traps. Note that only one application on the machine
may bind to a particular port, so use this property carefully.
LocalPort
cannot be changed once the control is Active
.
Any attempt to set the LocalPort
property when the control
is Active
will generate an error.
public void setLocalPort(int localPort) throws IPWorksException
LocalPort
property must be set before the SNMP control is
activated ( Active
is set to True). It instructs the
control to bind to a specific port (or communication
endpoint) in the local machine.
Setting it to 0 (default) allows Winsock to choose a port
at random. The value chosen is provided via the $rpLocalPort;
property after the control is activated through the Active
property.
If you are implementing an SNMP Agent, then LocalPort
must
be set to 161 to listen for SNMP requests, or 162 to listen
for SNMP traps. Note that only one application on the machine
may bind to a particular port, so use this property carefully.
LocalPort
cannot be changed once the control is Active
.
Any attempt to set the LocalPort
property when the control
is Active
will generate an error.
public int getMaxRepetitions()
MaxRepetitions
property
specifies the number of lexicographic successors to be returned
for variables other than those in the NonRepeaters
list.
public void setMaxRepetitions(int maxRepetitions) throws IPWorksException
MaxRepetitions
property
specifies the number of lexicographic successors to be returned
for variables other than those in the NonRepeaters
list.
public int getNonRepeaters()
NonRepeaters
property
specifies the number of variables for which a single lexicographic
successor is to be returned.
public void setNonRepeaters(int nonRepeaters) throws IPWorksException
NonRepeaters
property
specifies the number of variables for which a single lexicographic
successor is to be returned.
public int getObjCount()
ObjCount
property provides the number of elements in the
various Obj arrays ( ObjId
, ObjType
, ObjValue
).
The arrays may be cleared at any time by setting the ObjCount
to 0.
public void setObjCount(int objCount) throws IPWorksException
ObjCount
property provides the number of elements in the
various Obj arrays ( ObjId
, ObjType
, ObjValue
).
The arrays may be cleared at any time by setting the ObjCount
to 0.
public java.lang.String getObjId(int objIndex) throws IPWorksException
The size of the array is determined by the ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet is received.
It is also used to create an outgoing SNMP packet when the Action
is set.
The corresponding object type and value (if any) are specified by the ObjType
and ObjValue
property arrays.
public void setObjId(int objIndex, java.lang.String objId) throws IPWorksException
The size of the array is determined by the ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet is received.
It is also used to create an outgoing SNMP packet when the Action
is set.
The corresponding object type and value (if any) are specified by the ObjType
and ObjValue
property arrays.
public int getObjType(int objIndex) throws IPWorksException
ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet
is received. It is also used to create
an outgoing SNMP packet when the Action
is set. The default type
is NULL (5).
The corresponding object id and value are specified by the ObjId
and ObjValue
property arrays.
Possible values include:
public void setObjType(int objIndex, int objType) throws IPWorksException
ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet
is received. It is also used to create
an outgoing SNMP packet when the Action
is set. The default type
is NULL (5).
The corresponding object id and value are specified by the ObjId
and ObjValue
property arrays.
Possible values include:
public byte[] getObjValue(int objIndex) throws IPWorksException
ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet
is received. It is also used to create
an outgoing SNMP packet when the Action
is set.
The corresponding object id and type are specified by the ObjId
and ObjType
property arrays.
public void setObjValue(int objIndex, byte[] objValue) throws IPWorksException
ObjCount
property. Element
indexes start at 1.
The array is populated and its size is set every time an SNMP packet
is received. It is also used to create
an outgoing SNMP packet when the Action
is set.
The corresponding object id and type are specified by the ObjId
and ObjType
property arrays.
public int getOutBufferSize()
OutBufferSize
property can provide significant improvements in
performance in some cases.
Some TCP/IP implementations do not support variable buffer sizes.
If that is the case, when the control is activated
the OutBufferSize
property reverts to its defined size.
The same happens if you attempt to make it too large or too small.
public void setOutBufferSize(int outBufferSize) throws IPWorksException
OutBufferSize
property can provide significant improvements in
performance in some cases.
Some TCP/IP implementations do not support variable buffer sizes.
If that is the case, when the control is activated
the OutBufferSize
property reverts to its defined size.
The same happens if you attempt to make it too large or too small.
public java.lang.String getRemoteHost()
RemoteHost
property specifies the IP address (IP number in
dotted internet format) or Domain Name of the host SNMP requests or traps
are sent to.
If RemoteHost
is set to 255.255.255.255, the control broadcasts
data on the local subnet.
If the RemoteHost
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the RemoteHost
property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setRemoteHost(java.lang.String remoteHost) throws IPWorksException
RemoteHost
property specifies the IP address (IP number in
dotted internet format) or Domain Name of the host SNMP requests or traps
are sent to.
If RemoteHost
is set to 255.255.255.255, the control broadcasts
data on the local subnet.
If the RemoteHost
property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the RemoteHost
property is set to the corresponding address. If the
search is not successful, an error is returned.
public int getRemotePort()
RemotePort
is the UDP port on the RemoteHost
where to
send SNMP requests to.
A valid port number (a value between 1 and 65535) is required. The special value 0 directs control to automatically select 161 for SNMP requests and 162 for SNMP traps.
public void setRemotePort(int remotePort) throws IPWorksException
RemotePort
is the UDP port on the RemoteHost
where to
send SNMP requests to.
A valid port number (a value between 1 and 65535) is required. The special value 0 directs control to automatically select 161 for SNMP requests and 162 for SNMP traps.
public int getRequestId()
RequestId
, the property must be set
before setting Action
. The control increments RequestId
automatically after sending each packet.
public void setRequestId(int requestId) throws IPWorksException
RequestId
, the property must be set
before setting Action
. The control increments RequestId
automatically after sending each packet.
public boolean isShareLocalPort()
Active
property or it will have no effect.
public void setShareLocalPort(boolean shareLocalPort) throws IPWorksException
Active
property or it will have no effect.
public int getSNMPVersion()
SNMPVersion
property changes to display the version of the received packet.
public void setSNMPVersion(int SNMPVersion) throws IPWorksException
SNMPVersion
property changes to display the version of the received packet.
public java.lang.String getTrapAgentAddress()
This property is used when traps are sent via the Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public void setTrapAgentAddress(java.lang.String trapAgentAddress) throws IPWorksException
This property is used when traps are sent via the Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public java.lang.String getTrapEnterprise()
TrapEnterprise
property is equal to the OID (object id) of the sending agent.
This property is used when traps are sent via the Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public void setTrapEnterprise(java.lang.String trapEnterprise) throws IPWorksException
TrapEnterprise
property is equal to the OID (object id) of the sending agent.
This property is used when traps are sent via the Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public int getTrapGenericType()
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
Possible values of TrapGenericType
include:
public void setTrapGenericType(int trapGenericType) throws IPWorksException
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
Possible values of TrapGenericType
include:
public int getTrapSpecificType()
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public void setTrapSpecificType(int trapSpecificType) throws IPWorksException
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public int getTrapTimeStamp()
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public void setTrapTimeStamp(int trapTimeStamp) throws IPWorksException
Action
property.
When a trap is received
through the Trap
event, the corresponding value
is provided through the respective event parameter.
public void fireError(int errorCode, java.lang.String description)
SnmpErrorEvent
public void fireGetBulkRequest(int requestId, java.lang.String community, int nonRepeaters, int maxRepetitions, java.lang.String sourceAddress, int sourcePort)
SnmpGetBulkRequestEvent
public void fireGetNextRequest(int requestId, java.lang.String community, java.lang.String sourceAddress, int sourcePort)
SnmpGetNextRequestEvent
public void fireGetRequest(int requestId, java.lang.String community, java.lang.String sourceAddress, int sourcePort)
SnmpGetRequestEvent
public void fireGetResponse(int requestId, java.lang.String community, int errorStatus, int errorIndex, java.lang.String sourceAddress, int sourcePort)
SnmpGetResponseEvent
public void fireInformRequest(int requestId, java.lang.String community, int errorStatus, int errorIndex, java.lang.String sourceAddress, int sourcePort)
SnmpInformRequestEvent
public void firePDUTrace(byte[] PDU, java.lang.String sourceAddress)
SnmpPDUTraceEvent
public void fireReadyToSend()
SnmpReadyToSendEvent
public void fireSetRequest(int requestId, java.lang.String community, java.lang.String sourceAddress, int sourcePort)
SnmpSetRequestEvent
public void fireTrap(java.lang.String community, java.lang.String enterprise, java.lang.String agentAddress, int genericType, int specificType, int timeStamp, java.lang.String sourceAddress, int sourcePort)
SnmpTrapEvent
public void reset() throws IPWorksException
Calling this method is equivalent to setting the Action
property
to snmpReset .
public void sendGetBulkRequest() throws IPWorksException
RequestId
, Community
, NonRepeaters
, MaxRepetitions
, ObjId
, ObjType
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendGetBulkRequest .
public void sendGetNextRequest() throws IPWorksException
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendGetNextRequest .
public void sendGetRequest() throws IPWorksException
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendGetRequest .
public void sendGetResponse() throws IPWorksException
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendGetResponse .
public void sendInformRequest() throws IPWorksException
RequestId
, Community
, ObjId
, ObjType
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendInformRequest .
public void sendSetRequest() throws IPWorksException
RequestId
, Community
, ErrorStatus
, ErrorIndex
, ObjId
, ObjType
, ObjValue
, ObjCount
.
Calling this method is equivalent to setting the Action
property
to snmpSendSetRequest .
public void sendTrap() throws IPWorksException
Community
, TrapEnterprise
, TrapAgentAddress
, TrapGenericType
, TrapSpecificType
, TrapTimeStamp
, ObjId
, ObjType
, ObjValue
, ObjCount
.
Depending upon the value of SNMPVersion
,
the packet is constructed as an SNMPv1 or SNMPv2 Trap.
Calling this method is equivalent to setting the Action
property
to snmpSendTrap .
public void addSnmpEventListener(SnmpEventListener l) throws java.util.TooManyListenersException
public void removeSnmpEventListener(SnmpEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |