1. /*
  2. * @(#)file SnmpAccessControlSubSystem.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.14
  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.internal;
  12. import com.sun.jmx.snmp.SnmpStatusException;
  13. import com.sun.jmx.snmp.SnmpOid;
  14. import com.sun.jmx.snmp.SnmpPdu;
  15. import com.sun.jmx.snmp.SnmpUnknownAccContrModelException;
  16. /**
  17. * Access Control sub system interface. To allow engine integration, an Access Control sub system must implement this interface.
  18. * <p><b>This API is a Sun Microsystems internal API and is subject
  19. * to change without notice.</b></p>
  20. * @since 1.5
  21. */
  22. public interface SnmpAccessControlSubSystem extends SnmpSubSystem {
  23. /**
  24. * Method called by the dispatcher in order to control the access at an SNMP pdu Level.
  25. * <P> This call is routed by the sub system to the target model according to the SNMP protocol version number.</P>
  26. * @param version The SNMP protocol version number.
  27. * @param principal The request principal.
  28. * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
  29. * @param pduType The pdu type (get, set, ...).
  30. * @param securityModel The security model ID.
  31. * @param contextName The access control context name.
  32. * @param pdu The pdu to check.
  33. */
  34. public void checkPduAccess(int version,
  35. String principal,
  36. int securityLevel,
  37. int pduType,
  38. int securityModel,
  39. byte[] contextName,
  40. SnmpPdu pdu) throws SnmpStatusException, SnmpUnknownAccContrModelException;
  41. /**
  42. * Method called by the dispatcher in order to control the access at an <CODE>SnmpOid</CODE> Level.
  43. * This method is called after the <CODE>checkPduAccess</CODE> pdu based method.
  44. * <P> This call is routed by the sub system to the target model according to the SNMP protocol version number.</P>
  45. * @param version The SNMP protocol version number.
  46. * @param principal The request principal.
  47. * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
  48. * @param pduType The pdu type (get, set, ...).
  49. * @param securityModel The security model ID.
  50. * @param contextName The access control context name.
  51. * @param oid The OID to check.
  52. */
  53. public void checkAccess(int version,
  54. String principal,
  55. int securityLevel,
  56. int pduType,
  57. int securityModel,
  58. byte[] contextName,
  59. SnmpOid oid) throws SnmpStatusException, SnmpUnknownAccContrModelException;
  60. }