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.SecurityRoleRef;
13: import org.apache.pluto.om.common.SecurityRoleRefSet;
14: import org.apache.pluto.om.common.SecurityRoleRefSetCtrl;
15:
16: /**
17: * Implementation of Apache Pluto object model.
18: * @author Ken Weiner, kweiner@unicon.net
19: * @version $Revision: 34757 $
20: */
21: public class SecurityRoleRefSetImpl extends HashSet implements
22: SecurityRoleRefSet, SecurityRoleRefSetCtrl, Serializable {
23:
24: // SecurityRoleRefSet methods
25:
26: public SecurityRoleRef get(String name) {
27: SecurityRoleRef securityRoleRef = null;
28: Iterator iterator = iterator();
29: while (iterator.hasNext()) {
30: SecurityRoleRef securityRoleRefCandidate = (SecurityRoleRef) iterator
31: .next();
32: if (securityRoleRefCandidate.getRoleName().equals(name)) {
33: securityRoleRef = securityRoleRefCandidate;
34: }
35: }
36: return securityRoleRef;
37: }
38:
39: // SecurityRoleRefSetCtrl methods
40:
41: public SecurityRoleRef add(SecurityRoleRef securityRoleRef) {
42: super .add(securityRoleRef);
43: return securityRoleRef;
44: }
45:
46: public void remove(SecurityRoleRef securityRoleRef) {
47: super .remove(securityRoleRef);
48: }
49:
50: public SecurityRoleRef remove(String name) {
51: SecurityRoleRef securityRoleRef = this.get(name);
52: return securityRoleRef;
53: }
54:
55: }
|