Class AppointmentImportRetryService

java.lang.Object
fr.paris.lutece.plugins.appointment.modules.importer.service.AppointmentImportRetryService

public final class AppointmentImportRetryService extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Error code of a row interrupted while its appointment was being saved
  • Method Summary

    Modifier and Type
    Method
    Description
    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 boolean
    retryBatch(int nBatchId)
    Puts the rows in error of a batch back in the queue, except the interrupted ones.
    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.
    static boolean
    retryRow(int nRowId)
    Puts one row in error back in the queue, whatever its error.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INTERRUPTED

      public static final String 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 - the id_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 - the id_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 - the id_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 - the id_import_appointment
      mapGenericAttributes - the new values of the standard columns, by attribute key
      mapFormFields - the new values of the form fields, by column
      locale - the locale of the messages
      Returns:
      the errors of the new values; empty if the row was corrected and put back in the queue