Interface IISDStateDBConnector

  • All Known Implementing Classes:
    Postgres_StateDBConnector

    public interface IISDStateDBConnector
    This is the public interface for classes used to access the processing pipeline's state of operation tables.
    Author:
    Dustin Kempton, Surabhi Priya, Data Mining Lab, Georgia State University
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean checkOKToProcess​(EventType type)
      Checks if this part of the processing pipeline is cleared to run its operations again.
      org.joda.time.DateTime getLastProcessedTime​(EventType type)
      Gets the last report time this part of the processing pipeline successfully executed its operations on.
      boolean setFinishedProcessing​(EventType type)
      Sets a processing flag to allow other parts of the processing pipeline to execute since this process has finished its operations.
      boolean setIsProcessing​(EventType type)
      Sets a processing flag to keep other parts of the processing pipeline from executing while this part is still performing its operations.
      boolean updateLastProcessedTime​(EventType type, org.joda.time.DateTime processedTime)
      Updates the state table with the passed in datetime to indicate the last report time this part of the processing pipeline successfully executed.
    • Method Detail

      • checkOKToProcess

        boolean checkOKToProcess​(EventType type)
                          throws SQLException
        Checks if this part of the processing pipeline is cleared to run its operations again.
        Parameters:
        type - The ISD Solar Event type that the processing flag is to be checked for.
        Returns:
        True if this part of the processing pipeline is cleared to run.
        Throws:
        SQLException - If there was an SQLException that occurred while attempting to execute.
      • setIsProcessing

        boolean setIsProcessing​(EventType type)
                         throws SQLException
        Sets a processing flag to keep other parts of the processing pipeline from executing while this part is still performing its operations.
        Parameters:
        type - The ISD Solar Event type that the is processing flag is to be set for.
        Returns:
        True if successfully set the processing flag, False otherwise.
        Throws:
        SQLException - If there was an SQLException that occurred while attempting to execute.
      • setFinishedProcessing

        boolean setFinishedProcessing​(EventType type)
                               throws SQLException,
                                      IllegalAccessException
        Sets a processing flag to allow other parts of the processing pipeline to execute since this process has finished its operations.
        Parameters:
        type - The ISD Solar Event type that the is processing flag is to be set for.
        Returns:
        True if successfully set the processing flag, False otherwise.
        Throws:
        SQLException - If there was an SQLException that occurred while attempting to execute.
        IllegalAccessException - If this is called for a process that has not been working on the given table. So, the state is not being set to 'FALSE' to avoid some possible mistakes.
      • updateLastProcessedTime

        boolean updateLastProcessedTime​(EventType type,
                                        org.joda.time.DateTime processedTime)
                                 throws SQLException
        Updates the state table with the passed in datetime to indicate the last report time this part of the processing pipeline successfully executed.
        Parameters:
        type - The ISD Solar Event type that the processed time is to be updated for.
        processedTime - The time to update the database with.
        Returns:
        True if update was successful, False otherwise.
        Throws:
        SQLException - If there was an SQLException that occurred while attempting to execute.
      • getLastProcessedTime

        org.joda.time.DateTime getLastProcessedTime​(EventType type)
                                             throws SQLException
        Gets the last report time this part of the processing pipeline successfully executed its operations on. This is to know what data to process in HEK and update in the ISD database.
        Parameters:
        type - The ISD Solar Event type that the processed time is to be checked for.
        Returns:
        The date and time of the last time this part of the processing pipeline executed its operations.
        Throws:
        SQLException - If there was an SQLException that occurred while attempting to execute.