%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
org.apache.jetspeed.security.om.impl.InternalGroupPrincipalImpl |
|
|
1 | /* |
|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 | * contributor license agreements. See the NOTICE file distributed with |
|
4 | * this work for additional information regarding copyright ownership. |
|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
6 | * (the "License"); you may not use this file except in compliance with |
|
7 | * the License. You may obtain a copy of the License at |
|
8 | * |
|
9 | * 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.om.impl; |
|
18 | ||
19 | import java.util.Collection; |
|
20 | ||
21 | import org.apache.jetspeed.security.om.InternalGroupPrincipal; |
|
22 | ||
23 | /** |
|
24 | * <p>{@link InternalGroupPrincipal} interface implementation.</p> |
|
25 | * |
|
26 | * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a> |
|
27 | */ |
|
28 | public class InternalGroupPrincipalImpl extends InternalPrincipalImpl implements InternalGroupPrincipal |
|
29 | { |
|
30 | /** The serial version uid. */ |
|
31 | private static final long serialVersionUID = -8236429453373927824L; |
|
32 | ||
33 | /** <p>Group principal security class.</p> */ |
|
34 | 0 | static String GROUP_PRINCIPAL_CLASSNAME = "org.apache.jetspeed.security.InternalGroupPrincipalImpl"; |
35 | ||
36 | /** |
|
37 | * <p>Group principal implementation default constructor.</p> |
|
38 | */ |
|
39 | public InternalGroupPrincipalImpl() |
|
40 | { |
|
41 | 0 | super(); |
42 | 0 | } |
43 | ||
44 | /** |
|
45 | * <p>Constructor to create a new group principal.</p> |
|
46 | * @param fullPath The group full path. |
|
47 | */ |
|
48 | public InternalGroupPrincipalImpl(String fullPath) |
|
49 | { |
|
50 | 0 | super(GROUP_PRINCIPAL_CLASSNAME, fullPath); |
51 | 0 | } |
52 | ||
53 | private Collection userPrincipals; |
|
54 | ||
55 | /** |
|
56 | * @see org.apache.jetspeed.security.om.InternalGroupPrincipal#getUserPrincipals() |
|
57 | */ |
|
58 | public Collection getUserPrincipals() |
|
59 | { |
|
60 | 0 | return this.userPrincipals; |
61 | } |
|
62 | ||
63 | /** |
|
64 | * @see org.apache.jetspeed.security.om.InternalGroupPrincipal#setUserPrincipals(java.util.Collection) |
|
65 | */ |
|
66 | public void setUserPrincipals(Collection userPrincipals) |
|
67 | { |
|
68 | 0 | this.userPrincipals = userPrincipals; |
69 | 0 | } |
70 | ||
71 | private Collection rolePrincipals; |
|
72 | ||
73 | /** |
|
74 | * @see org.apache.jetspeed.security.om.InternalGroupPrincipal#getRolePrincipals() |
|
75 | */ |
|
76 | public Collection getRolePrincipals() |
|
77 | { |
|
78 | 0 | return this.rolePrincipals; |
79 | } |
|
80 | ||
81 | /** |
|
82 | * @see org.apache.jetspeed.security.om.InternalGroupPrincipal#setRolePrincipals(java.util.Collection) |
|
83 | */ |
|
84 | public void setRolePrincipals(Collection rolePrincipals) |
|
85 | { |
|
86 | 0 | this.rolePrincipals = rolePrincipals; |
87 | 0 | } |
88 | ||
89 | /** |
|
90 | * <p>Compares this {@link InternalGroupPrincipal} to the provided group principal |
|
91 | * and check if they are equal.</p> |
|
92 | * return Whether the {@link InternalGroupPrincipal} are equal. |
|
93 | */ |
|
94 | public boolean equals(Object object) |
|
95 | { |
|
96 | 0 | if (!(object instanceof InternalGroupPrincipal)) |
97 | 0 | return false; |
98 | ||
99 | 0 | InternalGroupPrincipal r = (InternalGroupPrincipal) object; |
100 | 0 | boolean isEqual = (r.getFullPath().equals(this.getFullPath())); |
101 | 0 | return isEqual; |
102 | } |
|
103 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |