|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ireasoning.protocol.snmp.SnmpTrapSender
This class is used for sending SNMPv1, SNMPv2c and SNMPv3 traps.
Method Summary | |
static void |
addV3Params(String userName,
String authProtocol,
String authPassword,
int privProtocol,
String privPassword,
byte[] engineID,
String host,
int port)
Adds SNMPV3 trap receiver's properties. |
static void |
addV3Params(String userName,
String authProtocol,
String authPassword,
int privProtocol,
String privPassword,
byte[] engineID,
String contextName,
String host,
int port)
Adds SNMPV3 trap receiver's properties. |
static void |
addV3Params(String userName,
String authProtocol,
String authPassword,
String privPassword,
byte[] engineID,
String host,
int port)
Adds SNMPV3 trap receiver's properties. |
static void |
sendTrap(SnmpV1Trap trap,
String host,
int port,
String community)
Sends out SNMPv1 trap. |
static void |
sendTrap(SnmpV1Trap trap,
String host,
int port,
String community,
DatagramSocket socket)
Sends out SNMPv1 trap. |
static void |
sendTrap(SnmpV1Trap trap,
String host,
int port,
String community,
PacketSender sender)
Sends out SNMPv1 trap. |
static void |
sendTrap(String host,
int port,
SnmpTrap trap,
boolean isV3Trap)
Sends out SNMPv2c or SNMPv3 trap, using "PUBLIC" as community name. |
static void |
sendTrap(String host,
int port,
SnmpTrap trap,
boolean isV3Trap,
String community)
Sends out SNMPv2c or SNMPv3 trap. |
static void |
sendTrap(String host,
int port,
SnmpTrap trap,
boolean isV3Trap,
String community,
DatagramSocket socket)
Sends out SNMPv2c or SNMPv3 trap. |
static void |
sendTrap(String host,
int port,
SnmpTrap trap,
boolean isV3Trap,
String community,
PacketSender sender)
Sends out SNMPv2c or SNMPv3 trap. |
static void |
sendTrap(String host,
int port,
SnmpV1Trap trap)
Sends out SNMPv1 trap, using "PUBLIC" as community name. |
static void |
setSnmpEngine(String host,
byte[] engineID,
int engineTime,
int engineBoots)
Sets the SNMPv3 trap sender's engine properties |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void sendTrap(String host, int port, SnmpTrap trap, boolean isV3Trap) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivertrap
- SNMPv2c or SNMPv3 trap object to be sentisV3Trap
- true if the trap to be sent is SNMPv3 trap
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetpublic static void sendTrap(String host, int port, SnmpTrap trap, boolean isV3Trap, String community) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivertrap
- SNMPv2c or SNMPv3 trap object to be sentisV3Trap
- true if the trap to be sent is SNMPv3 trapcommunity
- community name for remote trap receiver. It does not matter if isV3Trap
is true
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetpublic static void sendTrap(String host, int port, SnmpTrap trap, boolean isV3Trap, String community, DatagramSocket socket) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivertrap
- SNMPv2c or SNMPv3 trap object to be sentisV3Trap
- true if the trap to be sent is SNMPv3 trapcommunity
- community name for remote trap receiver. It does not matter if isV3Trap
is truesocket
- A DatagramSocket instance which is used to send out UDP packet
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetpublic static void sendTrap(String host, int port, SnmpTrap trap, boolean isV3Trap, String community, PacketSender sender) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivertrap
- SNMPv2c or SNMPv3 trap object to be sentisV3Trap
- true if the trap to be sent is SNMPv3 trapcommunity
- community name for remote trap receiver. It does not matter if isV3Trap
is truesender
- an implementation of PacketSender for sending out packet.
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetpublic static void sendTrap(String host, int port, SnmpV1Trap trap) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivertrap
- SNMPv1 trap object to be sent
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetsendTrap(SnmpV1Trap trap, String host, int port, String community)
public static void sendTrap(SnmpV1Trap trap, String host, int port, String community) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivercommunity
- community name for remote trap receivertrap
- SNMPv1 trap object to be sent
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetsendTrap(String host, int port, SnmpV1Trap trap)
public static void sendTrap(SnmpV1Trap trap, String host, int port, String community, DatagramSocket socket) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivercommunity
- community name for remote trap receivertrap
- SNMPv1 trap object to be sent
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetsendTrap(String host, int port, SnmpV1Trap trap)
public static void sendTrap(SnmpV1Trap trap, String host, int port, String community, PacketSender sender) throws SnmpEncodingException, UnknownHostException
host
- host name or ip address of remote SNMP trap receiverport
- port number of remote SNMP trap receivercommunity
- community name for remote trap receivertrap
- SNMPv1 trap object to be sent
UnknownHostException
- if no IP address for the host could be found.
SnmpEncodingException
- if not enough information or some information is wrong for encoding SNMP packetsendTrap(String host, int port, SnmpV1Trap trap)
public static void addV3Params(String userName, String authProtocol, String authPassword, String privPassword, byte[] engineID, String host, int port)
Security level is determined by the passed authPassword and privPassword, if both of them are null or empty strings, security level is noAuthNoPriv. If privPassword is null or empty string, security level is authNoPriv. If both of them are non-empty strings, security level is authPriv.
userName
- user nameauthProtocol
- authentication protocol, one of {SnmpConst.MD5,
SnmpConst.SHA, SnmpConst.SHA224, SnmpConst.SHA256, SnmpConst.SHA384, SnmpConst.SHA512}engineID
- engine ID of trap senderhost
- host name or ip address of trap receiverport
- port number of trap receiverauthPassword
- authentication password. It will be used to generate localized authentication key.privPassword
- privacy protocol password. It will be used to generate localized privacy key.public static void addV3Params(String userName, String authProtocol, String authPassword, int privProtocol, String privPassword, byte[] engineID, String host, int port)
Security level is determined by the passed authPassword and privPassword, if both of them are null or empty strings, security level is noAuthNoPriv. If privPassword is null or empty string, security level is authNoPriv. If both of them are non-empty strings, security level is authPriv.
userName
- user nameauthProtocol
- authentication protocol, one of {SnmpConst.MD5,
SnmpConst.SHA, SnmpConst.SHA224, SnmpConst.SHA256, SnmpConst.SHA384, SnmpConst.SHA512}engineID
- engine ID of trap senderhost
- host name or ip address of trap receiverport
- port number of trap receiverauthPassword
- authentication password. It will be used to generate localized authentication key.privProtocol
- privacy protocol. One of {SnmpConst.DES, SnmpConst.AES, SnmpConst.AES192, SnmpConst.AES256}. Default value is SnmpConst.DESprivPassword
- privacy protocol password. It will be used to generate localized privacy key.public static void addV3Params(String userName, String authProtocol, String authPassword, int privProtocol, String privPassword, byte[] engineID, String contextName, String host, int port)
Security level is determined by the passed authPassword and privPassword, if both of them are null or empty strings, security level is noAuthNoPriv. If privPassword is null or empty string, security level is authNoPriv. If both of them are non-empty strings, security level is authPriv.
userName
- user nameauthProtocol
- authentication protocol, one of {SnmpConst.MD5,
SnmpConst.SHA, SnmpConst.SHA224, SnmpConst.SHA256, SnmpConst.SHA384, SnmpConst.SHA512}engineID
- engine ID of trap senderhost
- host name or ip address of trap receiverport
- port number of trap receiverauthPassword
- authentication password. It will be used to generate localized authentication key.privProtocol
- privacy protocol. One of {SnmpConst.DES, SnmpConst.AES, SnmpConst.AES192, SnmpConst.AES256}. Default value is SnmpConst.DESprivPassword
- privacy protocol password. It will be used to generate localized privacy key.contextName
- SNMPv3 context name. Usually it is "".public static void setSnmpEngine(String host, byte[] engineID, int engineTime, int engineBoots)
host
- local host name or ip address. If null
, "localhost" will be usedengineID
- trap sender engine IDengineTime
- snmp engine timeengineBoots
- snmpv3 engine boots
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |