View Javadoc
1   /*
2    * Copyright 2012 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.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/ecl2.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 org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
19  import org.kuali.rice.core.api.util.type.KualiInteger;
20  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
21  import org.kuali.rice.krad.util.ObjectUtils;
22  
23  public abstract class AbstractSecurityModelDefinition extends PersistableBusinessObjectBase implements MutableInactivatable {
24  
25      protected KualiInteger definitionId;
26      protected String constraintCode;
27      protected String operatorCode;
28      protected String attributeValue;
29      protected boolean overrideDeny = false;
30      protected boolean active = true;
31  
32      protected SecurityDefinition securityDefinition;
33  
34      /**
35       * Gets the definitionId attribute.
36       * 
37       * @return Returns the definitionId.
38       */
39      public KualiInteger getDefinitionId() {
40          return definitionId;
41      }
42  
43  
44      /**
45       * Sets the definitionId attribute value.
46       * 
47       * @param definitionId The definitionId to set.
48       */
49      public void setDefinitionId(KualiInteger definitionId) {
50          this.definitionId = definitionId;
51      }
52  
53  
54      /**
55       * Gets the attributeValue attribute.
56       * 
57       * @return Returns the attributeValue.
58       */
59      public String getAttributeValue() {
60          return attributeValue;
61      }
62  
63  
64      /**
65       * Sets the attributeValue attribute value.
66       * 
67       * @param attributeValue The attributeValue to set.
68       */
69      public void setAttributeValue(String attributeValue) {
70          this.attributeValue = attributeValue;
71      }
72  
73  
74      /**
75       * Gets the operatorCode attribute.
76       * 
77       * @return Returns the operatorCode.
78       */
79      public String getOperatorCode() {
80          return operatorCode;
81      }
82  
83  
84      /**
85       * Sets the operatorCode attribute value.
86       * 
87       * @param operatorCode The operatorCode to set.
88       */
89      public void setOperatorCode(String operatorCode) {
90          this.operatorCode = operatorCode;
91      }
92  
93  
94      /**
95       * Gets the constraintCode attribute.
96       * 
97       * @return Returns the constraintCode.
98       */
99      public String getConstraintCode() {
100         return constraintCode;
101     }
102 
103 
104     /**
105      * Sets the constraintCode attribute value.
106      * 
107      * @param constraintCode The constraintCode to set.
108      */
109     public void setConstraintCode(String constraintCode) {
110         this.constraintCode = constraintCode;
111     }
112 
113 
114     /**
115      * Gets the overrideDeny attribute.
116      * 
117      * @return Returns the overrideDeny.
118      */
119     public boolean isOverrideDeny() {
120         return overrideDeny;
121     }
122 
123 
124     /**
125      * Sets the overrideDeny attribute value.
126      * 
127      * @param overrideDeny The overrideDeny to set.
128      */
129     public void setOverrideDeny(boolean overrideDeny) {
130         this.overrideDeny = overrideDeny;
131     }
132 
133 
134     /**
135      * Gets the active attribute.
136      * 
137      * @return Returns the active.
138      */
139     public boolean isActive() {
140         return active;
141     }
142 
143 
144     /**
145      * Sets the active attribute value.
146      * 
147      * @param active The active to set.
148      */
149     public void setActive(boolean active) {
150         this.active = active;
151     }
152 
153 
154     /**
155      * Gets the securityDefinition attribute.
156      * 
157      * @return Returns the securityDefinition.
158      */
159     public SecurityDefinition getSecurityDefinition() {
160         return securityDefinition;
161     }
162 
163 
164     /**
165      * Sets the securityDefinition attribute value.
166      * 
167      * @param securityDefinition The securityDefinition to set.
168      */
169     public void setSecurityDefinition(SecurityDefinition securityDefinition) {
170         this.securityDefinition = securityDefinition;
171     }
172     
173     public String getPrettyPrint() {
174         if ( ObjectUtils.isNotNull(securityDefinition) && ObjectUtils.isNotNull(securityDefinition.getSecurityAttribute()) ) {
175             return securityDefinition.getSecurityAttribute().getName() + " " + operatorCode + " " + attributeValue + "(" + constraintCode + ")";
176         }
177         return "";
178     }
179 }