View Javadoc
1   /*
2    * Copyright 2011 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.coa.identity;
17  
18  import java.util.Map;
19  
20  import org.joda.time.DateTime;
21  import org.kuali.rice.core.api.delegation.DelegationType;
22  import org.kuali.rice.core.api.membership.MemberType;
23  import org.kuali.rice.core.api.mo.common.active.InactivatableFromToUtils;
24  import org.kuali.rice.kim.api.common.delegate.DelegateMemberContract;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  
27  public class OleKimDocDelegateMember extends PersistableBusinessObjectBase implements DelegateMemberContract {
28  
29      protected String delegationMemberId;
30      protected String delegationId;
31      protected String memberId;
32      protected String roleMemberId;
33      protected Map<String, String> attributes;
34      protected DateTime activeFromDate;
35      protected DateTime activeToDate;
36      protected DelegationType delegationType;
37      protected MemberType type;
38      protected String memberName;
39      protected String memberNamespaceCode;
40      
41      public OleKimDocDelegateMember() {}
42      
43      public OleKimDocDelegateMember( String roleMemberId, MemberType type ) {
44          this.roleMemberId = roleMemberId;
45          this.type = type;
46      }
47      
48      public OleKimDocDelegateMember( DelegateMemberContract delegateMember ) {
49          this.delegationMemberId = delegateMember.getDelegationMemberId();
50          this.delegationId = delegateMember.getDelegationId();
51          this.memberId = delegateMember.getMemberId();
52          this.roleMemberId = delegateMember.getRoleMemberId();
53          this.type = delegateMember.getType();
54          this.activeFromDate = delegateMember.getActiveFromDate();
55          this.activeToDate = delegateMember.getActiveToDate();
56          this.attributes = delegateMember.getAttributes();        
57      }
58      
59      public String getDelegationMemberId() {
60          return delegationMemberId;
61      }
62      public void setDelegationMemberId(String delegationMemberId) {
63          this.delegationMemberId = delegationMemberId;
64      }
65      public String getDelegationId() {
66          return delegationId;
67      }
68      public void setDelegationId(String delegationId) {
69          this.delegationId = delegationId;
70      }
71      public String getMemberId() {
72          return memberId;
73      }
74      public void setMemberId(String memberId) {
75          this.memberId = memberId;
76      }
77      public String getRoleMemberId() {
78          return roleMemberId;
79      }
80      public void setRoleMemberId(String roleMemberId) {
81          this.roleMemberId = roleMemberId;
82      }
83      public Map<String, String> getAttributes() {
84          return attributes;
85      }
86      public void setAttributes(Map<String, String> attributes) {
87          this.attributes = attributes;
88      }
89      public DateTime getActiveFromDate() {
90          return activeFromDate;
91      }
92      public void setActiveFromDate(DateTime activeFromDate) {
93          this.activeFromDate = activeFromDate;
94      }
95      public DateTime getActiveToDate() {
96          return activeToDate;
97      }
98      public void setActiveToDate(DateTime activeToDate) {
99          this.activeToDate = activeToDate;
100     }
101 
102     @Override
103     public boolean isActive(DateTime activeAsOfDate) {
104         return InactivatableFromToUtils.isActive(activeFromDate, activeToDate, activeAsOfDate);
105     }
106 
107     @Override
108     public boolean isActive() {
109         return InactivatableFromToUtils.isActive(activeFromDate, activeToDate, null);
110     }
111 
112     @Override
113     public MemberType getType() {
114         return type;
115     }
116 
117     public DelegationType getDelegationType() {
118         return delegationType;
119     }
120 
121     public void setDelegationType(DelegationType delegationType) {
122         this.delegationType = delegationType;
123     }
124 
125     public void setType(MemberType type) {
126         this.type = type;
127     }
128 
129     public String getMemberName() {
130         return memberName;
131     }
132 
133     public void setMemberName(String memberName) {
134         this.memberName = memberName;
135     }
136 
137     public String getMemberNamespaceCode() {
138         return memberNamespaceCode;
139     }
140 
141     public void setMemberNamespaceCode(String memberNamespaceCode) {
142         this.memberNamespaceCode = memberNamespaceCode;
143     }
144     
145     
146 
147 }