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.om.impl;
1819import java.util.Collection;
2021import org.apache.jetspeed.security.om.InternalRolePrincipal;
2223/***24 * <p>{@link InternalRolePrincipal} interface implementation.</p>25 * 26 * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>27 */28publicclassInternalRolePrincipalImplextendsInternalPrincipalImpl implements InternalRolePrincipal
29 {
30/*** The serial version uid. */31privatestaticfinallong serialVersionUID = 4422827842052325846L;
3233/*** <p>Role principal security class.</p> */34static String ROLE_PRINCIPAL_CLASSNAME = "org.apache.jetspeed.security.InternalRolePrincipalImpl";
3536/***37 * <p>Role principal implementation default constructor.</p>38 */39publicInternalRolePrincipalImpl()
40 {
41super();
42 }
4344/***45 * <p>Constructor to create a new role principal.</p>46 * @param fullPath The role full path.47 */48publicInternalRolePrincipalImpl(String fullPath)
49 {
50super(ROLE_PRINCIPAL_CLASSNAME, fullPath);
51 }
5253private Collection userPrincipals;
5455/***56 * @see org.apache.jetspeed.security.om.InternalRolePrincipal#getUserPrincipals()57 */58public Collection getUserPrincipals()
59 {
60returnthis.userPrincipals;
61 }
6263/***64 * @see org.apache.jetspeed.security.om.InternalRolePrincipal#setUserPrincipals(java.util.Collection)65 */66publicvoid setUserPrincipals(Collection userPrincipals)
67 {
68this.userPrincipals = userPrincipals;
69 }
7071private Collection groupPrincipals;
7273/***74 * @see org.apache.jetspeed.security.om.InternalRolePrincipal#getGroupPrincipals()75 */76public Collection getGroupPrincipals()
77 {
78returnthis.groupPrincipals;
79 }
8081/***82 * @see org.apache.jetspeed.security.om.InternalRolePrincipal#setGroupPrincipals(java.util.Collection)83 */84publicvoid setGroupPrincipals(Collection groupPrincipals)
85 {
86this.groupPrincipals = groupPrincipals;
87 }
8889/***90 * <p>Compares this {@link InternalRolePrincipal} to the provided role principal91 * and check if they are equal.</p>92 * return Whether the {@link InternalRolePrincipal} are equal.93 */94publicboolean equals(Object object)
95 {
96if (!(object instanceof InternalRolePrincipal))
97return false;
9899 InternalRolePrincipal r = (InternalRolePrincipal) object;
100boolean isEqual = (r.getFullPath().equals(this.getFullPath()));
101return isEqual;
102 }
103104 }