View Javadoc
1   /*
2    * Copyright (c) 2002-2020, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  /*
35   * To change this license header, choose License Headers in Project Properties.
36   * To change this template file, choose Tools | Templates
37   * and open the template in the editor.
38   */
39  package fr.paris.lutece.plugins.broadcastproxy.business;
40  
41  import java.util.HashMap;
42  import java.util.Map;
43  
44  /**
45   *
46   * @author leridons
47   */
48  public class Subscription
49  {
50  
51      private String _id;
52      private String _name;
53      private String _userId;
54      private String _userName;
55      private String _type;
56      private boolean _isActive;
57      private Map<String, String> _data;
58      private String _description;
59  
60      /**
61       * get id
62       * 
63       * @return the id
64       */
65      public String getId( )
66      {
67          return _id;
68      }
69  
70      /**
71       * set id
72       * 
73       * @param strId
74       */
75      public void setId( String strId )
76      {
77          this._id = strId;
78      }
79  
80      /**
81       * get subscription name
82       * 
83       * @return the subscription name
84       */
85      public String getName( )
86      {
87          return _name;
88      }
89  
90      /**
91       * set subscription name
92       * 
93       * @param strName
94       */
95      public void setName( String strName )
96      {
97          this._name = strName;
98      }
99  
100     /**
101      * get user id
102      * 
103      * @return the id
104      */
105     public String getUserId( )
106     {
107         return _userId;
108     }
109 
110     /**
111      * set user id
112      * 
113      * @param userId
114      */
115     public void setUserId( String userId )
116     {
117         this._userId = userId;
118     }
119 
120     /**
121      * get user name
122      * 
123      * @return the name
124      */
125     public String getUserName( )
126     {
127         return _userName;
128     }
129 
130     /**
131      * set user name
132      * 
133      * @param userName
134      */
135     public void setUserName( String userName )
136     {
137         this._userName = userName;
138     }
139 
140     /**
141      * get type
142      * 
143      * @return the type
144      */
145     public String getType( )
146     {
147         return _type;
148     }
149 
150     /**
151      * set type
152      * 
153      * @param type
154      */
155     public void setType( String type )
156     {
157         this._type = type;
158     }
159 
160     /**
161      * test if active
162      * 
163      * @return true if active
164      */
165     public boolean isActive( )
166     {
167         return _isActive;
168     }
169 
170     /**
171      * set active state
172      * 
173      * @param isActive
174      */
175     public void setActive( boolean isActive )
176     {
177         this._isActive = isActive;
178     }
179 
180     /**
181      * returns specific additionnal data
182      * 
183      * @return data
184      */
185     public Map<String, String> getData( )
186     {
187         return _data;
188     }
189 
190     /**
191      * set specific datas for the subscription
192      * 
193      * @param data
194      */
195     public void setData( Map<String, String> data )
196     {
197         this._data = data;
198     }
199 
200     /**
201      * add a data
202      * 
203      * @param strName
204      * @param strValue
205      */
206     public void addDataItem( String strName, String strValue )
207     {
208         if ( _data == null )
209             _data = new HashMap<>( );
210         this._data.put( strName, strValue );
211     }
212 
213     /**
214      * get subscription's description
215      * 
216      * @return description
217      */
218     public String getDescription( )
219     {
220         return _description;
221     }
222 
223     /**
224      * set subscription's description
225      * 
226      * @param description
227      */
228     public void setDescription( String _description )
229     {
230         this._description = _description;
231     }
232 
233 }