KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > mail > imap > ACL


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21
22 /*
23  * @(#)ACL.java 1.4 05/08/29
24  *
25  * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
26  */

27
28 package com.sun.mail.imap;
29
30 import java.util.*;
31
32 /**
33  * An access control list entry for a particular authentication identifier
34  * (user or group). Associates a set of Rights with the identifier.
35  * See RFC 2086.
36  * <p>
37  *
38  * @author Bill Shannon
39  */

40
41 public class ACL implements Cloneable JavaDoc {
42
43     private String JavaDoc name;
44     private Rights rights;
45
46     /**
47      * Construct an ACL entry for the given identifier and with no rights.
48      *
49      * @param name the identifier name
50      */

51     public ACL(String JavaDoc name) {
52     this.name = name;
53     this.rights = new Rights();
54     }
55
56     /**
57      * Construct an ACL entry for the given identifier with the given rights.
58      *
59      * @param name the identifier name
60      * @param rights the rights
61      */

62     public ACL(String JavaDoc name, Rights rights) {
63     this.name = name;
64     this.rights = rights;
65     }
66
67     /**
68      * Get the identifier name for this ACL entry.
69      *
70      * @return the identifier name
71      */

72     public String JavaDoc getName() {
73     return name;
74     }
75
76     /**
77      * Set the rights associated with this ACL entry.
78      *
79      * @param rights the rights
80      */

81     public void setRights(Rights rights) {
82     this.rights = rights;
83     }
84
85     /**
86      * Get the rights associated with this ACL entry.
87      * Returns the actual Rights object referenced by this ACL;
88      * modifications to the Rights object will effect this ACL.
89      *
90      * @return the rights
91      */

92     public Rights getRights() {
93     return rights;
94     }
95
96     /**
97      * Clone this ACL entry.
98      */

99     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
100     ACL acl = (ACL)super.clone();
101     acl.rights = (Rights)this.rights.clone();
102     return acl;
103     }
104 }
105
Popular Tags