001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kcb.bo;
017
018import javax.persistence.Column;
019import javax.persistence.Entity;
020import javax.persistence.Id;
021import javax.persistence.Table;
022import javax.persistence.Version;
023
024import org.apache.commons.lang.builder.ToStringBuilder;
025
026/**
027 * This class represents the enablement of a deliverer for a particular channel for a particular user.
028 * Each RecipientDelivererConfig instance represents a user as having applied a deliverer type configuration
029 * to a channel, such that any messages, targeted at the userId, will also be delivered to the correlating
030 * deliverer type (delivererName) for that user.
031 * @author Kuali Rice Team (rice.collab@kuali.org)
032 */
033@Entity
034@Table(name="KREN_RECIP_DELIV_T")
035public class RecipientDelivererConfig {
036    /**
037     * Field names for queries
038     */
039    public static final String RECIPIENT_ID = "recipientId";
040    public static final String CHANNEL = "channel";
041    
042    @Id
043        @Column(name="RECIP_DELIV_ID")
044        private Long id;
045    @Column(name="RECIP_ID", nullable=false)
046        private String recipientId;
047    @Column(name="NM", nullable=false)
048        private String delivererName;
049    @Column(name="CHNL", nullable=false)
050        private String channel;
051    /**
052     * Lock column for OJB optimistic locking
053     */
054    @Version
055        @Column(name="VER_NBR")
056        private Integer lockVerNbr;
057
058    /**
059     * Gets the id attribute. 
060     * @return Returns the id.
061     */
062    public Long getId() {
063        return id;
064    }
065
066    /**
067     * Sets the id attribute value.
068     * @param id The id to set.
069     */
070    public void setId(Long id) {
071        this.id = id;
072    }
073    
074    /**
075     * Return value of lock column for OJB optimistic locking
076     * @return value of lock column for OJB optimistic locking
077     */
078    public Integer getLockVerNbr() {
079        return lockVerNbr;
080    }
081
082    /**
083     * Set value of lock column for OJB optimistic locking
084     * @param lockVerNbr value of lock column for OJB optimistic locking
085     */
086    public void setLockVerNbr(Integer lockVerNbr) {
087        this.lockVerNbr = lockVerNbr;
088    }
089
090    /**
091     * Gets the recipientId attribute. 
092     * @return Returns the recipientId.
093     */
094    public String getRecipientId() {
095        return recipientId;
096    }
097
098    /**
099     * Sets the recipientId attribute value.
100     * @param recipientId The userId to set.
101     */
102    public void setRecipientId(String recipientId) {
103        this.recipientId = recipientId;
104    }
105
106    /**
107     * Gets the delivererName attribute. 
108     * @return Returns the name.
109     */
110    public String getDelivererName() {
111        return delivererName;
112    }
113
114    /**
115     * Sets the delivererName attribute value.
116     * @param delivererName The delivererName to set.
117     */
118    public void setDelivererName(String delivererName) {
119        this.delivererName = delivererName;
120    }
121
122    /**
123     * Gets the channels attribute. 
124     * @return Returns the channel.
125     */
126    public String getChannel() {
127        return channel;
128    }
129
130    /**
131     * Sets the channel attribute value.
132     * @param channel The channel to set.
133     */
134    public void setChannel(String channel) {
135        this.channel = channel;
136    }
137    
138    /**
139     * @see java.lang.Object#toString()
140     */
141    @Override
142    public String toString() {
143       return new ToStringBuilder(this).append("id", id)
144                                       .append("recipientId", recipientId)
145                                       .append("delivererName", delivererName)
146                                       .append("channel", channel)
147                                       .toString();
148    }
149}