1. /*
  2. * @(#)file SnmpEngine.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.19
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. /**
  13. * This engine is conformant with the RFC 2571. It is the main object within an SNMP entity (agent, manager...).
  14. * To an engine is associated an {@link SnmpEngineId}.
  15. * Engine instantiation is based on a factory {@link com.sun.jmx.snmp.SnmpEngineFactory SnmpEngineFactory}.
  16. * When an <CODE> SnmpEngine </CODE> is created, a User based Security Model (USM) is initialized. The security configuration is located in a text file.
  17. * The text file is read when the engine is created.
  18. * <p>Note that the engine is not used when the agent is SNMPv1/SNMPv2 only.
  19. <P> The USM configuration text file is remotely updatable using the USM Mib.</P>
  20. <P> User that are configured in the Usm text file are nonVolatile. </P>
  21. <P> Usm Mib userEntry supported storage type values are : volatile or nonVolatile only. Other values are rejected and a wrongValue is returned) </P>
  22. <ul>
  23. <li> volatile means that user entry is not flushed in security file </li>
  24. <li> nonVolatile means that user entry is flushed in security file </li>
  25. <li> If a nonVolatile row is set to be volatile, it will be not flushed in the file </li>
  26. <li>If a volatile row created from the UsmMib is set to nonVolatile, it will be flushed in the file (if the file exist and is writable otherwise an inconsistentValue is returned)</li>
  27. </ul>
  28. * <p><b>This API is a Sun Microsystems internal API and is subject
  29. * to change without notice.</b></p>
  30. * @since 1.5
  31. */
  32. public interface SnmpEngine {
  33. /**
  34. * Gets the engine time in seconds. This is the time from the last reboot.
  35. * @return The time from the last reboot.
  36. */
  37. public int getEngineTime();
  38. /**
  39. * Gets the engine Id. This is unique for each engine.
  40. * @return The engine Id object.
  41. */
  42. public SnmpEngineId getEngineId();
  43. /**
  44. * Gets the engine boot number. This is the number of time this engine has rebooted. Each time an <CODE>SnmpEngine</CODE> is instantiated, it will read this value in its Lcd, and store back the value incremented by one.
  45. * @return The engine's number of reboot.
  46. */
  47. public int getEngineBoots();
  48. /**
  49. * Gets the Usm key handler.
  50. * @return The key handler.
  51. */
  52. public SnmpUsmKeyHandler getUsmKeyHandler();
  53. }