com.outbackinc.services.protocol.snmp
Interface SnmpService


public interface SnmpService

As of jSNMP v3.0, SnmpService supports all SNMPv1 requests (get, get-next, and set) along with SNMPv2/3 requests (get-bulk, report, and inform). It also supports the sending of traps. All requests (except traps) are asynchronous "orders". Those clients requesting orders pass in their SnmpCustomer interface to which all order results are delivered. The values in each successful order are mapped from their ASN.1 types to their respective Java types as shown in the following list:

 
ASN.1
Java
NULL
null
INTEGER and Integer32
java.math.BigInteger
OCTET STRING
byte[ ]
Opaque
byte[ ]
IpAddress
java.lang.String
OBJECT IDENTIFIER
java.lang.String
Counter and Counter32
java.lang.Long
Gauge, Gauge32, and Unsigned32
java.lang.Long
TimeTicks
java.lang.Long
Counter64
java.math.BigInteger
UInteger32 (historic)
java.lang.Long

Java ints are signed 32-bit values, but Counter, Counter32, Gauge, Gauge32, Unsigned32, UInteger32, and TimeTicks are unsigned and may use the full 32-bits. To avoid signed/unsigned conversions, a java.lang.Long is used. However, if values greater that can be represented by a 32-bit unsigned number are supplied to the service, an exception will be thrown. Java does not have an unsigned 64 bit value, consequently a java.math.BigInteger is used. However, if values less than 0 or values greater than can be represented by a 64-bit unsigned number are supplied to the service, an exception will be thrown.

SnmpService also supports trap and inform registration. Clients wishing to receive trap and inform events, register with the SnmpService by passing in an interface which will be called when a trap or inform is received. Trap profiles must be associated with each trap listener, thus providing a filtering mechanism for the traps and informs received by the service. Note that the SNMP agent must be configured separately to send traps to the host and port where the service resides.

See Also:
SnmpAuthoritativeSession, SnmpOrderInfo, SnmpCustomer, SnmpTrapEvent, SnmpTrapListener, SnmpTrapProfile

