1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * 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 and15 * limitations under the License.16 */17packageorg.apache.jetspeed.security.impl;
1819import java.security.Principal;
20import java.util.prefs.Preferences;
2122import org.apache.jetspeed.security.Role;
2324/***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 */28publicclassRoleImpl implements Role
29 {
3031/***32 * <p>Default constructor.</p>33 */34publicRoleImpl()
35 {
36 }
3738/***39 * <p>{@link Role} constructor given a role principal and preferences.</p>40 * @param rolePrincipal The role principal.41 * @param preferences The preferences.42 */43publicRoleImpl(Principal rolePrincipal, Preferences preferences)
44 {
45this.rolePrincipal = rolePrincipal;
46this.preferences = preferences;
47 }
4849private Principal rolePrincipal;
5051/***52 * @see org.apache.jetspeed.security.Role#getPrincipal()53 */54public Principal getPrincipal()
55 {
56returnthis.rolePrincipal;
57 }
5859/***60 * @see org.apache.jetspeed.security.Role#setPrincipal(java.security.Principal)61 */62publicvoid setPrincipal(Principal rolePrincipal)
63 {
64this.rolePrincipal = rolePrincipal;
65 }
6667private Preferences preferences;
6869/***70 * @see org.apache.jetspeed.security.Role#getPreferences()71 */72public Preferences getPreferences()
73 {
74returnthis.preferences;
75 }
7677/***78 * @see org.apache.jetspeed.security.Role#setPreferences(java.util.prefs.Preferences)79 */80publicvoid setPreferences(Preferences preferences)
81 {
82this.preferences = preferences;
83 }
8485 }