Class DefaultIngestionProcessRepository

    • Field Detail

      • EXPRESSION_LIMIT

        public static final int EXPRESSION_LIMIT
        Maximum limit of inserted/updated records.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultIngestionProcessRepository

        public DefaultIngestionProcessRepository​(Session session)
    • Method Detail

      • updateStatus

        public void updateStatus​(String processId,
                                 String status)
        Updates the status of an ingestion process with the specified id. This implementation assumes that process cannot be in FINISHED status and finished_at timestamp must be null to perform the update.
        Specified by:
        updateStatus in interface IngestionProcessRepository
        Parameters:
        processId - process id
        status - new process status
        Throws:
        IngestionProcessUpdateException - if no rows were updated or more than 1 row was updated
      • updateStatus

        public void updateStatus​(String resourceIngestionDefinitionId,
                                 String ingestionConfigurationId,
                                 String type,
                                 String status)
        Updates the status of an ingestion process with the specified resource ingestion definition id, ingestion configuration, and process type.

        This update method is not recommended, as technically multiple processes can fit the specified criteria. It should only be used when the status update is a part of a resource update. This implementation assumes that process cannot be in FINISHED status and finished_at timestamp must be null to perform the update.

        Specified by:
        updateStatus in interface IngestionProcessRepository
        Parameters:
        resourceIngestionDefinitionId - resource ingestion definition id
        ingestionConfigurationId - ingestion configuration id
        type - process type
        status - new process status
        Throws:
        IngestionProcessUpdateException - if no rows were updated
      • endProcess

        public void endProcess​(String processId)
        Ends an ingestion process with the specified id.

        The ending of the process will set the status to a terminal value and update the process' finishedAt timestamp. This implementation assumes that process cannot be in FINISHED status and finished_at timestamp must be null to perform the update.

        Specified by:
        endProcess in interface IngestionProcessRepository
        Parameters:
        processId - process id
        Throws:
        IngestionProcessUpdateException - if no rows were updated or more than 1 row was updated
      • endProcess

        public void endProcess​(String resourceIngestionDefinitionId,
                               String ingestionConfigurationId,
                               String type)
        Ends an ingestion process with the specified resource ingestion definition id, ingestion configuration, and process type.

        This update method is not recommended, as technically multiple processes can fit the specified criteria. It should only be used when the status update is a part of a resource update.

        The ending of the process will set the status to a terminal value and update the process' finishedAt timestamp. This implementation assumes that process cannot be in FINISHED status and finished_at timestamp must be null to perform the update.

        Specified by:
        endProcess in interface IngestionProcessRepository
        Parameters:
        resourceIngestionDefinitionId - resource ingestion definition id
        ingestionConfigurationId - ingestion configuration id
        type - process type
        Throws:
        IngestionProcessUpdateException - if no rows were updated
      • fetchLastFinished

        public Optional<IngestionProcess> fetchLastFinished​(String resourceIngestionDefinitionId,
                                                            String ingestionConfigurationId,
                                                            String type)
        Description copied from interface: IngestionProcessRepository
        Fetches an ingestion process with the latest finishedAt date and status = FINISHED
        Specified by:
        fetchLastFinished in interface IngestionProcessRepository
        Parameters:
        resourceIngestionDefinitionId - resource ingestion definition id
        ingestionConfigurationId - ingestion configuration id
        type - process type
        Returns:
        ingestion process with the specified id
      • fetchAll

        public List<IngestionProcess> fetchAll​(String resourceIngestionDefinitionId,
                                               String ingestionConfigurationId,
                                               String type)
        Description copied from interface: IngestionProcessRepository
        Fetches all ingestion processes with the specified resource ingestion definition id, ingestion configuration, and process type.
        Specified by:
        fetchAll in interface IngestionProcessRepository
        Parameters:
        resourceIngestionDefinitionId - resource ingestion definition id
        ingestionConfigurationId - ingestion configuration id
        type - process type
        Returns:
        a list containing processes matching the specified criteria
      • fetchAll

        public List<IngestionProcess> fetchAll​(List<String> resourceIngestionDefinitionIds)
        Description copied from interface: CrudIngestionProcessRepository
        Fetches all ingestion processes with resource ingestion definition id contained within the specified list of ids.
        Specified by:
        fetchAll in interface CrudIngestionProcessRepository
        Parameters:
        resourceIngestionDefinitionIds - resource ingestion definition ids
        Returns:
        a list containing processes matching the specified criteria