1. /*
  2. * @(#)file UserAcl.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.11
  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.util.Enumeration;
  15. import java.net.InetAddress;
  16. /**
  17. * Defines the user 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 UserAcl {
  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 user has <CODE>READ</CODE> access.
  32. *
  33. * @param user The user name to check.
  34. *
  35. * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
  36. */
  37. public boolean checkReadPermission(String user);
  38. /**
  39. * Checks whether or not the specified user and context name have <CODE>READ</CODE> access.
  40. *
  41. * @param user The user name to check.
  42. * @param contextName The context name associated with the user.
  43. * @param securityLevel The request security level.
  44. * @return <CODE>true</CODE> if the pair (user, context) has read permission, <CODE>false</CODE> otherwise.
  45. */
  46. public boolean checkReadPermission(String user, String contextName, int securityLevel);
  47. /**
  48. * Checks whether or not a context name is defined.
  49. *
  50. * @param contextName The context name to check.
  51. *
  52. * @return <CODE>true</CODE> if the context is known, <CODE>false</CODE> otherwise.
  53. */
  54. public boolean checkContextName(String contextName);
  55. /**
  56. * Checks whether or not the specified user has <CODE>WRITE</CODE> access.
  57. *
  58. * @param user The user to check.
  59. *
  60. * @return <CODE>true</CODE> if the user has write permission, <CODE>false</CODE> otherwise.
  61. */
  62. public boolean checkWritePermission(String user);
  63. /**
  64. * Checks whether or not the specified user and context name have <CODE>WRITE</CODE> access.
  65. *
  66. * @param user The user name to check.
  67. * @param contextName The context name associated with the user.
  68. * @param securityLevel The request security level.
  69. * @return <CODE>true</CODE> if the pair (user, context) has write permission, <CODE>false</CODE> otherwise.
  70. */
  71. public boolean checkWritePermission(String user, String contextName, int securityLevel);
  72. }