KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > repository > helpers > Principal


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.repository.helpers;
17
18 import java.util.Set JavaDoc;
19
20 /**
21  * A Principal class to be used with a repository implementation.
22  */

23 public class Principal {
24     
25     private String JavaDoc name;
26     private String JavaDoc group;
27     private Set JavaDoc roles;
28     
29     /**
30      * creates a Principal
31      *
32      * @param name the name of the principal.
33      * @param group the group of the principal.
34      * @param roles a Set containing the roles of the principal
35      */

36     public Principal(String JavaDoc name, String JavaDoc group, Set JavaDoc roles) {
37         this.name = name;
38         this.group = group;
39         this.roles = roles;
40     }
41
42     /**
43      * get the name of the principal
44      *
45      * @return the name of the principal.
46      */

47     public String JavaDoc getName() {
48         return this.name;
49     }
50
51     /**
52      * get the group name of the principal
53      *
54      * @return the group name of the principal.
55      */

56     public String JavaDoc getGroup() {
57         return this.group;
58     }
59
60     /**
61      * get the roles of the principal
62      *
63      * @return A Set containing the roles of the principal.
64      */

65     public Set JavaDoc getRoles() {
66         return this.roles;
67     }
68
69 }
Popular Tags