View Javadoc
1   /**
2    * Copyright 2005-2014 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.rice.kcb.bo;
17  
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.GeneratedValue;
21  import javax.persistence.Id;
22  import javax.persistence.Table;
23  import javax.persistence.Version;
24  
25  import org.apache.commons.lang.builder.ToStringBuilder;
26  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
27  
28  /**
29   * This class represents the enablement of a deliverer for a particular channel for a particular user.
30   * Each RecipientDelivererConfig instance represents a user as having applied a deliverer type configuration
31   * to a channel, such that any messages, targeted at the userId, will also be delivered to the correlating
32   * deliverer type (delivererName) for that user.
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   */
35  @Entity
36  @Table(name="KREN_RECIP_DELIV_T")
37  public class RecipientDelivererConfig {
38      /**
39       * Field names for queries
40       */
41      public static final String RECIPIENT_ID = "recipientId";
42      public static final String CHANNEL = "channel";
43      
44      @Id
45      @GeneratedValue(generator="KREN_RECIP_DELIV_S")
46      @PortableSequenceGenerator(name="KREN_RECIP_DELIV_S")
47  	@Column(name="RECIP_DELIV_ID")
48  	private Long id;
49      @Column(name="RECIP_ID", nullable=false)
50  	private String recipientId;
51      @Column(name="NM", nullable=false)
52  	private String delivererName;
53      @Column(name="CHNL", nullable=false)
54  	private String channel;
55      /**
56       * Lock column for OJB optimistic locking
57       */
58      @Version
59  	@Column(name="VER_NBR")
60  	private Integer lockVerNbr;
61  
62      /**
63       * Gets the id attribute. 
64       * @return Returns the id.
65       */
66      public Long getId() {
67          return id;
68      }
69  
70      /**
71       * Sets the id attribute value.
72       * @param id The id to set.
73       */
74      public void setId(Long id) {
75          this.id = id;
76      }
77      
78      /**
79       * Return value of lock column for OJB optimistic locking
80       * @return value of lock column for OJB optimistic locking
81       */
82      public Integer getLockVerNbr() {
83          return lockVerNbr;
84      }
85  
86      /**
87       * Set value of lock column for OJB optimistic locking
88       * @param lockVerNbr value of lock column for OJB optimistic locking
89       */
90      public void setLockVerNbr(Integer lockVerNbr) {
91          this.lockVerNbr = lockVerNbr;
92      }
93  
94      /**
95       * Gets the recipientId attribute. 
96       * @return Returns the recipientId.
97       */
98      public String getRecipientId() {
99          return recipientId;
100     }
101 
102     /**
103      * Sets the recipientId attribute value.
104      * @param recipientId The userId to set.
105      */
106     public void setRecipientId(String recipientId) {
107         this.recipientId = recipientId;
108     }
109 
110     /**
111      * Gets the delivererName attribute. 
112      * @return Returns the name.
113      */
114     public String getDelivererName() {
115         return delivererName;
116     }
117 
118     /**
119      * Sets the delivererName attribute value.
120      * @param delivererName The delivererName to set.
121      */
122     public void setDelivererName(String delivererName) {
123         this.delivererName = delivererName;
124     }
125 
126     /**
127      * Gets the channels attribute. 
128      * @return Returns the channel.
129      */
130     public String getChannel() {
131         return channel;
132     }
133 
134     /**
135      * Sets the channel attribute value.
136      * @param channel The channel to set.
137      */
138     public void setChannel(String channel) {
139         this.channel = channel;
140     }
141     
142     /**
143      * @see java.lang.Object#toString()
144      */
145     @Override
146     public String toString() {
147        return new ToStringBuilder(this).append("id", id)
148                                        .append("recipientId", recipientId)
149                                        .append("delivererName", delivererName)
150                                        .append("channel", channel)
151                                        .toString();
152     }
153 }