Interface PersistenceHandlerIfc

All Known Implementing Classes:
FileBasedPersistenceHandler

public interface PersistenceHandlerIfc
The PersistenceHandlerIfc interface defines methods for handling persistence operations related to imports. Implementations of this interface provide functionality for accessing and storing import-related data.
  • Method Details

    • getCustomization

      byte[] getCustomization(String id) throws ImportDetailNotFoundException
      Retrieves the customization file content for the specified import ID.
      Parameters:
      id - The unique identifier for the import.
      Returns:
      The byte array representing the customization file content.
      Throws:
      ImportDetailNotFoundException - If the import detail is not found.
    • getConfiguration

      String getConfiguration(String id) throws ImportDetailNotFoundException
      Retrieves the configuration file content for the specified import ID.
      Parameters:
      id - The unique identifier for the import.
      Returns:
      The string representing the configuration file content.
      Throws:
      ImportDetailNotFoundException - If the import detail is not found.
    • getImportMetadata

      ImportMetadata getImportMetadata(String id) throws ImportDetailNotFoundException
      Retrieves the import metadata for the specified import ID.
      Parameters:
      id - The unique identifier for the import.
      Returns:
      The ImportMetadata object representing the import metadata.
      Throws:
      ImportDetailNotFoundException - If the import detail is not found.
    • saveConfiguration

      void saveConfiguration(String importId, String fileContent) throws IOException
      Saves the configuration file content for the specified import ID.
      Parameters:
      importId - The unique identifier for the import.
      fileContent - The content of the configuration file to be saved.
      Throws:
      IOException - If an I/O error occurs while saving the configuration.
    • saveCustomization

      void saveCustomization(String id, byte[] fileContent) throws IOException
      Saves the customization file content for the specified import ID.
      Parameters:
      id - The unique identifier for the import.
      fileContent - The content of the customization file to be saved.
      Throws:
      IOException - If an I/O error occurs while saving the customization.
    • saveImportMetadata

      void saveImportMetadata(String id, ImportMetadata importMetadata) throws IOException
      Saves the import metadata for the specified import ID.
      Parameters:
      id - The unique identifier for the import.
      importMetadata - The ImportMetadata object representing the import metadata to be saved.
      Throws:
      IOException - If an I/O error occurs while saving the import metadata.
    • createTask

      boolean createTask(String importId, ImportTaskItem item) throws IOException
      Creates an import task for the specified import ID with the given task item.
      Parameters:
      importId - The unique identifier for the import.
      item - The ImportTaskItem representing the import task to be created.
      Returns:
      True if the task is successfully created, false otherwise.
      Throws:
      IOException - If an I/O error occurs while creating the import task.
    • updateTask

      void updateTask(String importId, String importTaskId, PersistenceHandlerIfc.ImportTaskUpdateCallback callback) throws IOException
      Updates the import task for the specified import ID and task ID using the provided callback.
      Parameters:
      importId - The unique identifier for the import.
      importTaskId - The unique identifier for the import task.
      callback - The callback function to update the import task item.
      Throws:
      IOException - If an I/O error occurs while updating the import task.
    • getImportTask

      Optional<ImportTaskItem> getImportTask(String importId, String importTaskId) throws IOException
      Retrieves the import task for the specified import ID and task ID.
      Parameters:
      importId - The unique identifier for the import.
      importTaskId - The unique identifier for the import task.
      Returns:
      An optional ImportTaskItem if found, otherwise empty.
      Throws:
      IOException - If an I/O error occurs while retrieving the import task.
    • deleteImport

      boolean deleteImport(String importId) throws IOException
      Deletes the import data associated with the specified import ID.
      Parameters:
      importId - The unique identifier for the import.
      Returns:
      True if the import data is successfully deleted, false otherwise.
      Throws:
      IOException - If an I/O error occurs while deleting the import data.