View Javadoc
1   /*
2    * Copyright (c) 2002-2019, Mairie de 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  package fr.paris.lutece.plugins.botpress.business;
35  
36  import org.hibernate.validator.constraints.NotEmpty;
37  
38  import java.io.Serializable;
39  
40  import javax.validation.constraints.Size;
41  
42  /**
43   * This is the business class for the object BPBot
44   */
45  public class BPBot implements Serializable
46  {
47      private static final String DEFAULT_AVATAR_URL = "images/skin/plugins/botpress/default_avatar.png";
48      private static final long serialVersionUID = 1L;
49  
50      // Variables declarations
51      private int _nId;
52      @NotEmpty( message = "#i18n{botpress.validation.bpbot.BotKey.notEmpty}" )
53      @Size( max = 50, message = "#i18n{botpress.validation.bpbot.BotKey.size}" )
54      private String _strBotKey;
55      @NotEmpty( message = "#i18n{botpress.validation.bpbot.BotPressKey.notEmpty}" )
56      @Size( max = 50, message = "#i18n{botpress.validation.bpbot.BotPressKey.size}" )
57      private String _strBotPressKey;
58      @NotEmpty( message = "#i18n{botpress.validation.bpbot.Name.notEmpty}" )
59      @Size( max = 50, message = "#i18n{botpress.validation.bpbot.Name.size}" )
60      private String _strName;
61      @NotEmpty( message = "#i18n{botpress.validation.bpbot.Description.notEmpty}" )
62      @Size( max = 255, message = "#i18n{botpress.validation.bpbot.Description.size}" )
63      private String _strDescription;
64      @NotEmpty( message = "#i18n{botpress.validation.bpbot.AvatarUrl.notEmpty}" )
65      @Size( max = 255, message = "#i18n{botpress.validation.bpbot.AvatarUrl.size}" )
66      private String _strAvatarUrl = DEFAULT_AVATAR_URL;
67      @NotEmpty( message = "#i18n{botpress.validation.bpbot.Language.notEmpty}" )
68      @Size( max = 50, message = "#i18n{botpress.validation.bpbot.Language.size}" )
69      private String _strLanguage;
70      private int _nBotStatus;
71      private int _nIsStandalone;
72      @Size( max = 255, message = "#i18n{botpress.validation.bpbot.WelcomeMessage.size}" )
73      private String _strWelcomeMessage;
74      @Size( max = 255, message = "#i18n{botpress.validation.bpbot.ErrorMessage.size}" )
75      private String _strErrorMessage;
76      @NotEmpty( message = "#i18n{botpress.validation.bpbot.ServerUrl.notEmpty}" )
77      @Size( max = 255, message = "#i18n{botpress.validation.bpbot.ServerUrl.size}" )
78      private String _strServerUrl;
79      private int _nApiVersion;
80      private String _strAvatarRendererKey;
81  
82      /**
83       * Returns the Id
84       *
85       * @return The Id
86       */
87      public int getId( )
88      {
89          return _nId;
90      }
91  
92      /**
93       * Sets the Id
94       *
95       * @param nId
96       *            The Id
97       */
98      public void setId( int nId )
99      {
100         _nId = nId;
101     }
102 
103     /**
104      * Returns the BotKey
105      *
106      * @return The BotKey
107      */
108     public String getBotKey( )
109     {
110         return _strBotKey;
111     }
112 
113     /**
114      * Sets the BotKey
115      *
116      * @param strBotKey
117      *            The BotKey
118      */
119     public void setBotKey( String strBotKey )
120     {
121         _strBotKey = strBotKey;
122     }
123 
124     /**
125      * Returns the BotPressKey
126      *
127      * @return The BotPressKey
128      */
129     public String getBotPressKey( )
130     {
131         return _strBotPressKey;
132     }
133 
134     /**
135      * Sets the BotPressKey
136      *
137      * @param strBotPressKey
138      *            The BotPressKey
139      */
140     public void setBotPressKey( String strBotPressKey )
141     {
142         _strBotPressKey = strBotPressKey;
143     }
144 
145     /**
146      * Returns the Name
147      *
148      * @return The Name
149      */
150     public String getName( )
151     {
152         return _strName;
153     }
154 
155     /**
156      * Sets the Name
157      *
158      * @param strName
159      *            The Name
160      */
161     public void setName( String strName )
162     {
163         _strName = strName;
164     }
165 
166     /**
167      * Returns the Description
168      *
169      * @return The Description
170      */
171     public String getDescription( )
172     {
173         return _strDescription;
174     }
175 
176     /**
177      * Sets the Description
178      *
179      * @param strDescription
180      *            The Description
181      */
182     public void setDescription( String strDescription )
183     {
184         _strDescription = strDescription;
185     }
186 
187     /**
188      * Returns the AvatarUrl
189      *
190      * @return The AvatarUrl
191      */
192     public String getAvatarUrl( )
193     {
194         return _strAvatarUrl;
195     }
196 
197     /**
198      * Sets the AvatarUrl
199      *
200      * @param strAvatarUrl
201      *            The AvatarUrl
202      */
203     public void setAvatarUrl( String strAvatarUrl )
204     {
205         _strAvatarUrl = strAvatarUrl;
206     }
207 
208     /**
209      * Returns the Language
210      *
211      * @return The Language
212      */
213     public String getLanguage( )
214     {
215         return _strLanguage;
216     }
217 
218     /**
219      * Sets the Language
220      *
221      * @param strLanguage
222      *            The Language
223      */
224     public void setLanguage( String strLanguage )
225     {
226         _strLanguage = strLanguage;
227     }
228 
229     /**
230      * Returns the BotStatus
231      *
232      * @return The BotStatus
233      */
234     public int getBotStatus( )
235     {
236         return _nBotStatus;
237     }
238 
239     /**
240      * Sets the BotStatus
241      *
242      * @param nBotStatus
243      *            The BotStatus
244      */
245     public void setBotStatus( int nBotStatus )
246     {
247         _nBotStatus = nBotStatus;
248     }
249 
250     /**
251      * Returns the IsStandalone
252      *
253      * @return The IsStandalone
254      */
255     public int getIsStandalone( )
256     {
257         return _nIsStandalone;
258     }
259 
260     /**
261      * Sets the IsStandalone
262      *
263      * @param nIsStandalone
264      *            The IsStandalone
265      */
266     public void setIsStandalone( int nIsStandalone )
267     {
268         _nIsStandalone = nIsStandalone;
269     }
270 
271     /**
272      * Returns the WelcomeMessage
273      *
274      * @return The WelcomeMessage
275      */
276     public String getWelcomeMessage( )
277     {
278         return _strWelcomeMessage;
279     }
280 
281     /**
282      * Sets the WelcomeMessage
283      *
284      * @param strWelcomeMessage
285      *            The WelcomeMessage
286      */
287     public void setWelcomeMessage( String strWelcomeMessage )
288     {
289         _strWelcomeMessage = strWelcomeMessage;
290     }
291 
292     /**
293      * Returns the ErrorMessage
294      *
295      * @return The ErrorMessage
296      */
297     public String getErrorMessage( )
298     {
299         return _strErrorMessage;
300     }
301 
302     /**
303      * Sets the ErrorMessage
304      *
305      * @param strErrorMessage
306      *            The ErrorMessage
307      */
308     public void setErrorMessage( String strErrorMessage )
309     {
310         _strErrorMessage = strErrorMessage;
311     }
312 
313     /**
314      * Returns the ServerUrl
315      *
316      * @return The ServerUrl
317      */
318     public String getServerUrl( )
319     {
320         return _strServerUrl;
321     }
322 
323     /**
324      * Sets the ServerUrl
325      *
326      * @param strServerUrl
327      *            The ServerUrl
328      */
329     public void setServerUrl( String strServerUrl )
330     {
331         _strServerUrl = strServerUrl;
332     }
333 
334     /**
335      * Returns the ApiVersion
336      *
337      * @return The ApiVersion
338      */
339     public int getApiVersion( )
340     {
341         return _nApiVersion;
342     }
343 
344     /**
345      * Sets the ApiVersion
346      *
347      * @param nApiVersion
348      *            The ApiVersion
349      */
350     public void setApiVersion( int nApiVersion )
351     {
352         _nApiVersion = nApiVersion;
353     }
354 
355     /**
356      * Returns the AvatarRendererKey
357      *
358      * @return The AvatarRendererKey
359      */
360     public String getAvatarRendererKey( )
361     {
362         return _strAvatarRendererKey;
363     }
364 
365     /**
366      * Sets the AvatarRendererKey
367      *
368      * @param strAvatarRendererKey
369      *            The AvatarRendererKey
370      */
371     public void setAvatarRendererKey( String strAvatarRendererKey )
372     {
373         _strAvatarRendererKey = strAvatarRendererKey;
374     }
375 }