KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > internal > SnmpAccessControlModel


1 /*
2  * @(#)file SnmpAccessControlModel.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.14
5  * @(#)date 08/02/09
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
13 import com.sun.jmx.snmp.SnmpStatusException;
14 import com.sun.jmx.snmp.SnmpOid;
15 import com.sun.jmx.snmp.SnmpPdu;
16 /**
17  * Access Control Model interface. Every access control model must implement this interface in order to be integrated in the engine based framework.
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 SnmpAccessControlModel extends SnmpModel {
23     /**
24      * Method called by the dispatcher in order to control the access at an <CODE>SnmpOid</CODE> Level. If access is not allowed, an <CODE>SnmpStatusException</CODE> is thrown.
25      * This method is called after the <CODE>checkPduAccess</CODE> pdu based method.
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 oid The OID to check.
33      */

34     public void checkAccess(int version,
35                 String JavaDoc principal,
36                 int securityLevel,
37                 int pduType,
38                 int securityModel,
39                 byte[] contextName,
40                 SnmpOid oid)
41     throws SnmpStatusException;
42     /**
43      * Method called by the dispatcher in order to control the access at an SNMP pdu Level. If access is not allowed, an <CODE>SnmpStatusException</CODE> is thrown. In case of exception, the access control is aborted. OIDs are not checked.
44      * This method should be called prior to the <CODE>checkAccess</CODE> OID based method.
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 pdu The pdu to check.
52      */

53     public void checkPduAccess(int version,
54                    String JavaDoc principal,
55                    int securityLevel,
56                    int pduType,
57                    int securityModel,
58                    byte[] contextName,
59                    SnmpPdu pdu)
60     throws SnmpStatusException;
61
62     /**
63      * Enable SNMP V1 and V2 set requests. Be aware that can lead to a security hole in a context of SNMP V3 management. By default SNMP V1 and V2 set requests are not authorized.
64      * @return boolean True the activation suceeded.
65      */

66     public boolean enableSnmpV1V2SetRequest();
67     /**
68      * Disable SNMP V1 and V2 set requests. By default SNMP V1 and V2 set requests are not authorized.
69      * @return boolean True the deactivation suceeded.
70      */

71     public boolean disableSnmpV1V2SetRequest();
72     
73     /**
74      * The SNMP V1 and V2 set requests authorization status. By default SNMP V1 and V2 set requests are not authorized.
75      * @return boolean True SNMP V1 and V2 requests are authorized.
76      */

77     public boolean isSnmpV1V2SetRequestAuthorized();
78 }
79
Popular Tags