com.outbackinc.services.protocol.snmp
Interface SnmpTrapProfile


public interface SnmpTrapProfile

The SnmpTrapProfile represents a client's selection of which traps to receive. Received traps are checked against the following filter points:

Each filtering point may be configured within the profile. The port must be a specificed value, which defaults to 162. The other filtering points by default are turned off.

NOTE: As of jSNMP v3.0, traps are based upon the SNMPV2 trap specification ( RFC 1905 - Protocol Operations for Version 2 of the Simple Network Management Protocol). That is, all traps are specified by an enterprise OID and trap code. The generic SNMPV1 traps, coldStart, warmStart, linkDown, linkUp, authenticationFailure, and egpNeighborLoss, are converted to traps with an enterprise OID of 1.3.6.1.6.3.1.1.5 and corresponding trap codes of 1, 2, 3, 4, 5, and 6 (see RFC 2576 - Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework). The SNMPv1 deprecated addAgentAddress and addAgent methods have been superceeded by the addSecureSession method, but will work as before. The SNMPv1 deprecated removeAgentAddress and removeAgent methods have been superceeded by the removeSecureSession method, but will work as before. The SNMPv1 deprecated listAgentAddresses and listAgents methods have been superceeded by the listSecureSessions method, but will work as before. The SNMPv1 deprecated addGenericTrapType and addSpecificTrapType methods have been superceeded by the addTrapInform method, but will work as before. The SNMPv1 deprecated removeGenericTrapType and removeSpecificTrapType methods have been superceeded by the removeTrapInform method, but will work as before. The SNMPv1 deprecated listGenericTrapTypes and listSpecificTrapTypes methods have been superceeded by the listTrapTypes method, but will work as before.

See Also:
SnmpAuthoritativeSession

Method Summary
 boolean addAgentAddress(java.net.InetAddress cAgentInetAddress)
          Deprecated. as of jSNMP v3.0 by addTrapSession()
 boolean addAgentIPAddress(java.lang.String szAgentIPAddress)
          Deprecated. as of jSNMP v3.0 by addTrapSession()
 boolean addEnterpriseOID(java.lang.String szOID)
          Deprecated. as of jSNMP v3.0 by addTrapInform()
 boolean addGenericTrapType(java.lang.Integer igrType)
          Deprecated. as of jSNMP v3.0 by addTrapInform()
 boolean addInformSession(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession)
          Adds an Inform session of an SNMP agent to the list of sessions to receive informs.
 boolean addSpecificTrapType(java.lang.Integer igrType)
          Deprecated. as of jSNMP v3.0 by addTrapInform()
 boolean addTrapInform(java.lang.String szOID, java.lang.Integer igrType)
          Adds a trap/inform.
 boolean addTrapSession(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession)
          Adds a Trap session of an SNMP agent to the list of sessions to receive traps.
 int getPort()
          Gets the port to match against incoming traps
 java.net.InetAddress[] listAgentAddresses()
          Deprecated. as of jSNMP v3.0 by listTrapSessions()
 java.lang.String[] listAgentsIPAddress()
          Deprecated. as of jSNMP v3.0 by listTrapSessions()
 java.lang.String[] listEnterpriseOIDs()
          Lists all the OIDs used to check incoming traps
 java.lang.Integer[] listGenericTrapTypes()
          Deprecated. as of jSNMP v3.0 by listTrapTypes()
 SnmpAuthoritativeSession[] listInformSessions()
          Lists all the agent sessions used to check incoming Informs.
 java.lang.Integer[] listSpecificTrapTypes()
          Deprecated. as of jSNMP v3.0 by listTrapTypes()
 java.lang.String[] listTrapInformOIDs()
          Lists all the trap/inform enterprise OIDs that are used to check incoming traps/informs.
 java.lang.Integer[] listTrapInformTypes(java.lang.String szOID)
          Lists all the trap/inform types for an enterprise OID that are used to check incoming traps/informs.
 SnmpAuthoritativeSession[] listTrapSessions()
          Lists all the agent sessions used to check incoming Traps.
 boolean removeAgentAddress(java.net.InetAddress cAgentInetAddress)
          Deprecated. as of jSNMP v3.0 by removeTrapSession()
 boolean removeAgentIPAddress(java.lang.String szAgentIPAddress)
          Deprecated. as of jSNMP v3.0 by removeTrapSession()
 boolean removeEnterpriseOID(java.lang.String szOID)
          Deprecated. as of jSNMP v3.0 by removeTrapInform()
 void removeEnterpriseOIDs()
          Deprecated. as of jSNMP v3.0 by removeTrapInform()
 boolean removeGenericTrapType(java.lang.Integer igrType)
          Deprecated. as of jSNMP v3.0 by removeTrapInform()
 boolean removeInformSession(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession)
          Removes a session from the list of Inform sessions.
 boolean removeSpecificTrapType(java.lang.Integer igrType)
          Deprecated. as of jSNMP v3.0 by removeTrapInform()
 boolean removeTrapInform(java.lang.String szOID)
          Removes all trap/form types for an enterprise OID.
 boolean removeTrapInform(java.lang.String szOID, java.lang.Integer igrType)
          Removes a trap/inform type from an enterprise OID.
 boolean removeTrapSession(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession)
          Removes a session from the list of Trap sessions.
 void removeTrapsInforms()
          Removes all traps/informs, if any.
 

