1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.Role;
23
24 /***
25 * <p>A role made of a {@link Principal} and the user {@link Preferences}.</p>
26 * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
27 */
28 public class RoleImpl implements Role
29 {
30
31 /***
32 * <p>Default constructor.</p>
33 */
34 public RoleImpl()
35 {
36 }
37
38 /***
39 * <p>{@link Role} constructor given a role principal and preferences.</p>
40 * @param rolePrincipal The role principal.
41 * @param preferences The preferences.
42 */
43 public RoleImpl(Principal rolePrincipal, Preferences preferences)
44 {
45 this.rolePrincipal = rolePrincipal;
46 this.preferences = preferences;
47 }
48
49 private Principal rolePrincipal;
50
51 /***
52 * @see org.apache.jetspeed.security.Role#getPrincipal()
53 */
54 public Principal getPrincipal()
55 {
56 return this.rolePrincipal;
57 }
58
59 /***
60 * @see org.apache.jetspeed.security.Role#setPrincipal(java.security.Principal)
61 */
62 public void setPrincipal(Principal rolePrincipal)
63 {
64 this.rolePrincipal = rolePrincipal;
65 }
66
67 private Preferences preferences;
68
69 /***
70 * @see org.apache.jetspeed.security.Role#getPreferences()
71 */
72 public Preferences getPreferences()
73 {
74 return this.preferences;
75 }
76
77 /***
78 * @see org.apache.jetspeed.security.Role#setPreferences(java.util.prefs.Preferences)
79 */
80 public void setPreferences(Preferences preferences)
81 {
82 this.preferences = preferences;
83 }
84
85 }