01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.repository.helpers;
18:
19: import java.util.Set;
20:
21: /**
22: * A Principal class to be used with a repository implementation.
23: */
24: public class Principal {
25:
26: private String name;
27: private String group;
28: private Set roles;
29:
30: /**
31: * creates a Principal
32: *
33: * @param name the name of the principal.
34: * @param group the group of the principal.
35: * @param roles a Set containing the roles of the principal
36: */
37: public Principal(String name, String group, Set roles) {
38: this .name = name;
39: this .group = group;
40: this .roles = roles;
41: }
42:
43: /**
44: * get the name of the principal
45: *
46: * @return the name of the principal.
47: */
48: public String getName() {
49: return this .name;
50: }
51:
52: /**
53: * get the group name of the principal
54: *
55: * @return the group name of the principal.
56: */
57: public String getGroup() {
58: return this .group;
59: }
60:
61: /**
62: * get the roles of the principal
63: *
64: * @return A Set containing the roles of the principal.
65: */
66: public Set getRoles() {
67: return this.roles;
68: }
69:
70: }
|