View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.r1.lum.lrc.dto;
17  
18  import java.io.Serializable;
19  import java.util.Date;
20  import java.util.HashMap;
21  import java.util.Map;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
28  
29  import org.kuali.student.r1.common.dto.HasAttributes;
30  import org.kuali.student.r1.common.dto.Idable;
31  import org.kuali.student.r2.common.dto.RichTextInfo;
32  import org.kuali.student.core.ws.binding.JaxbAttributeMapListAdapter;
33  
34  /**
35   * Detailed information about a credential value.
36   *
37   * @Author KSContractMojo
38   * @Author lindholm
39   * @Since Tue Apr 21 13:47:30 PDT 2009
40   * @See <a href="https://test.kuali.org/confluence/display/KULSTU/credentialInfo+Structure">CredentialInfo</>
41   *
42   */
43  @XmlAccessorType(XmlAccessType.FIELD)
44  public class CredentialInfo implements Serializable, Idable, HasAttributes {
45  
46      private static final long serialVersionUID = 1L;
47  
48      @XmlElement
49      private String name;
50  
51      @XmlElement
52      private RichTextInfo desc;
53  
54      @XmlElement
55      private String value;
56  
57      @XmlElement
58      private Date effectiveDate;
59  
60      @XmlElement
61      private Date expirationDate;
62  
63      @XmlElement
64      @XmlJavaTypeAdapter(JaxbAttributeMapListAdapter.class)
65      private Map<String, String> attributes;
66  
67      @XmlAttribute
68      private String type;
69  
70      @XmlAttribute(name="key")
71      private String id;
72  
73      /**
74       * Name of the credential.
75       */
76      public String getName() {
77          return name;
78      }
79  
80      public void setName(String name) {
81          this.name = name;
82      }
83  
84      /**
85       * Description of the credential.
86       */
87      public RichTextInfo getDesc() {
88          return desc;
89      }
90  
91      public void setDesc(RichTextInfo desc) {
92          this.desc = desc;
93      }
94  
95      /**
96       * Value of the credential.
97       */
98      public String getValue() {
99          return value;
100     }
101 
102     public void setValue(String value) {
103         this.value = value;
104     }
105 
106     /**
107      * Date and time that this credential value became effective. This is a similar concept to the effective date on enumerated values. When an expiration date has been specified, this field must be less than or equal to the expiration date.
108      */
109     public Date getEffectiveDate() {
110         return effectiveDate;
111     }
112 
113     public void setEffectiveDate(Date effectiveDate) {
114         this.effectiveDate = effectiveDate;
115     }
116 
117     /**
118      * Date and time that this credential value expires. This is a similar concept to the expiration date on enumerated values. If specified, this should be greater than or equal to the effective date. If this field is not specified, then no expiration date has been currently defined and should automatically be considered greater than the effective date.
119      */
120     public Date getExpirationDate() {
121         return expirationDate;
122     }
123 
124     public void setExpirationDate(Date expirationDate) {
125         this.expirationDate = expirationDate;
126     }
127 
128     /**
129      * List of key/value pairs, typically used for dynamic attributes.
130      */
131     public Map<String, String> getAttributes() {
132         if (attributes == null) {
133             attributes = new HashMap<String, String>();
134         }
135         return attributes;
136     }
137 
138     public void setAttributes(Map<String, String> attributes) {
139         this.attributes = attributes;
140     }
141 
142     /**
143      * Unique identifier for a credential type.
144      */
145     public String getType() {
146         return type;
147     }
148 
149     public void setType(String type) {
150         this.type = type;
151     }
152 
153     /**
154      * Unique identifier for a credential value.
155      */
156     public String getId() {
157         return id;
158     }
159 
160     public void setId(String id) {
161         this.id = id;
162     }
163 }