KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > UserAcl


1 /*
2  * @(#)file UserAcl.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.11
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
12 package com.sun.jmx.snmp;
13
14
15 // java import
16
//
17
import java.util.Enumeration JavaDoc;
18 import java.net.InetAddress JavaDoc;
19
20 /**
21  * Defines the user based ACL used by the SNMP protocol adaptor.
22  * <p>
23  * <p><b>This API is a Sun Microsystems internal API and is subject
24  * to change without notice.</b></p>
25  * @since 1.5
26  */

27
28 public interface UserAcl {
29
30     /**
31      * Returns the name of the ACL.
32      *
33      * @return The name of the ACL.
34      */

35     public String JavaDoc getName();
36
37     /**
38      * Checks whether or not the specified user has <CODE>READ</CODE> access.
39      *
40      * @param user The user name to check.
41      *
42      * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
43      */

44     public boolean checkReadPermission(String JavaDoc user);
45
46     /**
47      * Checks whether or not the specified user and context name have <CODE>READ</CODE> access.
48      *
49      * @param user The user name to check.
50      * @param contextName The context name associated with the user.
51      * @param securityLevel The request security level.
52      * @return <CODE>true</CODE> if the pair (user, context) has read permission, <CODE>false</CODE> otherwise.
53      */

54     public boolean checkReadPermission(String JavaDoc user, String JavaDoc contextName, int securityLevel);
55
56     /**
57      * Checks whether or not a context name is defined.
58      *
59      * @param contextName The context name to check.
60      *
61      * @return <CODE>true</CODE> if the context is known, <CODE>false</CODE> otherwise.
62      */

63     public boolean checkContextName(String JavaDoc contextName);
64
65     /**
66      * Checks whether or not the specified user has <CODE>WRITE</CODE> access.
67      *
68      * @param user The user to check.
69      *
70      * @return <CODE>true</CODE> if the user has write permission, <CODE>false</CODE> otherwise.
71      */

72     public boolean checkWritePermission(String JavaDoc user);
73
74     /**
75      * Checks whether or not the specified user and context name have <CODE>WRITE</CODE> access.
76      *
77      * @param user The user name to check.
78      * @param contextName The context name associated with the user.
79      * @param securityLevel The request security level.
80      * @return <CODE>true</CODE> if the pair (user, context) has write permission, <CODE>false</CODE> otherwise.
81      */

82     public boolean checkWritePermission(String JavaDoc user, String JavaDoc contextName, int securityLevel);
83 }
84
Popular Tags