01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.container.om.common;
07:
08: import java.io.Serializable;
09: import java.util.HashSet;
10: import java.util.Iterator;
11:
12: import org.apache.pluto.om.common.SecurityRole;
13: import org.apache.pluto.om.common.SecurityRoleSet;
14:
15: /**
16: * Implementation of Apache Pluto object model.
17: * @author Ken Weiner, kweiner@unicon.net
18: * @version $Revision: 34757 $
19: */
20: public class SecurityRoleSetImpl extends HashSet implements
21: SecurityRoleSet, Serializable {
22:
23: // SecurityRoleSet methods
24:
25: public SecurityRole get(String name) {
26: SecurityRole securityRole = null;
27: Iterator iterator = this .iterator();
28: while (iterator.hasNext()) {
29: SecurityRole securityRoleCandidate = (SecurityRole) iterator
30: .next();
31: if (securityRoleCandidate.getRoleName().equals(name)) {
32: securityRole = securityRoleCandidate;
33: }
34: }
35: return securityRole;
36: }
37:
38: // Additional methods
39:
40: public void add(SecurityRole securityRole) {
41: super.add(securityRole);
42: }
43:
44: }
|