PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/jre-1.6.0/src/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 686 lines | 98 code | 73 blank | 515 comment | 0 complexity | 6b4967fc4645f5b9e15824a5845902c2 MD5 | raw file
  1. /*
  2. * %Z%file %M%
  3. * %Z%author Sun Microsystems, Inc.
  4. * %Z%version %I%
  5. * %Z%date %D%
  6. *
  7. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  8. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp.daemon;
  12. // java import
  13. import java.util.Vector;
  14. import java.io.IOException;
  15. import java.net.InetAddress;
  16. // jmx imports
  17. //
  18. import com.sun.jmx.snmp.SnmpPduFactory;
  19. import com.sun.jmx.snmp.SnmpStatusException;
  20. import com.sun.jmx.snmp.SnmpVarBindList;
  21. import com.sun.jmx.snmp.SnmpOid;
  22. import com.sun.jmx.snmp.SnmpTimeticks;
  23. import com.sun.jmx.snmp.SnmpIpAddress;
  24. import com.sun.jmx.snmp.SnmpPduPacket;
  25. import com.sun.jmx.snmp.InetAddressAcl;
  26. import com.sun.jmx.snmp.SnmpPeer;
  27. // SNMP Runtime imports
  28. //
  29. import com.sun.jmx.snmp.agent.SnmpMibAgent;
  30. import com.sun.jmx.snmp.agent.SnmpMibHandler;
  31. import com.sun.jmx.snmp.agent.SnmpUserDataFactory;
  32. /**
  33. * Exposes the remote management interface of the {@link SnmpAdaptorServer} MBean.
  34. * <p><b>This API is a Sun Microsystems internal API and is subject
  35. * to change without notice.</b></p>
  36. */
  37. public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean {
  38. // GETTERS AND SETTERS
  39. //--------------------
  40. /**
  41. * Returns the Ip address based ACL used by this SNMP protocol adaptor.
  42. * @return The <CODE>InetAddressAcl</CODE> implementation.
  43. *
  44. * @since 1.5
  45. */
  46. public InetAddressAcl getInetAddressAcl();
  47. /**
  48. * Returns the port used by this SNMP protocol adaptor for sending traps.
  49. * By default, port 162 is used.
  50. *
  51. * @return The port number for sending SNMP traps.
  52. */
  53. public Integer getTrapPort();
  54. /**
  55. * Sets the port used by this SNMP protocol adaptor for sending traps.
  56. *
  57. * @param port The port number for sending SNMP traps.
  58. */
  59. public void setTrapPort(Integer port);
  60. /**
  61. * Returns the port used by this SNMP protocol adaptor for sending inform requests.
  62. * By default, port 162 is used.
  63. *
  64. * @return The port number for sending SNMP inform requests.
  65. */
  66. public int getInformPort();
  67. /**
  68. * Sets the port used by this SNMP protocol adaptor for sending inform requests.
  69. *
  70. * @param port The port number for sending SNMP inform requests.
  71. */
  72. public void setInformPort(int port);
  73. /**
  74. * Gets the number of managers that have been processed by this SNMP protocol adaptor
  75. * since its creation.
  76. *
  77. * @return The number of managers handled by this SNMP protocol adaptor
  78. * since its creation. This counter is not reset by the <CODE>stop</CODE> method.
  79. */
  80. public int getServedClientCount();
  81. /**
  82. * Gets the number of managers currently being processed by this
  83. * SNMP protocol adaptor.
  84. *
  85. * @return The number of managers currently being processed by this
  86. * SNMP protocol adaptor.
  87. */
  88. public int getActiveClientCount();
  89. /**
  90. * Gets the maximum number of managers that this SNMP protocol adaptor can
  91. * process concurrently.
  92. *
  93. * @return The maximum number of managers that this SNMP protocol adaptor can
  94. * process concurrently.
  95. */
  96. public int getMaxActiveClientCount();
  97. /**
  98. * Sets the maximum number of managers this SNMP protocol adaptor can
  99. * process concurrently.
  100. *
  101. * @param c The number of managers.
  102. *
  103. * @exception java.lang.IllegalStateException This method has been invoked
  104. * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
  105. */
  106. public void setMaxActiveClientCount(int c) throws java.lang.IllegalStateException;
  107. /**
  108. * Returns the protocol of this SNMP protocol adaptor.
  109. *
  110. * @return The string "snmp".
  111. */
  112. public String getProtocol();
  113. /**
  114. * Returns the buffer size of this SNMP protocol adaptor.
  115. * By default, buffer size 1024 is used.
  116. *
  117. * @return The buffer size.
  118. */
  119. public Integer getBufferSize();
  120. /**
  121. * Sets the buffer size of this SNMP protocol adaptor.
  122. *
  123. * @param s The buffer size.
  124. *
  125. * @exception java.lang.IllegalStateException This method has been invoked
  126. * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
  127. */
  128. public void setBufferSize(Integer s) throws java.lang.IllegalStateException;
  129. /**
  130. * Gets the number of times to try sending an inform request before giving up.
  131. * @return The maximun number of tries.
  132. */
  133. public int getMaxTries();
  134. /**
  135. * Changes the maximun number of times to try sending an inform request before giving up.
  136. * @param newMaxTries The maximun number of tries.
  137. */
  138. public void setMaxTries(int newMaxTries);
  139. /**
  140. * Gets the timeout to wait for an inform response from the manager.
  141. * @return The value of the timeout property.
  142. */
  143. public int getTimeout();
  144. /**
  145. * Changes the timeout to wait for an inform response from the manager.
  146. * @param newTimeout The timeout (in milliseconds).
  147. */
  148. public void setTimeout(int newTimeout);
  149. /**
  150. * Returns the message factory of this SNMP protocol adaptor.
  151. *
  152. * @return The factory object.
  153. */
  154. public SnmpPduFactory getPduFactory();
  155. /**
  156. * Sets the message factory of this SNMP protocol adaptor.
  157. *
  158. * @param factory The factory object (null means the default factory).
  159. */
  160. public void setPduFactory(SnmpPduFactory factory);
  161. /**
  162. * Set the user-data factory of this SNMP protocol adaptor.
  163. *
  164. * @param factory The factory object (null means no factory).
  165. * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
  166. */
  167. public void setUserDataFactory(SnmpUserDataFactory factory);
  168. /**
  169. * Get the user-data factory associated with this SNMP protocol adaptor.
  170. *
  171. * @return The factory object (null means no factory).
  172. * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
  173. */
  174. public SnmpUserDataFactory getUserDataFactory();
  175. /**
  176. * Returns <CODE>true</CODE> if authentication traps are enabled.
  177. * <P>
  178. * When this feature is enabled, the SNMP protocol adaptor sends
  179. * an <CODE>authenticationFailure</CODE> trap each time an authentication fails.
  180. * <P>
  181. * The default behaviour is to send authentication traps.
  182. *
  183. * @return <CODE>true</CODE> if authentication traps are enabled, <CODE>false</CODE> otherwise.
  184. */
  185. public boolean getAuthTrapEnabled();
  186. /**
  187. * Sets the flag indicating if traps need to be sent in case of authentication failure.
  188. *
  189. * @param enabled Flag indicating if traps need to be sent.
  190. */
  191. public void setAuthTrapEnabled(boolean enabled);
  192. /**
  193. * Returns <code>true</code> if this SNMP protocol adaptor sends a response in case
  194. * of authentication failure.
  195. * <P>
  196. * When this feature is enabled, the SNMP protocol adaptor sends a response with <CODE>noSuchName</CODE>
  197. * or <CODE>readOnly</CODE> when the authentication failed. If the flag is disabled, the
  198. * SNMP protocol adaptor trashes the PDU silently.
  199. * <P>
  200. * The default behavior is to send responses.
  201. *
  202. * @return <code>true</code> if responses are sent.
  203. */
  204. public boolean getAuthRespEnabled();
  205. /**
  206. * Sets the flag indicating if responses need to be sent in case of authentication failure.
  207. *
  208. * @param enabled Flag indicating if responses need to be sent.
  209. */
  210. public void setAuthRespEnabled(boolean enabled);
  211. /**
  212. * Returns the enterprise OID. It is used by {@link #snmpV1Trap snmpV1Trap} to fill
  213. * the 'enterprise' field of the trap request.
  214. *
  215. * @return The OID in string format "x.x.x.x".
  216. */
  217. public String getEnterpriseOid();
  218. /**
  219. * Sets the enterprise OID.
  220. *
  221. * @param oid The OID in string format "x.x.x.x".
  222. *
  223. * @exception IllegalArgumentException The string format is incorrect
  224. */
  225. public void setEnterpriseOid(String oid) throws IllegalArgumentException;
  226. /**
  227. * Returns the names of the MIBs available in this SNMP protocol adaptor.
  228. *
  229. * @return An array of MIB names.
  230. */
  231. public String[] getMibs();
  232. // GETTERS FOR SNMP GROUP (MIBII)
  233. //-------------------------------
  234. /**
  235. * Returns the <CODE>snmpOutTraps</CODE> value defined in MIB-II.
  236. *
  237. * @return The <CODE>snmpOutTraps</CODE> value.
  238. */
  239. public Long getSnmpOutTraps();
  240. /**
  241. * Returns the <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
  242. *
  243. * @return The <CODE>snmpOutGetResponses</CODE> value.
  244. */
  245. public Long getSnmpOutGetResponses();
  246. /**
  247. * Returns the <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
  248. *
  249. * @return The <CODE>snmpOutGenErrs</CODE> value.
  250. */
  251. public Long getSnmpOutGenErrs();
  252. /**
  253. * Returns the <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
  254. *
  255. * @return The <CODE>snmpOutBadValues</CODE> value.
  256. */
  257. public Long getSnmpOutBadValues();
  258. /**
  259. * Returns the <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
  260. *
  261. * @return The <CODE>snmpOutNoSuchNames</CODE> value.
  262. */
  263. public Long getSnmpOutNoSuchNames();
  264. /**
  265. * Returns the <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
  266. *
  267. * @return The <CODE>snmpOutTooBigs</CODE> value.
  268. */
  269. public Long getSnmpOutTooBigs();
  270. /**
  271. * Returns the <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
  272. *
  273. * @return The <CODE>snmpInASNParseErrs</CODE> value.
  274. */
  275. public Long getSnmpInASNParseErrs();
  276. /**
  277. * Returns the <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
  278. *
  279. * @return The <CODE>snmpInBadCommunityUses</CODE> value.
  280. */
  281. public Long getSnmpInBadCommunityUses();
  282. /**
  283. * Returns the <CODE>snmpInBadCommunityNames</CODE> value defined in MIB-II.
  284. *
  285. * @return The <CODE>snmpInBadCommunityNames</CODE> value.
  286. */
  287. public Long getSnmpInBadCommunityNames();
  288. /**
  289. * Returns the <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
  290. *
  291. * @return The <CODE>snmpInBadVersions</CODE> value.
  292. */
  293. public Long getSnmpInBadVersions();
  294. /**
  295. * Returns the <CODE>snmpOutPkts</CODE> value defined in MIB-II.
  296. *
  297. * @return The <CODE>snmpOutPkts</CODE> value.
  298. */
  299. public Long getSnmpOutPkts();
  300. /**
  301. * Returns the <CODE>snmpInPkts</CODE> value defined in MIB-II.
  302. *
  303. * @return The <CODE>snmpInPkts</CODE> value.
  304. */
  305. public Long getSnmpInPkts();
  306. /**
  307. * Returns the <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
  308. *
  309. * @return The <CODE>snmpInGetRequests</CODE> value.
  310. */
  311. public Long getSnmpInGetRequests();
  312. /**
  313. * Returns the <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
  314. *
  315. * @return The <CODE>snmpInGetNexts</CODE> value.
  316. */
  317. public Long getSnmpInGetNexts();
  318. /**
  319. * Returns the <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
  320. *
  321. * @return The <CODE>snmpInSetRequests</CODE> value.
  322. */
  323. public Long getSnmpInSetRequests();
  324. /**
  325. * Returns the <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
  326. *
  327. * @return The <CODE>snmpInTotalSetVars</CODE> value.
  328. */
  329. public Long getSnmpInTotalSetVars();
  330. /**
  331. * Returns the <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
  332. *
  333. * @return The <CODE>snmpInTotalReqVars</CODE> value.
  334. */
  335. public Long getSnmpInTotalReqVars();
  336. /**
  337. * Returns the <CODE>snmpSilentDrops</CODE> value defined in rfc 1907 NMPv2-MIB .
  338. *
  339. * @return The <CODE>snmpSilentDrops</CODE> value.
  340. *
  341. * @since 1.5
  342. */
  343. public Long getSnmpSilentDrops();
  344. /**
  345. * Returns the <CODE>snmpProxyDrops</CODE> value defined in rfc 1907 NMPv2-MIB .
  346. *
  347. * @return The <CODE>snmpProxyDrops</CODE> value.
  348. *
  349. * @since 1.5
  350. */
  351. public Long getSnmpProxyDrops();
  352. // PUBLIC METHODS
  353. //---------------
  354. /**
  355. * Adds a new MIB in the SNMP MIB handler.
  356. * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)}
  357. * and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)}
  358. * and should not be called directly.
  359. *
  360. * @param mib The MIB to add.
  361. *
  362. * @return A reference to the SNMP MIB handler.
  363. *
  364. * @exception IllegalArgumentException If the parameter is null.
  365. */
  366. public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException;
  367. /**
  368. * Adds a new MIB in the SNMP MIB handler.
  369. *
  370. * @param mib The MIB to add.
  371. * @param oids The set of OIDs this agent implements.
  372. *
  373. * @return A reference to the SNMP MIB handler.
  374. *
  375. * @exception IllegalArgumentException If the parameter is null.
  376. *
  377. * @since 1.5
  378. */
  379. public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException;
  380. /**
  381. * Removes the specified MIB from the SNMP protocol adaptor.
  382. * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)}
  383. * and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)}
  384. * and should not be called directly.
  385. *
  386. * @param mib The MIB to be removed.
  387. *
  388. * @return <code>true</code> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
  389. * <code>false</code> otherwise.
  390. */
  391. public boolean removeMib(SnmpMibAgent mib);
  392. /**
  393. * Sends a trap using SNMP V1 trap format.
  394. * <BR>The trap is sent to each destination defined in the ACL file (if available).
  395. * If no ACL file or no destinations are available, the trap is sent to the local host.
  396. *
  397. * @param generic The generic number of the trap.
  398. * @param specific The specific number of the trap.
  399. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  400. *
  401. * @exception IOException An I/O error occured while sending the trap.
  402. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  403. */
  404. public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
  405. /**
  406. * Sends a trap using SNMP V1 trap format.
  407. * <BR>The trap is sent to the specified <CODE>InetAddress</CODE> destination
  408. * using the specified community string (and the ACL file is not used).
  409. *
  410. * @param address The <CODE>InetAddress</CODE> destination of the trap.
  411. * @param cs The community string to be used for the trap.
  412. * @param generic The generic number of the trap.
  413. * @param specific The specific number of the trap.
  414. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  415. *
  416. * @exception IOException An I/O error occurred while sending the trap.
  417. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  418. */
  419. public void snmpV1Trap(InetAddress address, String cs, int generic, int specific, SnmpVarBindList varBindList)
  420. throws IOException, SnmpStatusException;
  421. /**
  422. * Sends a trap using SNMP V1 trap format.
  423. * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
  424. * The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getRdCommunity() </CODE>).
  425. *
  426. * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
  427. * @param agentAddr The agent address to be used for the trap.
  428. * @param enterpOid The enterprise OID to be used for the trap.
  429. * @param generic The generic number of the trap.
  430. * @param specific The specific number of the trap.
  431. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  432. * @param time The time stamp (overwrite the current time).
  433. *
  434. * @exception IOException An I/O error occurred while sending the trap.
  435. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  436. *
  437. * @since 1.5
  438. */
  439. public void snmpV1Trap(SnmpPeer peer,
  440. SnmpIpAddress agentAddr,
  441. SnmpOid enterpOid,
  442. int generic,
  443. int specific,
  444. SnmpVarBindList varBindList,
  445. SnmpTimeticks time) throws IOException, SnmpStatusException;
  446. /**
  447. * Sends a trap using SNMP V2 trap format.
  448. * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
  449. * <BR>The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getRdCommunity() </CODE>).
  450. * <BR>The variable list included in the outgoing trap is composed of the following items:
  451. * <UL>
  452. * <LI><CODE>sysUpTime.0</CODE> with the value specified by <CODE>time</CODE>
  453. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  454. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  455. * </UL>
  456. *
  457. * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
  458. * @param trapOid The OID identifying the trap.
  459. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  460. * @param time The time stamp (overwrite the current time).
  461. *
  462. * @exception IOException An I/O error occurred while sending the trap.
  463. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  464. *
  465. * @since 1.5
  466. */
  467. public void snmpV2Trap(SnmpPeer peer,
  468. SnmpOid trapOid,
  469. SnmpVarBindList varBindList,
  470. SnmpTimeticks time) throws IOException, SnmpStatusException;
  471. /**
  472. * Sends a trap using SNMP V2 trap format.
  473. * <BR>The trap is sent to each destination defined in the ACL file (if available).
  474. * If no ACL file or no destinations are available, the trap is sent to the local host.
  475. * <BR>The variable list included in the outgoing trap is composed of the following items:
  476. * <UL>
  477. * <LI><CODE>sysUpTime.0</CODE> with its current value
  478. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  479. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  480. * </UL>
  481. *
  482. * @param trapOid The OID identifying the trap.
  483. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  484. *
  485. * @exception IOException An I/O error occured while sending the trap.
  486. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  487. */
  488. public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
  489. /**
  490. * Sends a trap using SNMP V2 trap format.
  491. * <BR>The trap is sent to the specified <CODE>InetAddress</CODE> destination
  492. * using the specified community string (and the ACL file is not used).
  493. * <BR>The variable list included in the outgoing trap is composed of the following items:
  494. * <UL>
  495. * <LI><CODE>sysUpTime.0</CODE> with its current value
  496. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  497. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  498. * </UL>
  499. *
  500. * @param address The <CODE>InetAddress</CODE> destination of the trap.
  501. * @param cs The community string to be used for the trap.
  502. * @param trapOid The OID identifying the trap.
  503. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  504. *
  505. * @exception IOException An I/O error occurred while sending the trap.
  506. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  507. */
  508. public void snmpV2Trap(InetAddress address, String cs, SnmpOid trapOid, SnmpVarBindList varBindList)
  509. throws IOException, SnmpStatusException;
  510. /**
  511. * Send the specified trap PDU to the passed <CODE>InetAddress</CODE>.
  512. * @param address The destination address.
  513. * @param pdu The pdu to send.
  514. * @exception IOException An I/O error occurred while sending the trap.
  515. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  516. *
  517. * @since 1.5
  518. */
  519. public void snmpPduTrap(InetAddress address, SnmpPduPacket pdu)
  520. throws IOException, SnmpStatusException;
  521. /**
  522. * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
  523. * @param peer The destination peer. The Read community string is used of <CODE>SnmpParameters</CODE> is used as the trap community string.
  524. * @param pdu The pdu to send.
  525. * @exception IOException An I/O error occurred while sending the trap.
  526. * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
  527. * @since 1.5
  528. */
  529. public void snmpPduTrap(SnmpPeer peer,
  530. SnmpPduPacket pdu)
  531. throws IOException, SnmpStatusException;
  532. /**
  533. * Sends an inform using SNMP V2 inform request format.
  534. * <BR>The inform request is sent to each destination defined in the ACL file (if available).
  535. * If no ACL file or no destinations are available, the inform request is sent to the local host.
  536. * <BR>The variable list included in the outgoing inform request is composed of the following items:
  537. * <UL>
  538. * <LI><CODE>sysUpTime.0</CODE> with its current value
  539. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  540. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  541. * </UL>
  542. * To send an inform request, the SNMP adaptor server must be active.
  543. *
  544. * @param cb The callback that is invoked when a request is complete.
  545. * @param trapOid The OID identifying the trap.
  546. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  547. *
  548. * @return A vector of {@link com.sun.jmx.snmp.daemon.SnmpInformRequest} objects.
  549. * <P>If there is no destination host for this inform request, the returned vector will be empty.
  550. *
  551. * @exception IllegalStateException This method has been invoked while the SNMP adaptor server was not active.
  552. * @exception IOException An I/O error occurred while sending the inform request.
  553. * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
  554. */
  555. public Vector snmpInformRequest(SnmpInformHandler cb, SnmpOid trapOid, SnmpVarBindList varBindList)
  556. throws IllegalStateException, IOException, SnmpStatusException;
  557. /**
  558. * Sends an inform using SNMP V2 inform request format.
  559. * <BR>The inform is sent to the specified <CODE>InetAddress</CODE> destination
  560. * using the specified community string.
  561. * <BR>The variable list included in the outgoing inform request is composed of the following items:
  562. * <UL>
  563. * <LI><CODE>sysUpTime.0</CODE> with its current value
  564. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  565. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  566. * </UL>
  567. * To send an inform request, the SNMP adaptor server must be active.
  568. *
  569. * @param address The <CODE>InetAddress</CODE> destination for this inform request.
  570. * @param cs The community string to be used for the inform request.
  571. * @param cb The callback that is invoked when a request is complete.
  572. * @param trapOid The OID identifying the trap.
  573. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  574. *
  575. * @return The inform request object.
  576. *
  577. * @exception IllegalStateException This method has been invoked while the SNMP adaptor server was not active.
  578. * @exception IOException An I/O error occurred while sending the inform request.
  579. * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
  580. */
  581. public SnmpInformRequest snmpInformRequest(InetAddress address, String cs, SnmpInformHandler cb,
  582. SnmpOid trapOid, SnmpVarBindList varBindList)
  583. throws IllegalStateException, IOException, SnmpStatusException;
  584. /**
  585. * Sends an inform using SNMP V2 inform request format.
  586. * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE> destination.
  587. * <BR> The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getInformCommunity() </CODE>).
  588. * <BR>The variable list included in the outgoing inform is composed of the following items:
  589. * <UL>
  590. * <LI><CODE>sysUpTime.0</CODE> with its current value
  591. * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
  592. * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
  593. * </UL>
  594. * To send an inform request, the SNMP adaptor server must be active.
  595. *
  596. * @param peer The <CODE>SnmpPeer</CODE> destination for this inform request.
  597. * @param cb The callback that is invoked when a request is complete.
  598. * @param trapOid The OID identifying the trap.
  599. * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
  600. *
  601. * @return The inform request object.
  602. *
  603. * @exception IllegalStateException This method has been invoked while the SNMP adaptor server was not active.
  604. * @exception IOException An I/O error occurred while sending the inform request.
  605. * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
  606. *
  607. * @since 1.5
  608. */
  609. public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
  610. SnmpInformHandler cb,
  611. SnmpOid trapOid,
  612. SnmpVarBindList varBindList) throws IllegalStateException, IOException, SnmpStatusException;
  613. }