1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.plugins.identityimport.business;
35
36 import fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException;
37 import fr.paris.lutece.plugins.workflowcore.business.resource.ResourceHistory;
38 import fr.paris.lutece.portal.service.plugin.Plugin;
39 import fr.paris.lutece.portal.service.plugin.PluginService;
40 import fr.paris.lutece.portal.service.spring.SpringContextService;
41 import fr.paris.lutece.util.ReferenceList;
42
43 import java.util.List;
44 import java.util.Optional;
45
46
47
48
49 public final class BatchHome
50 {
51
52 private static IBatchDAO _dao = SpringContextService.getBean( "identityimport.batchDAO" );
53 private static Plugin _plugin = PluginService.getPlugin( "identityimport" );
54
55
56
57
58 private BatchHome( )
59 {
60 }
61
62
63
64
65
66
67
68
69 public static Batchf="../../../../../../fr/paris/lutece/plugins/identityimport/business/Batch.html#Batch">Batch create( Batch batch )
70 {
71 _dao.insert( batch, _plugin );
72
73 return batch;
74 }
75
76
77
78
79
80
81
82
83 public static Batchf="../../../../../../fr/paris/lutece/plugins/identityimport/business/Batch.html#Batch">Batch update( Batch batch )
84 {
85 _dao.store( batch, _plugin );
86
87 return batch;
88 }
89
90
91
92
93
94
95
96 public static void remove( int nKey )
97 {
98 _dao.delete( nKey, _plugin );
99 }
100
101
102
103
104
105
106
107
108 public static Optional<Batch> findByPrimaryKey( int nKey )
109 {
110 return _dao.load( nKey, _plugin );
111 }
112
113
114
115
116
117
118 public static List<Batch> getBatchsList( )
119 {
120 return _dao.selectBatchsList( _plugin );
121 }
122
123
124
125
126
127
128 public static List<Integer> getIdBatchsList( final ResourceState resourceState, final String filterAppCode, final String filterClientCode, final String filterReference )
129 {
130 return _dao.selectIdBatchsList( resourceState.getId( ), filterAppCode, filterClientCode, filterReference, _plugin );
131 }
132
133
134
135
136
137
138 public static ReferenceList getBatchsReferenceList( )
139 {
140 return _dao.selectBatchsReferenceList( _plugin );
141 }
142
143
144
145
146
147
148
149
150 public static List<Batch> getBatchsListByIds( List<Integer> listIds )
151 {
152 return _dao.selectBatchsListByIds( _plugin, listIds );
153 }
154
155 public static Batch getBatch( final String reference )
156 {
157 return _dao.selectBatchByReference( _plugin, reference );
158 }
159
160 public static Optional<Batch> getBatch( final int id )
161 {
162 return _dao.load( id, _plugin );
163 }
164
165
166
167
168
169
170
171 public static List<Batch> findExpiredBatches( final int batchLimit )
172 {
173 return _dao.selectExpiredBatchsList( batchLimit, _plugin );
174 }
175
176
177
178
179
180
181
182
183 public static List<Batch> findInitialStateBatches( final int batchLimit )
184 {
185 return _dao.selectInitialStateBatches( batchLimit, _plugin );
186 }
187
188
189
190
191
192
193
194
195 public static List<Batch> findClosableBatches( final int batchLimit )
196 {
197 return _dao.selectClosableBatches( batchLimit, _plugin );
198 }
199
200 public static List<ResourceState> getBatchStates( final String filterAppCode, final String filterClientCode )
201 {
202 return _dao.selectBatchStates( filterAppCode, filterClientCode, _plugin );
203 }
204
205 public static ResourceState getBatchState( final int batchId )
206 {
207 return _dao.selectBatchState( batchId, _plugin );
208 }
209
210 public static int getIdentitiesCount( final int resourceId )
211 {
212 return _dao.countIdentities( resourceId, _plugin );
213 }
214
215 public static List<ResourceHistory> getBatchHistory( final int batchId )
216 {
217 return _dao.getBatchHistory( batchId, _plugin );
218 }
219
220
221
222
223
224
225 public static int getBatchInitialActionId( ) throws IdentityStoreException
226 {
227 return _dao.getBatchInitialActionId( _plugin );
228 }
229
230
231
232
233
234
235 public static int getBatchInTreatmentActionId( ) throws IdentityStoreException
236 {
237 return _dao.getBatchInTreatmentActionId( _plugin );
238 }
239 }