Method Summary
 boolean addTrapListenerProfile(SnmpTrapListener cSnmpTrapListener, SnmpTrapProfile cSnmpTrapProfile)
          Adds a profile to a listener registered with the SnmpService.
 SnmpSecurityManager getSecurityManager()
          Get a handle to the Security Manager.
 SnmpTrapProfile[] listTrapListenerProfiles(SnmpTrapListener cSnmpTrapListener)
          Lists all profiles associated with a trap listener
 int placeGetBulkOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, java.lang.String[] szNonRepeaterOIDs, java.lang.String[] szRepeaterOIDs, int iMaxRepetitions, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous get-bulk request.
 int placeGetNextOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, boolean bAtomic, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous get-next request.
 int placeGetOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, boolean bAtomic, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous get request.
 int placeInformOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, java.lang.Long lAgentTimeStamp, SnmpOrderInfo cSnmpOrderInfo, java.lang.String szEnterpriseOID, int iTrapNum, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous inform request.
 int placeInformOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, java.lang.String szEnterpriseOID, int iTrapNum, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous inform request.
 void placeInspectionOrder(java.net.InetAddress cHostInetAddress, int iPort, int iRetries, int iTimeout, long lCacheThreshold, byte bRequestType, java.lang.String szReadCommunity, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()
 void placeInspectionOrder(java.net.InetAddress cHostInetAddress, int iPort, SnmpOrderInfo cSnmpOrderInfo, byte bRequestType, java.lang.String szReadCommunity, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()
 void placeInspectionOrder(java.lang.String szHost, int iPort, int iRetries, int iTimeout, long lCacheThreshold, byte bRequestType, java.lang.String szReadCommunity, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()
 void placeInspectionOrder(java.lang.String szHost, int iPort, SnmpOrderInfo cSnmpOrderInfo, byte bRequestType, java.lang.String szReadCommunity, java.lang.String[] szOIDs, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()
 void placeModificationOrder(java.net.InetAddress cHostInetAddress, int iPort, int iRetries, int iTimeout, java.lang.String szWriteCommunity, boolean bAtomic, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeSetOrder()
 void placeModificationOrder(java.net.InetAddress cHostInetAddress, int iPort, SnmpOrderInfo cSnmpOrderInfo, java.lang.String szWriteCommunity, boolean bAtomic, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeSetOrder()
 void placeModificationOrder(java.lang.String szHost, int iPort, int iRetries, int iTimeout, java.lang.String szWriteCommunity, boolean bAtomic, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeSetOrder()
 void placeModificationOrder(java.lang.String szHost, int iPort, SnmpOrderInfo cSnmpOrderInfo, java.lang.String szWriteCommunity, boolean bAtomic, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Deprecated. as of jSNMP v3.0 by placeSetOrder()
 int placeReportOrder(SnmpAuthoritativeSession cSnmpAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous report request.
 int placeSetOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession, SnmpOrderInfo cSnmpOrderInfo, boolean bAtomic, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects, SnmpCustomer cSnmpCustomer, int iOrderNumStart)
          Places an order for an asynchronous set request.
 boolean placeTrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession, java.lang.Long lAgentTimeStamp, java.lang.String szEnterpriseOID, int iTrapNum, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects)
          This method is the same as placeTrapOrder except it allows the caller to specify the timestamp.
 boolean placeTrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession, java.lang.String szEnterpriseOID, int iTrapNum, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects)
          Places a synchronous trap request.
 boolean placeV1TrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession, java.net.InetAddress cAgentInetAddress, java.lang.Long lAgentTimeStamp, java.lang.String szEnterpriseOID, int iTrapNum, java.lang.String[] szOIDs, byte[] cbTypes, java.lang.Object[] cValueObjects)
          This method is the same as placeTrapOrder except it is for SNMPV1 traps only and allows the caller to specify the agent address and timestamp.
 void removeTrapListener(SnmpTrapListener cSnmpTrapListener)
          Removes all profiles associated with a listener and unregisters the listener from the service.
 boolean removeTrapListenerProfile(SnmpTrapListener cSnmpTrapListener, SnmpTrapProfile cSnmpTrapProfile)
          Removes a profile from a registered listener.
 void stop()
          Stop the SnmpService.
 

Method Detail

placeInspectionOrder

public void placeInspectionOrder(java.net.InetAddress cHostInetAddress,
                                 int iPort,
                                 int iRetries,
                                 int iTimeout,
                                 long lCacheThreshold,
                                 byte bRequestType,
                                 java.lang.String szReadCommunity,
                                 java.lang.String[] szOIDs,
                                 SnmpCustomer cSnmpCustomer,
                                 int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()

Places an order for an asynchronous get or get-next request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cHostInetAddress - host of the agent
iPort - UDP port of the agent
iRetries - maximum number of packet retries
iTimeout - maximum time to wait in seconds for response packet
lCacheThreshold - maximum age of value in milliseconds if a value exists in the cache. A cacheThreshold of 0 means a fresh value will be retrieved
bRequestType - SnmpConstants.SNMP_GET or SnmpConstants.SNMP_GET_NEXT
szReadCommunity - community name
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeInspectionOrder

public void placeInspectionOrder(java.lang.String szHost,
                                 int iPort,
                                 int iRetries,
                                 int iTimeout,
                                 long lCacheThreshold,
                                 byte bRequestType,
                                 java.lang.String szReadCommunity,
                                 java.lang.String[] szOIDs,
                                 SnmpCustomer cSnmpCustomer,
                                 int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()

Places an order for an asynchronous get or get-next request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
szHost - hostname of the agent
iPort - UDP port of the agent
iRetries - maximum number of packet retries
iTimeout - maximum time to wait in seconds for response packet
lCacheThreshold - maximum age of value in milliseconds if a value exists in the cache. A cacheThreshold of 0 means a fresh value will be retrieved
bRequestType - SnmpConstants.SNMP_GET or SnmpConstants.SNMP_GET_NEXT
szReadCommunity - community name
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeInspectionOrder

public void placeInspectionOrder(java.net.InetAddress cHostInetAddress,
                                 int iPort,
                                 SnmpOrderInfo cSnmpOrderInfo,
                                 byte bRequestType,
                                 java.lang.String szReadCommunity,
                                 java.lang.String[] szOIDs,
                                 SnmpCustomer cSnmpCustomer,
                                 int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()

Places an order for an asynchronous get or get-next request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cHostInetAddress - host of the agent
iPort - UDP port of the agent
cSnmpOrderInfo - contains retries, wait-time, and cache age
bRequestType - SnmpConstants.SNMP_GET or SnmpConstants.SNMP_GET_NEXT
szReadCommunity - community name
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeInspectionOrder

public void placeInspectionOrder(java.lang.String szHost,
                                 int iPort,
                                 SnmpOrderInfo cSnmpOrderInfo,
                                 byte bRequestType,
                                 java.lang.String szReadCommunity,
                                 java.lang.String[] szOIDs,
                                 SnmpCustomer cSnmpCustomer,
                                 int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeGetOrder() and placeGetNextOrder()

Places an order for an asynchronous get or get-next request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
szHost - hostname of the agent
iPort - UDP port of the agent
cSnmpOrderInfo - contains retries, wait-time, and cache age
bRequestType - SnmpConstants.SNMP_GET or SnmpConstants.SNMP_GET_NEXT
szReadCommunity - community name
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeGetOrder

public int placeGetOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                         SnmpOrderInfo cSnmpOrderInfo,
                         boolean bAtomic,
                         java.lang.String[] szOIDs,
                         SnmpCustomer cSnmpCustomer,
                         int iOrderNumStart)
                  throws java.lang.IllegalArgumentException
Places an order for an asynchronous get request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
cSnmpOrderInfo - contains retries, wait-time, and cache age
bAtomic - true if all gets are to be sent in the same PDU (implies no caching)
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeGetNextOrder

public int placeGetNextOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                             SnmpOrderInfo cSnmpOrderInfo,
                             boolean bAtomic,
                             java.lang.String[] szOIDs,
                             SnmpCustomer cSnmpCustomer,
                             int iOrderNumStart)
                      throws java.lang.IllegalArgumentException
Places an order for an asynchronous get-next request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
cSnmpOrderInfo - contains retries, wait-time, and cache age
bAtomic - true if all get-nexts are to be sent in the same PDU (implies no caching)
szOIDs - array of OIDs in dotted notation
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeGetBulkOrder

public int placeGetBulkOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                             SnmpOrderInfo cSnmpOrderInfo,
                             java.lang.String[] szNonRepeaterOIDs,
                             java.lang.String[] szRepeaterOIDs,
                             int iMaxRepetitions,
                             SnmpCustomer cSnmpCustomer,
                             int iOrderNumStart)
                      throws java.lang.IllegalArgumentException
Places an order for an asynchronous get-bulk request. All get-bulk requests are "atomic." An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
szNonRepeaterOIDs - array of non-repeater OIDs in dotted notation
szRepeaterOIDs - array of repeater OIDs in dotted notation
iMaxRepetitions - maximum number of repetitions on repeaters
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion (e.g if iOrderNumStart=7 and the inspection consists of 3 non-repeater OIDs and 3 repeater OIDs and 2 maximum repetitions, the order numbers would be 7, 8, and 9 for the 3 non-repeaters and possibly 10, 11, 12, 13, 14, and 15 for the 3 repeaters.)
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeModificationOrder

public void placeModificationOrder(java.net.InetAddress cHostInetAddress,
                                   int iPort,
                                   int iRetries,
                                   int iTimeout,
                                   java.lang.String szWriteCommunity,
                                   boolean bAtomic,
                                   java.lang.String[] szOIDs,
                                   byte[] cbTypes,
                                   java.lang.Object[] cValueObjects,
                                   SnmpCustomer cSnmpCustomer,
                                   int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeSetOrder()

Places an order for an asynchronous set request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cHostInetAddress - host of the agent
iPort - UDP port of the agent
iRetries - maximum number of packet retries
iTimeout - maximum time to wait in seconds for response packet
szWriteCommunity - community name
bAtomic - true if all sets are to be sent in the same PDU
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion. (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeModificationOrder

public void placeModificationOrder(java.lang.String szHost,
                                   int iPort,
                                   int iRetries,
                                   int iTimeout,
                                   java.lang.String szWriteCommunity,
                                   boolean bAtomic,
                                   java.lang.String[] szOIDs,
                                   byte[] cbTypes,
                                   java.lang.Object[] cValueObjects,
                                   SnmpCustomer cSnmpCustomer,
                                   int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeSetOrder()

Places an order for an asynchronous set request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
szHost - hostname of the agent
iPort - UDP port of the agent
iRetries - maximum number of packet retries
iTimeout - maximum time to wait in seconds for response packet
szWriteCommunity - community name
bAtomic - true if all sets are to be sent in the same PDU
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion. (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeModificationOrder

public void placeModificationOrder(java.net.InetAddress cHostInetAddress,
                                   int iPort,
                                   SnmpOrderInfo cSnmpOrderInfo,
                                   java.lang.String szWriteCommunity,
                                   boolean bAtomic,
                                   java.lang.String[] szOIDs,
                                   byte[] cbTypes,
                                   java.lang.Object[] cValueObjects,
                                   SnmpCustomer cSnmpCustomer,
                                   int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeSetOrder()

Places an order for an asynchronous set request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cHostInetAddress - host of the agent
iPort - UDP port of the agent
cSnmpOrderInfo - contains retries, and wait-time (cache age is ignored)
szWriteCommunity - community name
bAtomic - true if all sets are to be sent in the same PDU
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion. (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeModificationOrder

public void placeModificationOrder(java.lang.String szHost,
                                   int iPort,
                                   SnmpOrderInfo cSnmpOrderInfo,
                                   java.lang.String szWriteCommunity,
                                   boolean bAtomic,
                                   java.lang.String[] szOIDs,
                                   byte[] cbTypes,
                                   java.lang.Object[] cValueObjects,
                                   SnmpCustomer cSnmpCustomer,
                                   int iOrderNumStart)
Deprecated. as of jSNMP v3.0 by placeSetOrder()

Places an order for an asynchronous set request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
szHost - hostname of the agent
iPort - UDP port of the agent
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
szWriteCommunity - community name
bAtomic - true if all sets are to be sent in the same PDU
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion. (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)

placeSetOrder

public int placeSetOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                         SnmpOrderInfo cSnmpOrderInfo,
                         boolean bAtomic,
                         java.lang.String[] szOIDs,
                         byte[] cbTypes,
                         java.lang.Object[] cValueObjects,
                         SnmpCustomer cSnmpCustomer,
                         int iOrderNumStart)
                  throws java.lang.IllegalArgumentException
Places an order for an asynchronous set request. An error code or a successful result will be sent to the SnmpCustomer for every OID.
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
bAtomic - true if all sets are to be sent in the same PDU
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - index of first order number to be passed to the SnmpCustomer on completion. (e.g if iOrderNumStart=7 and the inspection consists of 3 OIDs, the order numbers would be 7,8,9.)
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeInformOrder

public int placeInformOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                            SnmpOrderInfo cSnmpOrderInfo,
                            java.lang.String szEnterpriseOID,
                            int iTrapNum,
                            java.lang.String[] szOIDs,
                            byte[] cbTypes,
                            java.lang.Object[] cValueObjects,
                            SnmpCustomer cSnmpCustomer,
                            int iOrderNumStart)
                     throws java.lang.IllegalArgumentException
Places an order for an asynchronous inform request. An error code or a successful result will be sent to the SnmpCustomer for every OID. Note that if szEnterpriseOID is null, it is assumed that you wish to place one of the generic traps, thus iTrapNum must be one of SnmpConstants.TRAP_COLD_START + 1, SnmpConstants.TRAP_WARM_START + 1, SnmpConstants.TRAP_LINK_DOWN + 1, SnmpConstants.TRAP_LINK_UP + 1, SnmpConstants.TRAP_AUTHENTICATION_FAILURE + 1, or SnmpConstants.TRAP_EGP_NEIGHBOR_LOSS + 1. They will be sent with an enterprise OID of 1.3.6.1.6.3.1.1.5. To add the SNMPv1 "generic" inform "coldStart", use the following: szEnterpriseOID = "1.3.6.1.6.3.1.1.5" iTrapNum = SnmpConstants.TRAP_COLD_START + 1
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
szEnterpriseOID - enterprise OID
iTrapNum - trap number for enterprise
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - order number to be passed to the SnmpCustomer upon completion
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeInformOrder

public int placeInformOrder(SnmpAuthoritativeSession cSnmpRemoteAuthoritativeSession,
                            java.lang.Long lAgentTimeStamp,
                            SnmpOrderInfo cSnmpOrderInfo,
                            java.lang.String szEnterpriseOID,
                            int iTrapNum,
                            java.lang.String[] szOIDs,
                            byte[] cbTypes,
                            java.lang.Object[] cValueObjects,
                            SnmpCustomer cSnmpCustomer,
                            int iOrderNumStart)
                     throws java.lang.IllegalArgumentException
Places an order for an asynchronous inform request. An error code or a successful result will be sent to the SnmpCustomer for every OID. Note that if szEnterpriseOID is null, it is assumed that you wish to place one of the generic traps, thus iTrapNum must be one of SnmpConstants.TRAP_COLD_START + 1, SnmpConstants.TRAP_WARM_START + 1, SnmpConstants.TRAP_LINK_DOWN + 1, SnmpConstants.TRAP_LINK_UP + 1, SnmpConstants.TRAP_AUTHENTICATION_FAILURE + 1, or SnmpConstants.TRAP_EGP_NEIGHBOR_LOSS + 1. They will be sent with an enterprise OID of 1.3.6.1.6.3.1.1.5. To add the SNMPv1 "generic" inform "coldStart", use the following: szEnterpriseOID = "1.3.6.1.6.3.1.1.5" iTrapNum = SnmpConstants.TRAP_COLD_START + 1
Parameters:
cSnmpRemoteAuthoritativeSession - contains host, port, and security object for the agent
lAgentTimeStamp - trap time stamp (if null, the application's 'uptime' will be used)
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
szEnterpriseOID - enterprise OID
iTrapNum - trap number for enterprise
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - order number to be passed to the SnmpCustomer upon completion
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.
Throws:
java.lang.IllegalArgumentException - if cSnmpRemoteAuthoritativeSession is not "remote" authoritative session

placeTrapOrder

public boolean placeTrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession,
                              java.lang.String szEnterpriseOID,
                              int iTrapNum,
                              java.lang.String[] szOIDs,
                              byte[] cbTypes,
                              java.lang.Object[] cValueObjects)
                       throws java.lang.IllegalArgumentException
Places a synchronous trap request. If szEnterpriseOID is null, it is assumed the caller wishes to place one of the generic traps, thus iTrapNum must be one of SnmpConstants.TRAP_COLD_START + 1, SnmpConstants.TRAP_WARM_START + 1, SnmpConstants.TRAP_LINK_DOWN + 1, SnmpConstants.TRAP_LINK_UP + 1, SnmpConstants.TRAP_AUTHENTICATION_FAILURE + 1, or SnmpConstants.TRAP_EGP_NEIGHBOR_LOSS + 1. To add the SNMPv1 "generic" trap "coldStart", use the following:
      szEnterpriseOID = "1.3.6.1.6.3.1.1.5";
      iTrapNum = SnmpConstants.TRAP_COLD_START + 1;
 
Parameters:
cSnmpLocalAuthoritativeSession - contains host, port, and security object for the agent
szEnterpriseOID - enterprise OID
iTrapNum - trap number for enterprise
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
Returns:
true if the trap was sent, else false.
Throws:
java.lang.IllegalArgumentException - if cLocalSnmpAuthoritativeSession is not "local"

placeV1TrapOrder

public boolean placeV1TrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession,
                                java.net.InetAddress cAgentInetAddress,
                                java.lang.Long lAgentTimeStamp,
                                java.lang.String szEnterpriseOID,
                                int iTrapNum,
                                java.lang.String[] szOIDs,
                                byte[] cbTypes,
                                java.lang.Object[] cValueObjects)
                         throws java.lang.IllegalArgumentException
This method is the same as placeTrapOrder except it is for SNMPV1 traps only and allows the caller to specify the agent address and timestamp.
Parameters:
cSnmpLocalAuthoritativeSession - contains host, port, and security object for the agent
cAgentInetAddress - trap source address (if null, the application's host address will be used)
lAgentTimeStamp - trap time stamp (if null, the application's 'uptime' will be used)
szEnterpriseOID - enterprise OID
iTrapNum - trap number for enterprise
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
Returns:
true if the trap was sent, else false.
Throws:
java.lang.IllegalArgumentException - if cLocalSnmpAuthoritativeSession is not "local" or not "V1"

placeTrapOrder

public boolean placeTrapOrder(SnmpAuthoritativeSession cSnmpLocalAuthoritativeSession,
                              java.lang.Long lAgentTimeStamp,
                              java.lang.String szEnterpriseOID,
                              int iTrapNum,
                              java.lang.String[] szOIDs,
                              byte[] cbTypes,
                              java.lang.Object[] cValueObjects)
                       throws java.lang.IllegalArgumentException
This method is the same as placeTrapOrder except it allows the caller to specify the timestamp.
Parameters:
cSnmpLocalAuthoritativeSession - contains host, port, and security object for the agent
szEnterpriseOID - enterprise OID
lAgentTimeStamp - trap time stamp (if null, the application's 'uptime' will be used)
iTrapNum - trap number for enterprise
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values to set
Returns:
true if the trap was sent, else false.
Throws:
java.lang.IllegalArgumentException - if cLocalSnmpAuthoritativeSession is not "local"

placeReportOrder

public int placeReportOrder(SnmpAuthoritativeSession cSnmpAuthoritativeSession,
                            SnmpOrderInfo cSnmpOrderInfo,
                            java.lang.String[] szOIDs,
                            byte[] cbTypes,
                            java.lang.Object[] cValueObjects,
                            SnmpCustomer cSnmpCustomer,
                            int iOrderNumStart)
Places an order for an asynchronous report request. All report requests are "atomic." An error code or a successful result will be sent to the SnmpCustomer for every OID. Note that the cSnmpAuthoritativeSession argument is a SnmpAuthoritativeSession object. This means that it can be either a "local" or "remote."
Parameters:
cSnmpAuthoritativeSession - contains host, port, and security object for an agent
cSnmpOrderInfo - contains retries and wait-time (cache age is ignored)
szOIDs - array of OIDs in dotted notation
cbTypes - array of bytes representing ASN.1 types
cValueObjects - array of values
bRequestType - request type
cSnmpCustomer - requesting customer (callback)
iOrderNumStart - order number to be passed to the SnmpCustomer upon completion
Returns:
0 if parameter validation fails and the order is aborted, else the next 'iOrderNumStart'.
Note: If the return value is non-zero, then the success or failure of the order is indicated solely by the SnmpCustomer callback.

addTrapListenerProfile

public boolean addTrapListenerProfile(SnmpTrapListener cSnmpTrapListener,
                                      SnmpTrapProfile cSnmpTrapProfile)
                               throws java.net.SocketException
Adds a profile to a listener registered with the SnmpService. This profile is when the service receives a trap. The listener will be registered with the service if this is the first profile. Listeners support multiple profiles. A received trap will be deliverd to a listener if the received trap matches any of the profiles associated with the listener.
Parameters:
cSnmpTrapListener - a new or existing listener
cSnmpTrapProfile - profile to add to the list of associated profiles
Returns:
false if the profile was already in the list for the listener or parameter validation fails, otherwise true.
Throws:
java.net.SocketException - if the Service is unable to listen for traps on a specified port

removeTrapListenerProfile

public boolean removeTrapListenerProfile(SnmpTrapListener cSnmpTrapListener,
                                         SnmpTrapProfile cSnmpTrapProfile)
                                  throws java.util.NoSuchElementException
Removes a profile from a registered listener. If this is the only profile associated with the listener, the listener is unregistered from the service.
Parameters:
cSnmpTrapListener - listener registered with the service
cSnmpTrapProfile - profile to remove from the listener
Returns:
true if the profile was in the list and thus removed, otherwise false.
Throws:
java.util.NoSuchElementException - if the listener is not registered

listTrapListenerProfiles

public SnmpTrapProfile[] listTrapListenerProfiles(SnmpTrapListener cSnmpTrapListener)
                                           throws java.util.NoSuchElementException
Lists all profiles associated with a trap listener
Parameters:
cSnmpTrapListener - listener registered with the service
Returns:
the list of profiles associated with the SnmpTrapListener given.
Throws:
java.util.NoSuchElementException - thrown if the listener is not registered.

removeTrapListener

public void removeTrapListener(SnmpTrapListener cSnmpTrapListener)
                        throws java.util.NoSuchElementException
Removes all profiles associated with a listener and unregisters the listener from the service.
Parameters:
cSnmpTrapListener - listener registered with the service
Throws:
java.util.NoSuchElementException - thrown if the listener is not registered.

getSecurityManager

public SnmpSecurityManager getSecurityManager()
Get a handle to the Security Manager.
Returns:
The security manager for the SnmpService.

stop

public void stop()
Stop the SnmpService. This method will release all resources owned by the SnmpService including threads. This method should normally be called only when the application is to terminate. Any calls made on the SnmpService after stop() is called may not perform reliably.


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