Class DeliverFileCommand
- java.lang.Object
-
- org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
-
- org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
-
- org.ikasan.connector.basefiletransfer.outbound.command.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
-
-
Field Summary
-
Fields inherited from class org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
CURRENT_DIRECTORY, EOL, fileSeparator, listeners
-
-
Constructor Summary
Constructors Constructor Description DeliverFileCommand()Default Constructor for HibernateDeliverFileCommand(java.lang.String outputDirectory, java.lang.String renameExtension, boolean overwriteExisting, boolean createParentDirectory, java.lang.String tempFileName)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCommit()Commit if file delivery is successful: rename file from its temporary name to actual name.protected voiddoRollback()java.lang.StringgetFileName()Accessor for FileNamejava.lang.StringgetOutputDirectory()Get the output directoryjava.lang.StringgetTempFileName()Accessor for tempFileNamebooleanisOverwriteExisting()Check if we overwrite the existing filebooleanisPutAttempted()Accessor for putAttemptedprotected org.ikasan.connector.base.command.ExecutionOutputperformExecute()execute method for subclasses to implementjava.lang.StringtoString()-
Methods inherited from class org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
addListener, changeDirectory, deleteDir, deleteFile, doExecute, findFile, getClient, getContentAsStream, getFile, getFile, listDirectory, logFileList, notifyListeners, printWorkingDirectoryName, putFile, putWithOutputStream, renameFile
-
-
-
-
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
-
performExecute
protected org.ikasan.connector.base.command.ExecutionOutput performExecute() throws javax.resource.ResourceExceptionDescription copied from class:AbstractBaseFileTransferTransactionalResourceCommandexecute method for subclasses to implement- Specified by:
performExecutein classAbstractBaseFileTransferTransactionalResourceCommand- Returns:
- ExecutionOutput
- Throws:
javax.resource.ResourceException- -
-
doCommit
protected void doCommit() throws javax.resource.ResourceExceptionCommit 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:
doCommitin classorg.ikasan.connector.base.command.AbstractTransactionalResourceCommand- Throws:
javax.resource.ResourceException
-
doRollback
protected void doRollback() throws javax.resource.ResourceException- Specified by:
doRollbackin classorg.ikasan.connector.base.command.AbstractTransactionalResourceCommand- Throws:
javax.resource.ResourceException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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
-
-