Method Detail

getPort

public int getPort()
Gets the port to match against incoming traps
Returns:
the port to listen for traps

addEnterpriseOID

public boolean addEnterpriseOID(java.lang.String szOID)
                         throws java.lang.IllegalArgumentException
Deprecated. as of jSNMP v3.0 by addTrapInform()

Adds an OID to the list of Enterprise OIDs. Duplicates are not allowed.
Parameters:
szOID - the OID (in dotted notation) to add to the list
Returns:
false if the OID was already in the list; true otherwise
Throws:
java.lang.IllegalArgumentException - if the OID is not valid

removeEnterpriseOID

public boolean removeEnterpriseOID(java.lang.String szOID)
                            throws java.util.NoSuchElementException
Deprecated. as of jSNMP v3.0 by removeTrapInform()

Removes an OID from the list of Enterprise OIDs. If all of the OIDs are removed from the list then traps will not be matched against any enterprise OIDs.
Parameters:
szOID - the OID to remove
Returns:
true if the list is now empty and this parameter will not be used for filtering
Throws:
java.util.NoSuchElementException - if the OID is not in the list

removeEnterpriseOIDs

public void removeEnterpriseOIDs()
Deprecated. as of jSNMP v3.0 by removeTrapInform()

Removes all OIDs from the list of Enterprise OIDs. Traps will not be matched against any enterprise OIDs.

listEnterpriseOIDs

public java.lang.String[] listEnterpriseOIDs()
Lists all the OIDs used to check incoming traps
Returns:
the list of OIDs or null if the list is empty

addAgentAddress

public boolean addAgentAddress(java.net.InetAddress cAgentInetAddress)
Deprecated. as of jSNMP v3.0 by addTrapSession()

Creates a SNMPv1 'remote' authoritative session from the cAgentInetAddress argument and calls the addTrapSession() method to add the session to the list of sessions to receive traps.
Parameters:
cAgentInetAddress - the InetAddress of the agent to add
Returns:
false if the address was already in the list; true otherwise

addAgentIPAddress

public boolean addAgentIPAddress(java.lang.String szAgentIPAddress)
                          throws java.lang.IllegalArgumentException
Deprecated. as of jSNMP v3.0 by addTrapSession()

Creates a SNMPv1 'remote' authoritative session from the szAgentIPAddress argument and calls the addTrapSession() method to add the session to the list of sessions to receive traps.
Parameters:
szAgentIPAddress - the IP address of the agent to add
Returns:
false if the address was already in the list; true otherwise
Throws:
java.lang.IllegalArgumentException - if invalid IP address

addTrapSession

public boolean addTrapSession(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession)
                       throws java.lang.IllegalArgumentException
