Class SpectralDbBackend

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.db.BackendManager, SpectralDbBackend, Serializable

    public class SpectralDbBackend
    extends AbstractSpectralDbBackend
    MySQL Spectral backend.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Mirrors

        protected adams.db.AbstractDatabaseConnection[] m_Mirrors
        the database connections of the mirrors.
      • m_MirrorsForUrls

        protected adams.db.JdbcUrl[] m_MirrorsForUrls
        the urls the mirrors are for.
      • m_NonMirroredBackend

        protected SpectralDbBackend m_NonMirroredBackend
        the default backend.
    • Constructor Detail

      • SpectralDbBackend

        public SpectralDbBackend()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setMirrors

        public void setMirrors​(adams.db.AbstractDatabaseConnection[] value)
        Sets the mirror connections to use.
        Parameters:
        value - the connections
      • getMirrors

        public adams.db.AbstractDatabaseConnection[] getMirrors()
        Returns the mirror connections in use.
        Returns:
        the connections
      • mirrorsTipText

        public String mirrorsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMirrorsForUrls

        public void setMirrorsForUrls​(adams.db.JdbcUrl[] value)
        Sets the URLs that the mirrors are for.
        Parameters:
        value - the urls
      • getMirrorsForUrls

        public adams.db.JdbcUrl[] getMirrorsForUrls()
        Returns the URLs that the mirrors are for.
        Returns:
        the urls
      • mirrorsForUrlsTipText

        public String mirrorsForUrlsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setBackends

        public void setBackends​(SpectralDbBackend[] value)
        Sets the backends to use.
        Parameters:
        value - the backends
      • getBackends

        public SpectralDbBackend[] getBackends()
        Returns the backends in use.
        Returns:
        the backends
      • backendsTipText

        public String backendsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNonMirroredBackend

        public void setNonMirroredBackend​(SpectralDbBackend value)
        Sets the backend to use for non-mirrored connections.
        Parameters:
        value - the backend
      • getNonMirroredBackend

        public SpectralDbBackend getNonMirroredBackend()
        Returns the backend to use for non-mirrored connections.
        Returns:
        the backend
      • nonMirroredBackendTipText

        public String nonMirroredBackendTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getMirrorFor

        protected adams.db.AbstractDatabaseConnection getMirrorFor​(adams.db.AbstractDatabaseConnection conn)
        Returns the corresponding mirror for the connection URL provided.
        Parameters:
        conn - the URL to get the mirror for
        Returns:
        the mirror, null if no mirror
      • getBackendFor

        protected SpectralDbBackend getBackendFor​(adams.db.AbstractDatabaseConnection conn)
        Returns the corresponding backend for the connection URL provided.
        Parameters:
        conn - the URL to get the backend for
        Returns:
        the backend, null if no backend
      • canMirror

        protected boolean canMirror​(adams.db.AbstractDatabaseConnection conn)
        Checks whether connection can be mirrored.
        Parameters:
        conn - the connection to check
        Returns:
        true if can be mirrored
      • getSpectrum

        public SpectrumIntf getSpectrum​(adams.db.AbstractDatabaseConnection conn)
        Returns the handler for the spectrum table.
        Parameters:
        conn - the database connection
        Returns:
        the handler
      • getSampleData

        public SampleDataIntf getSampleData​(adams.db.AbstractDatabaseConnection conn)
        Returns the handler for the sample data table.
        Parameters:
        conn - the database connection
        Returns:
        the handler