Class DeliverFileCommand

  • All Implemented Interfaces:
    org.ikasan.connector.base.command.TransactionalResourceCommand, org.ikasan.connector.listener.TransactionCommitFailureObserverable

    public class DeliverFileCommand
    extends AbstractBaseFileTransferTransactionalResourceCommand
    Delivers a specified payload to a remote directory
    Author:
    Ikasan Development Team
    • Constructor Detail

      • DeliverFileCommand

        public DeliverFileCommand()
        Default Constructor for Hibernate
      • DeliverFileCommand

        public DeliverFileCommand​(java.lang.String outputDirectory,
                                  java.lang.String renameExtension,
                                  boolean overwriteExisting,
                                  boolean createParentDirectory,
                                  java.lang.String tempFileName)
        Constructor
        Parameters:
        outputDirectory -
        renameExtension -
        overwriteExisting -
    • Method Detail

      • doCommit

        protected void doCommit()
                         throws javax.resource.ResourceException
        Commit if file delivery is successful: rename file from its temporary name to actual name. This method will not check for duplicate file names - it simply overwrites anything of the same name regardless of the overwrite flag. This is a commit routine and these types of delivery checks should have already been completed. IMPORTANT NOTE: Operations in this commit method should be kept to a minimum to reduce potential fails on the commit.
        Specified by:
        doCommit in class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
        Throws:
        javax.resource.ResourceException
      • doRollback

        protected void doRollback()
                           throws javax.resource.ResourceException
        Specified by:
        doRollback in class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
        Throws:
        javax.resource.ResourceException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • getFileName

        public java.lang.String getFileName()
        Accessor for FileName
        Returns:
        fileName
      • getTempFileName

        public java.lang.String getTempFileName()
        Accessor for tempFileName
        Returns:
        tempFileName
      • isPutAttempted

        public boolean isPutAttempted()
        Accessor for putAttempted
        Returns:
        putAttempted
      • getOutputDirectory

        public java.lang.String getOutputDirectory()
        Get the output directory
        Returns:
        The directory where we output the file to
      • isOverwriteExisting

        public boolean isOverwriteExisting()
        Check if we overwrite the existing file
        Returns:
        true if we overwrite else false