View Javadoc
1   /*
2    * Copyright 2009 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 1.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl1.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.sec.businessobject;
17  
18  import java.util.ArrayList;
19  import java.util.LinkedHashMap;
20  import java.util.List;
21  
22  import org.kuali.ole.sys.OLEPropertyConstants;
23  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
24  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
25  import org.kuali.rice.core.api.util.type.KualiInteger;
26  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27  
28  /**
29   * Represents the assignment of one or more definitions to one or more members (principal, group, or role). A model becomes a role in KIM
30   */
31  public class SecurityModel extends PersistableBusinessObjectBase implements MutableInactivatable {
32      protected KualiInteger id;
33      protected String name;
34      protected String description;
35      protected String roleId;
36      protected boolean active;
37  
38      protected List<SecurityModelDefinition> modelDefinitions = new org.apache.ojb.broker.util.collections.ManageableArrayList();// = new ArrayList<SecurityModelDefinition>();
39      protected List<SecurityModelMember> modelMembers = new org.apache.ojb.broker.util.collections.ManageableArrayList();// = new ArrayList<SecurityModelMember>();
40  
41      /**
42       * Gets the id attribute.
43       * 
44       * @return Returns the id.
45       */
46      public KualiInteger getId() {
47          return id;
48      }
49  
50  
51      /**
52       * Sets the id attribute value.
53       * 
54       * @param id The id to set.
55       */
56      public void setId(KualiInteger id) {
57          this.id = id;
58      }
59  
60  
61      /**
62       * Gets the name attribute.
63       * 
64       * @return Returns the name.
65       */
66      public String getName() {
67          return name;
68      }
69  
70  
71      /**
72       * Sets the name attribute value.
73       * 
74       * @param name The name to set.
75       */
76      public void setName(String name) {
77          this.name = name;
78      }
79  
80  
81      /**
82       * Gets the description attribute.
83       * 
84       * @return Returns the description.
85       */
86      public String getDescription() {
87          return description;
88      }
89  
90  
91      /**
92       * Sets the description attribute value.
93       * 
94       * @param description The description to set.
95       */
96      public void setDescription(String description) {
97          this.description = description;
98      }
99  
100 
101     /**
102      * Gets the roleId attribute.
103      * 
104      * @return Returns the roleId.
105      */
106     public String getRoleId() {
107         return roleId;
108     }
109 
110 
111     /**
112      * Sets the roleId attribute value.
113      * 
114      * @param roleId The roleId to set.
115      */
116     public void setRoleId(String roleId) {
117         this.roleId = roleId;
118     }
119 
120 
121     /**
122      * Gets the active attribute.
123      * 
124      * @return Returns the active.
125      */
126     public boolean isActive() {
127         return active;
128     }
129 
130 
131     /**
132      * Sets the active attribute value.
133      * 
134      * @param active The active to set.
135      */
136     public void setActive(boolean active) {
137         this.active = active;
138     }
139 
140 
141     /**
142      * Gets the modelDefinitions attribute.
143      * 
144      * @return Returns the modelDefinitions.
145      */
146     public List<SecurityModelDefinition> getModelDefinitions() {
147         return modelDefinitions;
148     }
149 
150 
151     /**
152      * Sets the modelDefinitions attribute value.
153      * 
154      * @param modelDefinitions The modelDefinitions to set.
155      */
156     public void setModelDefinitions(List<SecurityModelDefinition> modelDefinitions) {
157         this.modelDefinitions = modelDefinitions;
158     }
159 
160 
161     /**
162      * Gets the modelMembers attribute.
163      * 
164      * @return Returns the modelMembers.
165      */
166     public List<SecurityModelMember> getModelMembers() {
167         return modelMembers;
168     }
169 
170 
171     /**
172      * Sets the modelMembers attribute value.
173      * 
174      * @param modelMembers The modelMembers to set.
175      */
176     public void setModelMembers(List<SecurityModelMember> modelMembers) {
177         this.modelMembers = modelMembers;
178     }
179 
180 
181     @Override
182     public String toString() {
183         StringBuilder builder = new StringBuilder();
184         builder.append("SecurityModel [");
185         if (id != null) {
186             builder.append("id=");
187             builder.append(id);
188             builder.append(", ");
189         }
190         if (name != null) {
191             builder.append("name=");
192             builder.append(name);
193             builder.append(", ");
194         }
195         if (description != null) {
196             builder.append("description=");
197             builder.append(description);
198             builder.append(", ");
199         }
200         if (roleId != null) {
201             builder.append("roleId=");
202             builder.append(roleId);
203             builder.append(", ");
204         }
205         builder.append("active=");
206         builder.append(active);
207         builder.append("]");
208         return builder.toString();
209     }
210 
211 
212 
213 }