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.jetspeed.security.impl;
18:
19: import java.security.Principal;
20: import java.util.prefs.Preferences;
21:
22: import org.apache.jetspeed.security.Group;
23:
24: /**
25: * <p>A group made of a {@link org.apache.jetspeed.security.GroupPrincipal} and the user {@link Preferences}.</p>
26: * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
27: */
28: public class GroupImpl implements Group {
29: /**
30: * <p>Default constructor.</p>
31: */
32: public GroupImpl() {
33: }
34:
35: /**
36: * <p>{@link Group} constructor given a group principal and preferences.</p>
37: * @param groupPrincipal The group principal.
38: * @param preferences The preferences.
39: */
40: public GroupImpl(Principal groupPrincipal, Preferences preferences) {
41: this .groupPrincipal = groupPrincipal;
42: this .preferences = preferences;
43: }
44:
45: private Principal groupPrincipal;
46:
47: /**
48: * @see org.apache.jetspeed.security.Group#getPrincipal()
49: */
50: public Principal getPrincipal() {
51: return this .groupPrincipal;
52: }
53:
54: /**
55: * @see org.apache.jetspeed.security.Group#setPrincipal(java.security.Principal)
56: */
57: public void setPrincipal(Principal groupPrincipal) {
58: this .groupPrincipal = groupPrincipal;
59: }
60:
61: private Preferences preferences;
62:
63: /**
64: * @see org.apache.jetspeed.security.Group#getPreferences()
65: */
66: public Preferences getPreferences() {
67: return this .preferences;
68: }
69:
70: /**
71: * @see org.apache.jetspeed.security.Group#setPreferences(java.util.prefs.Preferences)
72: */
73: public void setPreferences(Preferences preferences) {
74: this.preferences = preferences;
75: }
76:
77: }
|