org.ikasan.connector.basefiletransfer.outbound.command
Class DeliverFileCommand

java.lang.Object
  extended by org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
      extended by org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
          extended by org.ikasan.connector.basefiletransfer.outbound.command.DeliverFileCommand
All Implemented Interfaces:
TransactionalResourceCommand

public class DeliverFileCommand
extends AbstractBaseFileTransferTransactionalResourceCommand

Delivers a specified payload to a remote directory

Author:
Ikasan Development Team

Field Summary
 
Fields inherited from class org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
CURRENT_DIRECTORY, EOL, fileSeparator
 
Fields inherited from class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
COMMIT_IN_PROGRESS, COMPLETED_COMMITTING, EXECUTED_STATE, EXECUTION_IN_PROGRESS, executionContext, INITIALISED_STATE, ROLLBACK_IN_PROGRESS, ROLLED_BACK_STATE, transactionalResource
 
Constructor Summary
DeliverFileCommand()
          Default Constructor for Hibernate
DeliverFileCommand(java.lang.String outputDirectory, java.lang.String renameExtension, boolean overwriteExisting)
          Constructor
 
Method Summary
protected  void doCommit()
          Commit if file delivery is successful: rename file from its temporary name to actual name.
protected  void doRollback()
           
 java.lang.String getFileName()
          Accessor for FileName
 java.lang.String getOutputDirectory()
          Get the output directory
 java.lang.String getTempFileName()
          Accessor for tempFileName
 boolean isOverwriteExisting()
          Check if we overwrite the existing file
 boolean isPutAttempted()
          Accessor for putAttempted
protected  ExecutionOutput performExecute()
          execute method for subclasses to implement
 java.lang.String toString()
           
 
Methods inherited from class org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
changeDirectory, deleteDir, deleteFile, doExecute, findFile, getClient, getContentAsStream, getFile, getFile, listDirectory, logFileList, printWorkingDirectoryName, putFile, putWithOutputStream, renameFile
 
Methods inherited from class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
commit, execute, getBeanFactory, getExecutionTimestamp, getId, getState, getXid, rollback, setBeanFactory, setExecutionContext, setTransactionalResource, setTransactionJournal, setXid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeliverFileCommand

public DeliverFileCommand()
Default Constructor for Hibernate


DeliverFileCommand

public DeliverFileCommand(java.lang.String outputDirectory,
                          java.lang.String renameExtension,
                          boolean overwriteExisting)
Constructor

Parameters:
outputDirectory -
renameExtension -
overwriteExisting -
Method Detail

performExecute

protected ExecutionOutput performExecute()
                                  throws javax.resource.ResourceException
Description copied from class: AbstractBaseFileTransferTransactionalResourceCommand
execute method for subclasses to implement

Specified by:
performExecute in class AbstractBaseFileTransferTransactionalResourceCommand
Returns:
ExecutionOutput
Throws:
javax.resource.ResourceException - -

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 AbstractTransactionalResourceCommand
Throws:
javax.resource.ResourceException

doRollback

protected void doRollback()
                   throws javax.resource.ResourceException
Specified by:
doRollback in class 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


Copyright © 2007-2010 Ikasan. All Rights Reserved.