Class BaseTransformMeta<Main extends ITransform,​Data extends ITransformData>

    • Constructor Detail

      • BaseTransformMeta

        public BaseTransformMeta()
    • Method Detail

      • createTransformData

        public ITransformData createTransformData()
        Description copied from interface: ITransformMeta
        Create a new instance of the appropriate data class. This data class implements the ITransformData. It basically contains the persisting data that needs to live on, even if a worker thread is terminated.
        Specified by:
        createTransformData in interface ITransformMeta
        Returns:
        The appropriate ITransformData class.
      • clone

        public Object clone()
        Description copied from interface: ITransformMeta
        Make an exact copy of this transform, make sure to explicitly copy Collections etc.
        Specified by:
        clone in interface ITransformMeta
        Overrides:
        clone in class Object
        Returns:
        an exact copy of this transform
      • setChanged

        public void setChanged​(boolean ch)
        Sets the changed.
        Parameters:
        ch - the new changed
      • hasChanged

        public boolean hasChanged()
        Checks for changed.
        Specified by:
        hasChanged in interface ITransformMeta
        Returns:
        true, if successful
      • getXml

        public String getXml()
                      throws HopException
        Produces the XML string that describes this transform's information.
        Specified by:
        getXml in interface ITransformMeta
        Returns:
        String containing the XML describing this transform.
        Throws:
        HopException - in case there is an XML conversion or encoding error
      • getFields

        public void getFields​(IRowMeta inputRowMeta,
                              String name,
                              IRowMeta[] info,
                              TransformMeta nextTransform,
                              IVariables variables,
                              IHopMetadataProvider metadataProvider)
                       throws HopTransformException
        Gets the fields.
        Specified by:
        getFields in interface ITransformMeta
        Parameters:
        inputRowMeta - the input row meta that is modified in this method to reflect the output row metadata of the transform
        name - Name of the transform to use as input for the origin field in the values
        info - Fields used as extra lookup information
        nextTransform - the next transform that is targeted
        variables - the variables The variable variables to use to replace variables
        metadataProvider - the MetaStore to use to load additional external data or metadata impacting the output fields
        Throws:
        HopTransformException - the hop transform exception
      • analyseImpact

        public void analyseImpact​(IVariables variables,
                                  List<DatabaseImpact> impact,
                                  PipelineMeta pipelineMeta,
                                  TransformMeta transformMeta,
                                  IRowMeta prev,
                                  String[] input,
                                  String[] output,
                                  IRowMeta info,
                                  IHopMetadataProvider metadataProvider)
                           throws HopTransformException
        Each transform must be able to report on the impact it has on a database, table field, etc.
        Specified by:
        analyseImpact in interface ITransformMeta
        Parameters:
        variables - The variables to use to resolve expressions
        impact - The list of impacts @see org.apache.hop.pipelineMeta.DatabaseImpact
        pipelineMeta - The pipeline information
        transformMeta - The transform information
        prev - The fields entering this transform
        input - The previous transform names
        output - The output transform names
        info - The fields used as information by this transform
        metadataProvider - the MetaStore to use to load additional external data or metadata impacting the output fields
        Throws:
        HopTransformException
      • getSqlStatements

        public SqlStatement getSqlStatements​(IVariables variables,
                                             PipelineMeta pipelineMeta,
                                             TransformMeta transformMeta,
                                             IRowMeta prev,
                                             IHopMetadataProvider metadataProvider)
                                      throws HopTransformException
        Standard method to return an SqlStatement object with Sql statements that the transform needs in order to work correctly. This can mean "create table", "create index" statements but also "alter table ... add/drop/modify" statements.
        Specified by:
        getSqlStatements in interface ITransformMeta
        Parameters:
        variables -
        pipelineMeta - PipelineMeta object containing the complete pipeline
        transformMeta - TransformMeta object containing the complete transform
        prev - Row containing meta-data for the input fields (no data)
        metadataProvider - the MetaStore to use to load additional external data or metadata impacting the output fields
        Returns:
        The Sql Statements for this transform. If nothing has to be done, the SqlStatement.getSql() == null. @see SqlStatement
        Throws:
        HopTransformException
      • getRequiredFields

        public IRowMeta getRequiredFields​(IVariables variables)
                                   throws HopException
        The natural way of data flow in a pipeline is source-to-target. However, this makes mapping to target tables difficult to do. To help out here, we supply information to the pipeline meta-data model about which fields are required for a transform. This allows us to automate certain tasks like the mapping to pre-defined tables. The Table Output transform in this case will output the fields in the target table using this method.

        This default implementation returns an empty row meaning that no fields are required for this transform to operate.

        Specified by:
        getRequiredFields in interface ITransformMeta
        Parameters:
        variables - the variable variables to use to do variable substitution.
        Returns:
        the required fields for this transforms meta data.
        Throws:
        HopException - in case the required fields can't be determined
      • getUsedDatabaseConnections

        @Deprecated(since="2.0")
        public DatabaseMeta[] getUsedDatabaseConnections()
        Deprecated.
        This method returns all the database connections that are used by the transform.
        Returns:
        an array of database connections meta-data. Return an empty array if no connections are used.
      • supportsErrorHandling

        public boolean supportsErrorHandling()
        Specified by:
        supportsErrorHandling in interface ITransformMeta
        Returns:
        true if this transform supports error "reporting" on rows: the ability to send rows to a certain target transform.
      • excludeFromRowLayoutVerification

        public boolean excludeFromRowLayoutVerification()
        This method is added to exclude certain transforms from layout checking.
        Specified by:
        excludeFromRowLayoutVerification in interface ITransformMeta
      • excludeFromCopyDistributeVerification

        public boolean excludeFromCopyDistributeVerification()
        This method is added to exclude certain transforms from copy/distribute checking.
        Specified by:
        excludeFromCopyDistributeVerification in interface ITransformMeta
      • getDialogClassName

        public String getDialogClassName()
         * This returns the expected name for the dialog that edits a action. The expected name is in the org.apache.hop.ui  * tree and has a class name that is the name of the action with 'Dialog' added to the end.  *

         * e.g. if the action is org.apache.hop.workflow.actions.zipfile.JobEntryZipFile the dialog would be  * org.apache.hop.ui.workflow.actions.zipfile.JobEntryZipFileDialog  *

         * If the dialog class for a action does not match this pattern it should override this method and return the  * appropriate class name  *  * @return full class name of the dialog 

        Specified by:
        getDialogClassName in interface ITransformMeta
      • setParentTransformMeta

        public void setParentTransformMeta​(TransformMeta parentTransformMeta)
        Sets the parent transform meta.
        Specified by:
        setParentTransformMeta in interface ITransformMeta
        Parameters:
        parentTransformMeta - the new parent transform meta
      • getLog

        public ILogChannel getLog()
        Gets the log.
        Returns:
        the log
      • isBasic

        public boolean isBasic()
        Checks if is basic.
        Returns:
        true, if is basic
      • isDetailed

        public boolean isDetailed()
        Checks if is detailed.
        Returns:
        true, if is detailed
      • isDebug

        public boolean isDebug()
        Checks if is debug.
        Returns:
        true, if is debug
      • isRowLevel

        public boolean isRowLevel()
        Checks if is row level.
        Returns:
        true, if is row level
      • logMinimal

        public void logMinimal​(String message)
        Log minimal.
        Parameters:
        message - the message
      • logMinimal

        public void logMinimal​(String message,
                               Object... arguments)
        Log minimal.
        Parameters:
        message - the message
        arguments - the arguments
      • logBasic

        public void logBasic​(String message)
        Log basic.
        Parameters:
        message - the message
      • logBasic

        public void logBasic​(String message,
                             Object... arguments)
        Log basic.
        Parameters:
        message - the message
        arguments - the arguments
      • logDetailed

        public void logDetailed​(String message)
        Log detailed.
        Parameters:
        message - the message
      • logDetailed

        public void logDetailed​(String message,
                                Object... arguments)
        Log detailed.
        Parameters:
        message - the message
        arguments - the arguments
      • logDebug

        public void logDebug​(String message)
        Log debug.
        Parameters:
        message - the message
      • logDebug

        public void logDebug​(String message,
                             Object... arguments)
        Log debug.
        Parameters:
        message - the message
        arguments - the arguments
      • logRowlevel

        public void logRowlevel​(String message)
        Log rowlevel.
        Parameters:
        message - the message
      • logRowlevel

        public void logRowlevel​(String message,
                                Object... arguments)
        Log rowlevel.
        Parameters:
        message - the message
        arguments - the arguments
      • logError

        public void logError​(String message)
        Log error.
        Parameters:
        message - the message
      • logError

        public void logError​(String message,
                             Throwable e)
        Log error.
        Parameters:
        message - the message
        e - the e
      • logError

        public void logError​(String message,
                             Object... arguments)
        Log error.
        Parameters:
        message - the message
        arguments - the arguments
      • getLogChannelId

        public String getLogChannelId()
        Gets the log channel id.
        Returns:
        the log channel id
      • getName

        public String getName()
        Gets the name.
        Returns:
        the name
      • getObjectCopy

        public String getObjectCopy()
        Gets the object copy.
        Returns:
        the object copy
      • getObjectType

        public LoggingObjectType getObjectType()
        Gets the object type.
        Returns:
        the object type
      • getParent

        public ILoggingObject getParent()
        Gets the parent.
        Returns:
        the parent
      • getTransformIOMeta

        public ITransformIOMeta getTransformIOMeta​(boolean createIfAbsent)
        Returns the Input/Output metadata for this transform. By default, each transform produces and accepts optional input.
      • setTransformIOMeta

        public void setTransformIOMeta​(ITransformIOMeta value)
        Sets the Input/Output metadata for this transform. By default, each transform produces and accepts optional input.
        Parameters:
        value - the ITransformIOMeta to set for this transform.
      • getOptionalStreams

        public List<IStream> getOptionalStreams()
        Specified by:
        getOptionalStreams in interface ITransformMeta
        Returns:
        The list of optional input streams. It allows the user to select from a list of possible actions like "New target transform"
      • handleStreamSelection

        public void handleStreamSelection​(IStream stream)
        When an optional stream is selected, this method is called to handled the ETL metadata implications of that.
        Specified by:
        handleStreamSelection in interface ITransformMeta
        Parameters:
        stream - The optional stream to handle.
      • searchInfoAndTargetTransforms

        public void searchInfoAndTargetTransforms​(List<TransformMeta> transforms)
        Change transform names into transform objects to allow them to be name-changed etc.
        Specified by:
        searchInfoAndTargetTransforms in interface ITransformMeta
        Parameters:
        transforms - the transforms to reference
      • convertIOMetaToTransformNames

        public void convertIOMetaToTransformNames()
        Description copied from interface: ITransformMeta
        Convert defined IOMeta information to transform metadata. This is the inverse of method searchInfoAndTargetTransforms()
        Specified by:
        convertIOMetaToTransformNames in interface ITransformMeta
      • getSupportedPipelineTypes

        public PipelineMeta.PipelineType[] getSupportedPipelineTypes()
        Returns:
        The supported pipeline types that this transform supports.
      • getReferencedObjectDescriptions

        public String[] getReferencedObjectDescriptions()
        Specified by:
        getReferencedObjectDescriptions in interface ITransformMeta
        Returns:
        The objects referenced in the transform, like a mapping, a pipeline, a workflow, ...
      • isReferencedObjectEnabled

        public boolean[] isReferencedObjectEnabled()
        Specified by:
        isReferencedObjectEnabled in interface ITransformMeta
        Returns:
        true for each referenced object that is enabled or has a valid reference definition.
      • getActiveReferencedObjectDescription

        public String getActiveReferencedObjectDescription()
        Specified by:
        getActiveReferencedObjectDescription in interface ITransformMeta
        Returns:
        A description of the active referenced object in a pipeline. Null if nothing special needs to be done or if the active metadata isn't different from design.