1. /*
  2. * @(#)file InetAddressAcl.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.9
  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. // java import
  13. //
  14. import java.net.InetAddress;
  15. import java.util.Enumeration;
  16. /**
  17. * Defines the IP address based ACL used by the SNMP protocol adaptor.
  18. * <p>
  19. * <p><b>This API is a Sun Microsystems internal API and is subject
  20. * to change without notice.</b></p>
  21. * @since 1.5
  22. */
  23. public interface InetAddressAcl {
  24. /**
  25. * Returns the name of the ACL.
  26. *
  27. * @return The name of the ACL.
  28. */
  29. public String getName();
  30. /**
  31. * Checks whether or not the specified host has <CODE>READ</CODE> access.
  32. *
  33. * @param address The host address to check.
  34. *
  35. * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
  36. */
  37. public boolean checkReadPermission(InetAddress address);
  38. /**
  39. * Checks whether or not the specified host and community have <CODE>READ</CODE> access.
  40. *
  41. * @param address The host address to check.
  42. * @param community The community associated with the host.
  43. *
  44. * @return <CODE>true</CODE> if the pair (host, community) has read permission, <CODE>false</CODE> otherwise.
  45. */
  46. public boolean checkReadPermission(InetAddress address, String community);
  47. /**
  48. * Checks whether or not a community string is defined.
  49. *
  50. * @param community The community to check.
  51. *
  52. * @return <CODE>true</CODE> if the community is known, <CODE>false</CODE> otherwise.
  53. */
  54. public boolean checkCommunity(String community);
  55. /**
  56. * Checks whether or not the specified host has <CODE>WRITE</CODE> access.
  57. *
  58. * @param address The host address to check.
  59. *
  60. * @return <CODE>true</CODE> if the host has write permission, <CODE>false</CODE> otherwise.
  61. */
  62. public boolean checkWritePermission(InetAddress address);
  63. /**
  64. * Checks whether or not the specified host and community have <CODE>WRITE</CODE> access.
  65. *
  66. * @param address The host address to check.
  67. * @param community The community associated with the host.
  68. *
  69. * @return <CODE>true</CODE> if the pair (host, community) has write permission, <CODE>false</CODE> otherwise.
  70. */
  71. public boolean checkWritePermission(InetAddress address, String community);
  72. /**
  73. * Returns an enumeration of trap destinations.
  74. *
  75. * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress<CODE>).
  76. */
  77. public Enumeration getTrapDestinations();
  78. /**
  79. * Returns an enumeration of trap communities for a given host.
  80. *
  81. * @param address The address of the host.
  82. *
  83. * @return An enumeration of trap communities for a given host (enumeration of <CODE>String<CODE>).
  84. */
  85. public Enumeration getTrapCommunities(InetAddress address);
  86. /**
  87. * Returns an enumeration of inform destinations.
  88. *
  89. * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress<CODE>).
  90. */
  91. public Enumeration getInformDestinations();
  92. /**
  93. * Returns an enumeration of inform communities for a given host.
  94. *
  95. * @param address The address of the host.
  96. *
  97. * @return An enumeration of inform communities for a given host (enumeration of <CODE>String<CODE>).
  98. */
  99. public Enumeration getInformCommunities(InetAddress address);
  100. }