Adds a Trap session of an SNMP agent to the list of sessions to receive traps. Duplicates are not allowed. Note that only those traps that match the session version will be received.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port(un-used), and security object for the agent
Returns:
false if the address was already in the list; true otherwise
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not a 'remote' authoritative session

addInformSession

public boolean addInformSession(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession)
                         throws java.lang.IllegalArgumentException
Adds an Inform session of an SNMP agent to the list of sessions to receive informs. Duplicates are not allowed. Note that only those informs that match the session version will be received.
Parameters:
cSnmpLocalAuthoritativeSession - contains host, port(un-used), and security object for the agent
Returns:
false if the address was already in the list; true otherwise
Throws:
java.lang.IllegalArgumentException - if a SNMPv1 session or if cSnmpLocalAuthoritativeSession is not a "local" authoritative session

removeAgentAddress

public boolean removeAgentAddress(java.net.InetAddress cAgentInetAddress)
                           throws java.util.NoSuchElementException
Deprecated. as of jSNMP v3.0 by removeTrapSession()

Creates a SNMPv1 'remote' authoritative session from the cAgentInetAddress argument and calls the removeTrapSession() method to remove the session to the list of sessions to receive traps.
Parameters:
cAgentInetAddress - the InetAddress of the agent to remove
Returns:
true if the list is now empty, else false
Throws:
java.util.NoSuchElementException - if the address is not in the list

removeAgentIPAddress

public boolean removeAgentIPAddress(java.lang.String szAgentIPAddress)
                             throws java.util.NoSuchElementException,
                                    java.lang.IllegalArgumentException
Deprecated. as of jSNMP v3.0 by removeTrapSession()

Creates a SNMPv1 'remote' authoritative session from the szAgentIPAddress argument and calls the removeTrapSession() method to remove the session to the list of sessions to receive traps.
Parameters:
szAgentIPAddress - the IP address of the agent to remove
Returns:
true if the list is now empty, else false
Throws:
java.util.NoSuchElementException - if the address is not in the list
java.lang.IllegalArgumentException - if invalid IP address

removeTrapSession

public boolean removeTrapSession(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession)
                          throws java.util.NoSuchElementException,
                                 java.lang.IllegalArgumentException
Removes a session from the list of Trap sessions.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port(un-used), and security object for the agent
Returns:
true if the list is now empty, else false
Throws:
java.util.NoSuchElementException - if the session is not in the list
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not a 'remote' authoritative session

removeInformSession

public boolean removeInformSession(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession)
                            throws java.util.NoSuchElementException,
                                   java.lang.IllegalArgumentException
Removes a session from the list of Inform sessions.
Parameters:
cSnmpLocalAuthoritativeSession - contains host, port(un-used), and security object for the agent
Returns:
true if the list is now empty, else false
Throws:
java.util.NoSuchElementException - if the session is not in the list
java.lang.IllegalArgumentException - if cSnmpLocalAuthoritativeSession is not a "local" authoritative session

listAgentAddresses

public java.net.InetAddress[] listAgentAddresses()
Deprecated. as of jSNMP v3.0 by listTrapSessions()

Lists all the agent InetAddress's used to check incoming Traps.
Returns:
the list of addresses

listAgentsIPAddress

public java.lang.String[] listAgentsIPAddress()
Deprecated. as of jSNMP v3.0 by listTrapSessions()

Lists all the agent IP addresses used to check incoming Traps.
Returns:
the list of host IP addresses

listTrapSessions

public SnmpAuthoritativeSession[] listTrapSessions()
Lists all the agent sessions used to check incoming Traps.
Returns:
the list of sessions

listInformSessions

public SnmpAuthoritativeSession[] listInformSessions()
Lists all the agent sessions used to check incoming Informs.
Returns:
the list of sessions

addGenericTrapType

public boolean addGenericTrapType(java.lang.Integer igrType)
Deprecated. as of jSNMP v3.0 by addTrapInform()

Adds a generic trap type to the list of generic types. Duplicates are not allowed.
Parameters:
igrType - the type (coldStart, warmStart, etc.) to add
Returns:
false if the type was already in the list or invalid igrType; true otherwise

addSpecificTrapType

