Class AbstractRESTPluginWithDatabaseConnection

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.db.DatabaseConnectionUser, adams.flow.core.FlowContextHandler, RESTPlugin, Serializable

    public abstract class AbstractRESTPluginWithDatabaseConnection
    extends AbstractRESTPluginWithFlowContext
    implements adams.db.DatabaseConnectionUser
    Ancestor for REST plugins that require a database connection.
    Call initDatabase() in each REST method that requires a database connection.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
      the database to use.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void initDatabase()
      Initializes the database from the flow context.
      protected void reset()
      Resets the plugin.
      void setFlowContext​(adams.flow.core.Actor value)
      Sets the flow context.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.GlobalInfoSupporter

        globalInfo
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
    • Field Detail

      • m_DatabaseConnection

        protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
        the database to use.
    • Constructor Detail

      • AbstractRESTPluginWithDatabaseConnection

        public AbstractRESTPluginWithDatabaseConnection()
    • Method Detail

      • reset

        protected void reset()
        Resets the plugin.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setFlowContext

        public void setFlowContext​(adams.flow.core.Actor value)
        Sets the flow context.
        Specified by:
        setFlowContext in interface adams.flow.core.FlowContextHandler
        Overrides:
        setFlowContext in class AbstractRESTPluginWithFlowContext
        Parameters:
        value - the actor
      • initDatabase

        protected void initDatabase()
        Initializes the database from the flow context.