View Javadoc
1   /*
2    * Copyright (c) 2002-2024, 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  package fr.paris.lutece.plugins.identityimport.business;
35  
36  import javax.validation.constraints.NotEmpty;
37  import javax.validation.constraints.NotNull;
38  import javax.validation.constraints.Size;
39  import java.io.Serializable;
40  import java.sql.Date;
41  
42  /**
43   * This is the business class for the object Batch
44   */
45  public class Batch implements Serializable
46  {
47  
48      private static final String RESOURCE_TYPE = "IDENTITYIMPORT_BATCH_RESOURCE";
49      private static final long serialVersionUID = 1L;
50  
51      // Variables declarations
52      private int _nId;
53      private String _strReference;
54      private Date _dateDate;
55  
56      @NotEmpty( message = "#i18n{identityimport.validation.batch.User.notEmpty}" )
57      @Size( max = 255, message = "#i18n{identityimport.validation.batch.User.size}" )
58      private String _strUser;
59  
60      @NotEmpty( message = "#i18n{identityimport.validation.batch.AppCode.notEmpty}" )
61      @Size( max = 50, message = "#i18n{identityimport.validation.batch.AppCode.size}" )
62      private String _strAppCode;
63  
64      private String _strComment;
65  
66      /**
67       * Returns the Id
68       * 
69       * @return The Id
70       */
71      public int getId( )
72      {
73          return _nId;
74      }
75  
76      /**
77       * Sets the Id
78       * 
79       * @param nId
80       *            The Id
81       */
82      public void setId( int nId )
83      {
84          _nId = nId;
85      }
86  
87      /**
88       * Returns the Date
89       * 
90       * @return The Date
91       */
92      public Date getDate( )
93      {
94          return _dateDate;
95      }
96  
97      /**
98       * Sets the Date
99       * 
100      * @param dateDate
101      *            The Date
102      */
103     public void setDate( Date dateDate )
104     {
105         _dateDate = dateDate;
106     }
107 
108     /**
109      * Returns the Reference
110      *
111      * @return The Reference
112      */
113     public String getReference( )
114     {
115         return _strReference;
116     }
117 
118     /**
119      * Sets the Reference
120      *
121      * @param strReference
122      *            The Reference
123      */
124     public void setReference( String strReference )
125     {
126         _strReference = strReference;
127     }
128 
129     /**
130      * Returns the User
131      * 
132      * @return The User
133      */
134     public String getUser( )
135     {
136         return _strUser;
137     }
138 
139     /**
140      * Sets the User
141      * 
142      * @param strUser
143      *            The User
144      */
145     public void setUser( String strUser )
146     {
147         _strUser = strUser;
148     }
149 
150     /**
151      * Returns the AppCode
152      * 
153      * @return The AppCode
154      */
155     public String getAppCode( )
156     {
157         return _strAppCode;
158     }
159 
160     /**
161      * Sets the AppCode
162      * 
163      * @param strAppCode
164      *            The AppCode
165      */
166     public void setAppCode( String strAppCode )
167     {
168         _strAppCode = strAppCode;
169     }
170 
171     /**
172      * Returns the Comment
173      * 
174      * @return The Comment
175      */
176     public String getComment( )
177     {
178         return _strComment;
179     }
180 
181     /**
182      * Sets the Comment
183      * 
184      * @param strComment
185      *            The Comment
186      */
187     public void setComment( String strComment )
188     {
189         _strComment = strComment;
190     }
191 
192     public String toLog( )
193     {
194         return "[ID : " + getId( ) + "]" + "[REFERENCE : " + getReference( ) + "]" + "[DATE : " + getDate( ) + "]" + "[USER : " + getUser( ) + "]"
195                 + "[APP CODE : " + getAppCode( ) + "]";
196     }
197 }