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

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.RetrieveFileCommand
All Implemented Interfaces:
TransactionalResourceCommand
Direct Known Subclasses:
ChunkingRetrieveFileCommand

public class RetrieveFileCommand
extends AbstractBaseFileTransferTransactionalResourceCommand

Retrieves a specified file from a remote directory

Author:
Ikasan Development Team

Field Summary
protected  BaseFileTransferDao dao
          Data Access Object for Base File Transfer
protected  boolean destructive
          Whether or not to destroy the file after we pick it up
protected  java.lang.String renameExtension
          Extension with which to rename successfully retrieved files
protected  boolean renameOnSuccess
          Rename the file on successful retrieval
protected  java.lang.String sourcePath
          The original source path of the file we are retrieving
 
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
protected RetrieveFileCommand()
          No args constructor required by Hibernate
  RetrieveFileCommand(BaseFileTransferDao dao, boolean renameOnSuccess, java.lang.String renameExtension, boolean moveOnSuccess, java.lang.String moveOnSuccessNewPath, boolean destructive)
          Constructor
 
Method Summary
protected  void doCommit()
          (non-Javadoc)
protected  void doRollback()
          (non-Javadoc)
 java.lang.String getMoveNewPath()
          Get the new path a file is being moved to.
 java.lang.String getRenameExtension()
          Get the extension that we'rerenaming the file with
 java.lang.String getSourcePath()
          Accessor method for source path
 boolean isDestructive()
          Do we delete the file on successful delivery?
 boolean isMoveOnSuccess()
          Do we move the file on successful delivery?
 boolean isRenameOnSuccess()
          Do we rename the file on successful delivery?
protected  ExecutionOutput performExecute()
          (non-Javadoc)
 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
 

Field Detail

dao

protected BaseFileTransferDao dao
Data Access Object for Base File Transfer


sourcePath

protected java.lang.String sourcePath
The original source path of the file we are retrieving


renameOnSuccess

protected boolean renameOnSuccess
Rename the file on successful retrieval


renameExtension

protected java.lang.String renameExtension
Extension with which to rename successfully retrieved files


destructive

protected boolean destructive
Whether or not to destroy the file after we pick it up

Constructor Detail

RetrieveFileCommand

protected RetrieveFileCommand()
No args constructor required by Hibernate


RetrieveFileCommand

public RetrieveFileCommand(BaseFileTransferDao dao,
                           boolean renameOnSuccess,
                           java.lang.String renameExtension,
                           boolean moveOnSuccess,
                           java.lang.String moveOnSuccessNewPath,
                           boolean destructive)
Constructor

Parameters:
dao - hibernateDAO
renameOnSuccess - flag
renameExtension - to rename file
moveOnSuccess - flag
moveOnSuccessNewPath - to move file
destructive - flag
Method Detail

performExecute

protected ExecutionOutput performExecute()
                                  throws javax.resource.ResourceException
(non-Javadoc)

Specified by:
performExecute in class AbstractBaseFileTransferTransactionalResourceCommand
Returns:
ExecutionOutput
Throws:
javax.resource.ResourceException - -
See Also:
AbstractBaseFileTransferTransactionalResourceCommand.performExecute()

doCommit

protected void doCommit()
                 throws javax.resource.ResourceException
(non-Javadoc)

Specified by:
doCommit in class AbstractTransactionalResourceCommand
Throws:
javax.resource.ResourceException
See Also:
AbstractTransactionalResourceCommand.doCommit()

doRollback

protected void doRollback()
(non-Javadoc)

Specified by:
doRollback in class AbstractTransactionalResourceCommand
See Also:
AbstractTransactionalResourceCommand.doRollback()

toString

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

getSourcePath

public java.lang.String getSourcePath()
Accessor method for source path

Returns:
sourcePath

isRenameOnSuccess

public boolean isRenameOnSuccess()
Do we rename the file on successful delivery?

Returns:
true if we rename, else false

getRenameExtension

public java.lang.String getRenameExtension()
Get the extension that we'rerenaming the file with

Returns:
file extension for the renamed file

isDestructive

public boolean isDestructive()
Do we delete the file on successful delivery?

Returns:
true if we delete, else false

isMoveOnSuccess

public boolean isMoveOnSuccess()
Do we move the file on successful delivery?

Returns:
moveOnSuccess

getMoveNewPath

public java.lang.String getMoveNewPath()
Get the new path a file is being moved to.

Returns:
moveNewPath


Copyright © 2007-2010 Ikasan. All Rights Reserved.