001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.sec.businessobject;
017
018 import java.util.LinkedHashMap;
019 import java.util.List;
020
021 import org.kuali.kfs.sys.KFSPropertyConstants;
022 import org.kuali.rice.kns.bo.Inactivateable;
023 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
024 import org.kuali.rice.kns.util.KualiInteger;
025 import org.kuali.rice.kns.util.TypedArrayList;
026
027 /**
028 * Represents the assignment of one or more definitions to one or more members (principal, group, or role). A model becomes a role in KIM
029 */
030 public class SecurityModel extends PersistableBusinessObjectBase implements Inactivateable {
031 private KualiInteger id;
032 private String name;
033 private String description;
034 private String roleId;
035 private boolean active;
036
037 private List<SecurityModelDefinition> modelDefinitions;
038 private List<SecurityModelMember> modelMembers;
039
040 public SecurityModel() {
041 super();
042
043 modelDefinitions = new TypedArrayList(SecurityModelDefinition.class);
044 modelMembers = new TypedArrayList(SecurityModelMember.class);
045 }
046
047
048 /**
049 * Gets the id attribute.
050 *
051 * @return Returns the id.
052 */
053 public KualiInteger getId() {
054 return id;
055 }
056
057
058 /**
059 * Sets the id attribute value.
060 *
061 * @param id The id to set.
062 */
063 public void setId(KualiInteger id) {
064 this.id = id;
065 }
066
067
068 /**
069 * Gets the name attribute.
070 *
071 * @return Returns the name.
072 */
073 public String getName() {
074 return name;
075 }
076
077
078 /**
079 * Sets the name attribute value.
080 *
081 * @param name The name to set.
082 */
083 public void setName(String name) {
084 this.name = name;
085 }
086
087
088 /**
089 * Gets the description attribute.
090 *
091 * @return Returns the description.
092 */
093 public String getDescription() {
094 return description;
095 }
096
097
098 /**
099 * Sets the description attribute value.
100 *
101 * @param description The description to set.
102 */
103 public void setDescription(String description) {
104 this.description = description;
105 }
106
107
108 /**
109 * Gets the roleId attribute.
110 *
111 * @return Returns the roleId.
112 */
113 public String getRoleId() {
114 return roleId;
115 }
116
117
118 /**
119 * Sets the roleId attribute value.
120 *
121 * @param roleId The roleId to set.
122 */
123 public void setRoleId(String roleId) {
124 this.roleId = roleId;
125 }
126
127
128 /**
129 * Gets the active attribute.
130 *
131 * @return Returns the active.
132 */
133 public boolean isActive() {
134 return active;
135 }
136
137
138 /**
139 * Sets the active attribute value.
140 *
141 * @param active The active to set.
142 */
143 public void setActive(boolean active) {
144 this.active = active;
145 }
146
147
148 /**
149 * Gets the modelDefinitions attribute.
150 *
151 * @return Returns the modelDefinitions.
152 */
153 public List<SecurityModelDefinition> getModelDefinitions() {
154 return modelDefinitions;
155 }
156
157
158 /**
159 * Sets the modelDefinitions attribute value.
160 *
161 * @param modelDefinitions The modelDefinitions to set.
162 */
163 public void setModelDefinitions(List<SecurityModelDefinition> modelDefinitions) {
164 this.modelDefinitions = modelDefinitions;
165 }
166
167
168 /**
169 * Gets the modelMembers attribute.
170 *
171 * @return Returns the modelMembers.
172 */
173 public List<SecurityModelMember> getModelMembers() {
174 return modelMembers;
175 }
176
177
178 /**
179 * Sets the modelMembers attribute value.
180 *
181 * @param modelMembers The modelMembers to set.
182 */
183 public void setModelMembers(List<SecurityModelMember> modelMembers) {
184 this.modelMembers = modelMembers;
185 }
186
187 /**
188 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
189 */
190 @Override
191 protected LinkedHashMap toStringMapper() {
192 LinkedHashMap m = new LinkedHashMap();
193
194 m.put(KFSPropertyConstants.ID, this.id);
195
196 return m;
197 }
198
199 }