Class AppointmentImportRetryService
java.lang.Object
fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentImportRetryService
Puts the rows in error back in the queue of the daemon, after the cause has been fixed (a slot opened, a value corrected).
A batch being processed is left to the daemon: its rows are retried once it is done. A row retried while the daemon takes its batch is not lost: the
daemon puts back in the queue a batch that still has pending rows when it is done with it. A row interrupted while its appointment was being
saved (INTERRUPTED) may have its appointment already: it is never retried with the others, only on its own, once checked.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError code of a row interrupted while its appointment was being saved -
Method Summary
Modifier and TypeMethodDescriptionstatic List<AppointmentValidationError>correctRow(int nRowId, Map<String, String> mapGenericAttributes, Map<String, String> mapFormFields, Locale locale) Corrects the values of a row in error, checked as on upload, then puts it back in the queue.static booleanretryBatch(int nBatchId) Puts the rows in error of a batch back in the queue, except the interrupted ones.static intretryFile(int nFileId) Puts the rows in error of every completed batch of a file back in the queue, except the interrupted ones.static booleanretryRow(int nRowId) Puts one row in error back in the queue, whatever its error.
-
Field Details
-
INTERRUPTED
Error code of a row interrupted while its appointment was being saved- See Also:
-
-
Method Details
-
retryBatch
public static boolean retryBatch(int nBatchId) Puts the rows in error of a batch back in the queue, except the interrupted ones.- Parameters:
nBatchId- theid_import_batch- Returns:
- true if the batch was put back in the queue, false if it is being processed or archived
-
retryFile
public static int retryFile(int nFileId) Puts the rows in error of every completed batch of a file back in the queue, except the interrupted ones.- Parameters:
nFileId- theid_import_file- Returns:
- the number of batches put back in the queue
-
retryRow
public static boolean retryRow(int nRowId) Puts one row in error back in the queue, whatever its error.- Parameters:
nRowId- theid_import_appointment- Returns:
- true if the row was put back in the queue, false if it is not in error or its batch is being processed or archived
-
correctRow
public static List<AppointmentValidationError> correctRow(int nRowId, Map<String, String> mapGenericAttributes, Map<String, String> mapFormFields, Locale locale) Corrects the values of a row in error, checked as on upload, then puts it back in the queue. The slot of a row cannot be changed: it is the slot of its batch.- Parameters:
nRowId- theid_import_appointmentmapGenericAttributes- the new values of the standard columns, by attribute keymapFormFields- the new values of the form fields, by columnlocale- the locale of the messages- Returns:
- the errors of the new values; empty if the row was corrected and put back in the queue
-