KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > deliver > portal > om > SecurityRoleSetImpl


1 /* ===============================================================================
2 *
3 * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4 *
5 * ===============================================================================
6 *
7 * Copyright (C)
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 2, as published by the
11 * Free Software Foundation. See the file LICENSE.html for more information.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19 * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20 *
21 * ===============================================================================
22 */

23 package org.infoglue.deliver.portal.om;
24
25 import java.util.Collection JavaDoc;
26 import java.util.Iterator JavaDoc;
27 import java.util.Vector JavaDoc;
28
29 import org.apache.pluto.om.common.SecurityRole;
30 import org.apache.pluto.om.common.SecurityRoleSet;
31
32 /**
33  * Dummy implementation of interface
34  * @author Jöran
35  * TODO Implement this
36  *
37  */

38 public class SecurityRoleSetImpl implements SecurityRoleSet {
39     private Vector JavaDoc roles = new Vector JavaDoc();
40     /* (non-Javadoc)
41      * @see org.apache.pluto.om.common.SecurityRoleSet#get(java.lang.String)
42      */

43     public SecurityRole get(String JavaDoc name) {
44         for(Iterator JavaDoc iter = roles.iterator(); iter.hasNext();){
45             Object JavaDoc o = iter.next();
46             if(o instanceof SecurityRole){
47                 SecurityRole role= (SecurityRole)o;
48                 if(role.getRoleName().equals(name)){
49                     return role;
50                 }
51             }
52         }
53         return null;
54     }
55
56     /* (non-Javadoc)
57      * @see java.util.Collection#size()
58      */

59     public int size() {
60         return roles.size();
61     }
62
63     /* (non-Javadoc)
64      * @see java.util.Collection#clear()
65      */

66     public void clear() {
67         roles.clear();
68     }
69
70     /* (non-Javadoc)
71      * @see java.util.Collection#isEmpty()
72      */

73     public boolean isEmpty() {
74         return roles.isEmpty();
75     }
76
77     /* (non-Javadoc)
78      * @see java.util.Collection#toArray()
79      */

80     public Object JavaDoc[] toArray() {
81         return roles.toArray();
82     }
83
84     /* (non-Javadoc)
85      * @see java.util.Collection#add(java.lang.Object)
86      */

87     public boolean add(Object JavaDoc arg0) {
88         return roles.add(arg0);
89     }
90
91     /* (non-Javadoc)
92      * @see java.util.Collection#contains(java.lang.Object)
93      */

94     public boolean contains(Object JavaDoc arg0) {
95         return roles.contains(arg0);
96     }
97
98     /* (non-Javadoc)
99      * @see java.util.Collection#remove(java.lang.Object)
100      */

101     public boolean remove(Object JavaDoc arg0) {
102         return roles.remove(arg0);
103     }
104
105     /* (non-Javadoc)
106      * @see java.util.Collection#addAll(java.util.Collection)
107      */

108     public boolean addAll(Collection JavaDoc arg0) {
109         return roles.addAll(arg0);
110     }
111
112     /* (non-Javadoc)
113      * @see java.util.Collection#containsAll(java.util.Collection)
114      */

115     public boolean containsAll(Collection JavaDoc arg0) {
116         return roles.containsAll(arg0);
117     }
118
119     /* (non-Javadoc)
120      * @see java.util.Collection#removeAll(java.util.Collection)
121      */

122     public boolean removeAll(Collection JavaDoc arg0) {
123         return roles.removeAll(arg0);
124     }
125
126     /* (non-Javadoc)
127      * @see java.util.Collection#retainAll(java.util.Collection)
128      */

129     public boolean retainAll(Collection JavaDoc arg0) {
130         return roles.retainAll(arg0);
131     }
132
133     /* (non-Javadoc)
134      * @see java.util.Collection#iterator()
135      */

136     public Iterator JavaDoc iterator() {
137         return roles.iterator();
138     }
139
140     /* (non-Javadoc)
141      * @see java.util.Collection#toArray(java.lang.Object[])
142      */

143     public Object JavaDoc[] toArray(Object JavaDoc[] arg0) {
144         return roles.toArray(arg0);
145     }
146
147 }
148
Popular Tags