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.Size;
38  import java.io.Serializable;
39  import java.sql.Timestamp;
40  
41  /**
42   * This is the business class for the object Batch
43   */
44  public class Batch implements Serializable
45  {
46  
47      private static final String RESOURCE_TYPE = "IDENTITYIMPORT_BATCH_RESOURCE";
48      private static final long serialVersionUID = 1L;
49  
50      // Variables declarations
51      private int _nId;
52      private String _strReference;
53      private Timestamp _dateCreationDate;
54  
55      @NotEmpty( message = "#i18n{identityimport.validation.batch.User.notEmpty}" )
56      @Size( max = 255, message = "#i18n{identityimport.validation.batch.User.size}" )
57      private String _strUser;
58  
59      @NotEmpty( message = "#i18n{identityimport.validation.batch.AppCode.notEmpty}" )
60      @Size( max = 50, message = "#i18n{identityimport.validation.batch.AppCode.size}" )
61      private String _strAppCode;
62      private String _strClientCode;
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 creation date
89       * 
90       * @return The creation Date
91       */
92      public Timestamp getCreationDate( )
93      {
94          return _dateCreationDate;
95      }
96  
97      /**
98       * Sets the Date
99       * 
100      * @param creationDate
101      *            The creation Date
102      */
103     public void setCreationDate(Timestamp creationDate )
104     {
105         _dateCreationDate = creationDate;
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     public String getClientCode() {
172         return _strClientCode;
173     }
174 
175     public void setClientCode(String _strClientCode) {
176         this._strClientCode = _strClientCode;
177     }
178 
179     /**
180      * Returns the Comment
181      * 
182      * @return The Comment
183      */
184     public String getComment( )
185     {
186         return _strComment;
187     }
188 
189     /**
190      * Sets the Comment
191      * 
192      * @param strComment
193      *            The Comment
194      */
195     public void setComment( String strComment )
196     {
197         _strComment = strComment;
198     }
199 
200     public String toLog( )
201     {
202         return "[ID : " + getId( ) + "]" + "[REFERENCE : " + getReference( ) + "]" + "[CREATION DATE : " + getCreationDate( ) + "]" + "[USER : " + getUser( ) + "]"
203                 + "[APP CODE : " + getAppCode( ) + "]" + "[CLIENT CODE : " + getClientCode( ) + "]";
204     }
205 }