001: /*
002: * Copyright 2001-2006 C:1 Financial Services GmbH
003: *
004: * This software is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License Version 2.1, as published by the Free Software Foundation.
007: *
008: * This software is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011: * Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public
014: * License along with this library; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
016: */
017:
018: package de.finix.contelligent.xml.elements;
019:
020: import java.util.ArrayList;
021: import java.util.Collection;
022: import java.util.List;
023:
024: public class SecurityElement {
025:
026: // mandatory for main server, optional for child servers:
027: List userGroups = new ArrayList();
028:
029: List roleGroups = new ArrayList();
030:
031: List guestRoles = new ArrayList();
032:
033: List policyElements = new ArrayList();
034:
035: PrincipalElement defaultOwnerElement;
036:
037: PrincipalElement initialUserElement;
038:
039: ACLElement aclElement;
040:
041: PrincipalElement rootPrincipal;
042:
043: String rootEmail;
044:
045: private boolean secureClient = false;
046:
047: private boolean allowPush = true;
048:
049: public void addGuestRole(String roleId, String groupId) {
050: guestRoles.add(new PrincipalElement(roleId, groupId));
051: }
052:
053: public Collection getGuestRoles() {
054: return guestRoles;
055: }
056:
057: public void setDefaultOwner(String userId, String groupId) {
058: this .defaultOwnerElement = new PrincipalElement(userId, groupId);
059: }
060:
061: public PrincipalElement getDefaultOwnerElement() {
062: return defaultOwnerElement;
063: }
064:
065: public void addRoleGroup(RoleGroupElement config) {
066: roleGroups.add(config);
067: }
068:
069: public void addUserGroup(UserGroupElement config) {
070: userGroups.add(config);
071: }
072:
073: public List getUserGroups() {
074: return userGroups;
075: }
076:
077: public List getRoleGroups() {
078: return roleGroups;
079: }
080:
081: public void setACLElement(ACLElement aclElement) {
082: this .aclElement = aclElement;
083: }
084:
085: public ACLElement getACLElement() {
086: return aclElement;
087: }
088:
089: public String getRootEmail() {
090: return rootEmail;
091: }
092:
093: public void setRootEmail(String rootEmail) {
094: this .rootEmail = rootEmail;
095: }
096:
097: public void setRootPrincipal(String principalId, String groupId) {
098: rootPrincipal = new PrincipalElement(principalId, groupId);
099: }
100:
101: public PrincipalElement getRootPrincipal() {
102: return rootPrincipal;
103: }
104:
105: public boolean isSecureClient() {
106: return secureClient;
107: }
108:
109: public boolean isAllowPush() {
110: return allowPush;
111: }
112:
113: public void setClientConfig(String secureClient, String allowPush) {
114: this .secureClient = Boolean.valueOf(secureClient)
115: .booleanValue();
116: this .allowPush = Boolean.valueOf(allowPush).booleanValue();
117: }
118:
119: public List getPolicyElements() {
120: return policyElements;
121: }
122:
123: public void addPolicyElement(PolicyElement element) {
124: policyElements.add(element);
125: }
126: }
|