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
020 import org.kuali.kfs.sec.SecPropertyConstants;
021 import org.kuali.rice.kns.bo.Inactivateable;
022 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
023
024
025 /**
026 * Represents a member who can be assigned to a model. Can be of Person, Role, or Group type
027 */
028 public class ModelMember extends PersistableBusinessObjectBase implements Inactivateable {
029 private String memberId;
030 private String memberName;
031 private String memberTypeCode;
032 private boolean active;
033
034 // person fields
035 private String principalId;
036 private String principalName;
037 private String entityId;
038 private String firstName = "";
039 private String middleName = "";
040 private String lastName = "";
041 private String emailAddress = "";
042 private String employeeId = "";
043
044 // role fields
045 private String roleId;
046 private String roleName;
047 private String namespaceCode; // part of group fields as well
048
049 // group fields
050 private String groupId;
051 private String groupName;
052
053 public ModelMember() {
054 super();
055 }
056
057
058 /**
059 * Gets the memberId attribute.
060 *
061 * @return Returns the memberId.
062 */
063 public String getMemberId() {
064 return memberId;
065 }
066
067
068 /**
069 * Sets the memberId attribute value.
070 *
071 * @param memberId The memberId to set.
072 */
073 public void setMemberId(String memberId) {
074 this.memberId = memberId;
075 }
076
077
078 /**
079 * Gets the memberName attribute.
080 *
081 * @return Returns the memberName.
082 */
083 public String getMemberName() {
084 return memberName;
085 }
086
087
088 /**
089 * Sets the memberName attribute value.
090 *
091 * @param memberName The memberName to set.
092 */
093 public void setMemberName(String memberName) {
094 this.memberName = memberName;
095 }
096
097
098 /**
099 * Gets the memberTypeCode attribute.
100 *
101 * @return Returns the memberTypeCode.
102 */
103 public String getMemberTypeCode() {
104 return memberTypeCode;
105 }
106
107
108 /**
109 * Sets the memberTypeCode attribute value.
110 *
111 * @param memberTypeCode The memberTypeCode to set.
112 */
113 public void setMemberTypeCode(String memberTypeCode) {
114 this.memberTypeCode = memberTypeCode;
115 }
116
117
118 /**
119 * Gets the active attribute.
120 *
121 * @return Returns the active.
122 */
123 public boolean isActive() {
124 return active;
125 }
126
127
128 /**
129 * Sets the active attribute value.
130 *
131 * @param active The active to set.
132 */
133 public void setActive(boolean active) {
134 this.active = active;
135 }
136
137
138 /**
139 * Gets the principalId attribute.
140 *
141 * @return Returns the principalId.
142 */
143 public String getPrincipalId() {
144 return principalId;
145 }
146
147
148 /**
149 * Sets the principalId attribute value.
150 *
151 * @param principalId The principalId to set.
152 */
153 public void setPrincipalId(String principalId) {
154 this.principalId = principalId;
155 }
156
157
158 /**
159 * Gets the principalName attribute.
160 *
161 * @return Returns the principalName.
162 */
163 public String getPrincipalName() {
164 return principalName;
165 }
166
167
168 /**
169 * Sets the principalName attribute value.
170 *
171 * @param principalName The principalName to set.
172 */
173 public void setPrincipalName(String principalName) {
174 this.principalName = principalName;
175 }
176
177
178 /**
179 * Gets the entityId attribute.
180 *
181 * @return Returns the entityId.
182 */
183 public String getEntityId() {
184 return entityId;
185 }
186
187
188 /**
189 * Sets the entityId attribute value.
190 *
191 * @param entityId The entityId to set.
192 */
193 public void setEntityId(String entityId) {
194 this.entityId = entityId;
195 }
196
197
198 /**
199 * Gets the firstName attribute.
200 *
201 * @return Returns the firstName.
202 */
203 public String getFirstName() {
204 return firstName;
205 }
206
207
208 /**
209 * Sets the firstName attribute value.
210 *
211 * @param firstName The firstName to set.
212 */
213 public void setFirstName(String firstName) {
214 this.firstName = firstName;
215 }
216
217
218 /**
219 * Gets the middleName attribute.
220 *
221 * @return Returns the middleName.
222 */
223 public String getMiddleName() {
224 return middleName;
225 }
226
227
228 /**
229 * Sets the middleName attribute value.
230 *
231 * @param middleName The middleName to set.
232 */
233 public void setMiddleName(String middleName) {
234 this.middleName = middleName;
235 }
236
237
238 /**
239 * Gets the lastName attribute.
240 *
241 * @return Returns the lastName.
242 */
243 public String getLastName() {
244 return lastName;
245 }
246
247
248 /**
249 * Sets the lastName attribute value.
250 *
251 * @param lastName The lastName to set.
252 */
253 public void setLastName(String lastName) {
254 this.lastName = lastName;
255 }
256
257
258 /**
259 * Gets the emailAddress attribute.
260 *
261 * @return Returns the emailAddress.
262 */
263 public String getEmailAddress() {
264 return emailAddress;
265 }
266
267
268 /**
269 * Sets the emailAddress attribute value.
270 *
271 * @param emailAddress The emailAddress to set.
272 */
273 public void setEmailAddress(String emailAddress) {
274 this.emailAddress = emailAddress;
275 }
276
277
278 /**
279 * Gets the employeeId attribute.
280 *
281 * @return Returns the employeeId.
282 */
283 public String getEmployeeId() {
284 return employeeId;
285 }
286
287
288 /**
289 * Sets the employeeId attribute value.
290 *
291 * @param employeeId The employeeId to set.
292 */
293 public void setEmployeeId(String employeeId) {
294 this.employeeId = employeeId;
295 }
296
297
298 /**
299 * Gets the roleId attribute.
300 *
301 * @return Returns the roleId.
302 */
303 public String getRoleId() {
304 return roleId;
305 }
306
307
308 /**
309 * Sets the roleId attribute value.
310 *
311 * @param roleId The roleId to set.
312 */
313 public void setRoleId(String roleId) {
314 this.roleId = roleId;
315 }
316
317
318 /**
319 * Gets the roleName attribute.
320 *
321 * @return Returns the roleName.
322 */
323 public String getRoleName() {
324 return roleName;
325 }
326
327
328 /**
329 * Sets the roleName attribute value.
330 *
331 * @param roleName The roleName to set.
332 */
333 public void setRoleName(String roleName) {
334 this.roleName = roleName;
335 }
336
337
338 /**
339 * Gets the namespaceCode attribute.
340 *
341 * @return Returns the namespaceCode.
342 */
343 public String getNamespaceCode() {
344 return namespaceCode;
345 }
346
347
348 /**
349 * Sets the namespaceCode attribute value.
350 *
351 * @param namespaceCode The namespaceCode to set.
352 */
353 public void setNamespaceCode(String namespaceCode) {
354 this.namespaceCode = namespaceCode;
355 }
356
357
358 /**
359 * Gets the groupId attribute.
360 *
361 * @return Returns the groupId.
362 */
363 public String getGroupId() {
364 return groupId;
365 }
366
367
368 /**
369 * Sets the groupId attribute value.
370 *
371 * @param groupId The groupId to set.
372 */
373 public void setGroupId(String groupId) {
374 this.groupId = groupId;
375 }
376
377
378 /**
379 * Gets the groupName attribute.
380 *
381 * @return Returns the groupName.
382 */
383 public String getGroupName() {
384 return groupName;
385 }
386
387
388 /**
389 * Sets the groupName attribute value.
390 *
391 * @param groupName The groupName to set.
392 */
393 public void setGroupName(String groupName) {
394 this.groupName = groupName;
395 }
396
397
398 /**
399 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
400 */
401 @Override
402 protected LinkedHashMap toStringMapper() {
403 LinkedHashMap m = new LinkedHashMap();
404
405 m.put(SecPropertyConstants.MEMBER_TYPE_CODE, this.memberTypeCode);
406 m.put(SecPropertyConstants.MEMBER_ID, this.memberId);
407
408 return m;
409 }
410
411 }