public boolean addSpecificTrapType(java.lang.Integer igrType)
Deprecated. as of jSNMP v3.0 by addTrapInform()

Adds a specific trap type to the list of specific types. Duplicates are not allowed.
Parameters:
igrType - the specific type to add
Returns:
false if the type was already in the list; true otherwise

removeGenericTrapType

public boolean removeGenericTrapType(java.lang.Integer igrType)
                              throws java.util.NoSuchElementException
Deprecated. as of jSNMP v3.0 by removeTrapInform()

Removes a generic type from the list of generic types. If all of the generic types are removed from the list then traps will not be matched against any generic types.
Parameters:
igrType - the type to remove
Returns:
true if the list is now empty and this parameter will not be used for filtering
Throws:
java.util.NoSuchElementException - if the type is not in the list

removeSpecificTrapType

public boolean removeSpecificTrapType(java.lang.Integer igrType)
                               throws java.util.NoSuchElementException
Deprecated. as of jSNMP v3.0 by removeTrapInform()

Removes a specific type from the list of specific types. If all of the specific types are removed from the list then traps will not be matched against any specific types.
Parameters:
igrType - the type to remove
Returns:
true if the list is now empty and this parameter will not be used for filtering
Throws:
java.util.NoSuchElementException - if the type is not in the list

listGenericTrapTypes

public java.lang.Integer[] listGenericTrapTypes()
Deprecated. as of jSNMP v3.0 by listTrapTypes()

Lists all the generic trap types used to check incoming traps
Returns:
the list of generic trap types

listSpecificTrapTypes

public java.lang.Integer[] listSpecificTrapTypes()
Deprecated. as of jSNMP v3.0 by listTrapTypes()

Lists all the specific trap types used to check incoming traps
Returns:
the list of specific trap types

addTrapInform

public boolean addTrapInform(java.lang.String szOID,
                             java.lang.Integer igrType)
                      throws java.lang.IllegalArgumentException
Adds a trap/inform. Duplicates are not allowed. To add the SNMPv1 "generic" trap "coldStart", use the following: addTrapInform("1.3.6.1.6.3.1.1.5", new Integer(SnmpConstants.TRAP_COLD_START.intValue() + 1))
Parameters:
szOID - enterprise OID for trap
igrType - the type to add
Returns:
false if the type was already in the list; true otherwise
Throws:
java.lang.IllegalArgumentException - if szOID is null or not OID (1.3.6....) or invalid igrType for "generic" trap.

removeTrapInform

public boolean removeTrapInform(java.lang.String szOID,
                                java.lang.Integer igrType)
                         throws java.util.NoSuchElementException
Removes a trap/inform type from an enterprise OID. If all of the types are removed from the list then traps/informs will not be matched against the enterprise OID.
Parameters:
szOID - enterprise OID for trap
igrType - the type to remove
Returns:
true if the list is now empty and this parameter will not be used for filtering
Throws:
java.util.NoSuchElementException - if the type is not in the list

removeTrapInform

public boolean removeTrapInform(java.lang.String szOID)
                         throws java.util.NoSuchElementException
Removes all trap/form types for an enterprise OID. Traps/informs will not be matched against the enterprise OID.
Parameters:
szOID - enterprise OID for trap
Returns:
true if the list is now empty and this parameter will not be used for filtering
Throws:
java.util.NoSuchElementException - if the type is not in the list

removeTrapsInforms

public void removeTrapsInforms()
Removes all traps/informs, if any.

listTrapInformTypes

public java.lang.Integer[] listTrapInformTypes(java.lang.String szOID)
Lists all the trap/inform types for an enterprise OID that are used to check incoming traps/informs.
Parameters:
szOID - enterprise OID for trap
Returns:
the list of specific trap types if any, else null if none

listTrapInformOIDs

public java.lang.String[] listTrapInformOIDs()
Lists all the trap/inform enterprise OIDs that are used to check incoming traps/informs.
Returns:
the list of enterprise OIDs if any, else null if none


Home  Services  Products  Purchase  Contact Us  About Us  Legal  Ceramics
Copyright © 2003-2008 jSNMP Enterprises All rights reserved.