Class LargeObjectDbWriter

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, DatabaseConnectionUser, VariableChangeListener, Actor, ErrorHandler, InputConsumer, Serializable, Comparable

    public class LargeObjectDbWriter
    extends AbstractDbSink
    Allows storing large objects in a SQL database.

    Input/output:
    - accepts:
       adams.flow.core.Unknown


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: LargeObjectDbWriter
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
     
    -blob-conversion <adams.data.conversion.Conversion> (property: blobConversion)
        The conversion to apply to turn BLOB objects into byte arrays.
        default: adams.data.conversion.UnknownToUnknown
     
    -type <BLOB|CLOB> (property: type)
        The type of large object to store.
        default: BLOB
     
    -query <adams.db.SQLStatement> (property: query)
        The query to execute for storing the large objects; objects get attached
        to the first column of the UPDATE/INSERT statement.
        default:
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Query

        protected SQLStatement m_Query
        the SQL statement to execute.
      • m_BlobConversion

        protected Conversion m_BlobConversion
        the conversion to use blobs.
    • Constructor Detail

      • LargeObjectDbWriter

        public LargeObjectDbWriter()
    • Method Detail

      • setBlobConversion

        public void setBlobConversion​(Conversion value)
        Sets the conversion to apply to BLOB byte arrays.
        Parameters:
        value - the conversion
      • getBlobConversion

        public Conversion getBlobConversion()
        Returns the conversion to apply to BLOB byte arrays.
        Returns:
        the conversion
      • blobConversionTipText

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

        public void setType​(LargeObjectType value)
        Sets the type to use.
        Parameters:
        value - the type
      • getType

        public LargeObjectType getType()
        Returns the type to use.
        Returns:
        the type
      • typeTipText

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

        public void setQuery​(SQLStatement value)
        Sets the query to use.
        Parameters:
        value - the query
      • getQuery

        public SQLStatement getQuery()
        Returns the query to use.
        Returns:
        the query
      • queryTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        the Class of objects that can be processed
      • queryDatabase

        protected String queryDatabase()
        Performs the actual database query.
        Specified by:
        queryDatabase in class AbstractDbSink
        Returns:
        null if everything is fine, otherwise error message