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

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
              extended by org.ikasan.connector.basefiletransfer.outbound.command.ChunkingRetrieveFileCommand
All Implemented Interfaces:
TransactionalResourceCommand, ChunkableDataProvider

public class ChunkingRetrieveFileCommand
extends RetrieveFileCommand
implements ChunkableDataProvider

Retrieves a specified file from a remote directory

Author:
Ikasan Development Team

Field Summary
 
Fields inherited from class org.ikasan.connector.basefiletransfer.outbound.command.RetrieveFileCommand
dao, destructive, renameExtension, renameOnSuccess, sourcePath
 
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
ChunkingRetrieveFileCommand(BaseFileTransferDao dao, java.lang.String clientId, boolean renameOnSuccess, java.lang.String renameExtension, boolean moveOnSuccess, java.lang.String moveNewPath, FileChunkDao fileChunkDao, int chunkSize, boolean destructive)
          Constructor
 
Method Summary
 void connect()
           
 void disconnect()
           
 long getFileSize(java.lang.String remoteDir, java.lang.String fileName)
           
 java.lang.String getSourcePath()
          Accessor method for source path
protected  ExecutionOutput performExecute()
          (non-Javadoc)
 java.io.InputStream sourceChunkableData(java.lang.String remoteDir, java.lang.String fileName)
           
 void sourceChunkableData(java.lang.String remoteDir, java.lang.String fileName, java.io.OutputStream outputStream, long offset)
           
 java.lang.String toString()
           
 
Methods inherited from class org.ikasan.connector.basefiletransfer.outbound.command.RetrieveFileCommand
doCommit, doRollback, getMoveNewPath, getRenameExtension, isDestructive, isMoveOnSuccess, isRenameOnSuccess
 
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

ChunkingRetrieveFileCommand

public ChunkingRetrieveFileCommand(BaseFileTransferDao dao,
                                   java.lang.String clientId,
                                   boolean renameOnSuccess,
                                   java.lang.String renameExtension,
                                   boolean moveOnSuccess,
                                   java.lang.String moveNewPath,
                                   FileChunkDao fileChunkDao,
                                   int chunkSize,
                                   boolean destructive)
Constructor

Parameters:
dao -
clientId -
renameOnSuccess -
renameExtension -
moveOnSuccess -
moveNewPath -
fileChunkDao -
chunkSize -
destructive -
Method Detail

performExecute

protected ExecutionOutput performExecute()
                                  throws javax.resource.ResourceException
Description copied from class: RetrieveFileCommand
(non-Javadoc)

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

toString

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

getSourcePath

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

Overrides:
getSourcePath in class RetrieveFileCommand
Returns:
sourcePath

connect

public void connect()
Specified by:
connect in interface ChunkableDataProvider

disconnect

public void disconnect()
Specified by:
disconnect in interface ChunkableDataProvider

getFileSize

public long getFileSize(java.lang.String remoteDir,
                        java.lang.String fileName)
                 throws ChunkableDataSourceException
Specified by:
getFileSize in interface ChunkableDataProvider
Throws:
ChunkableDataSourceException

sourceChunkableData

public java.io.InputStream sourceChunkableData(java.lang.String remoteDir,
                                               java.lang.String fileName)
                                        throws ChunkableDataSourceException
Specified by:
sourceChunkableData in interface ChunkableDataProvider
Throws:
ChunkableDataSourceException

sourceChunkableData

public void sourceChunkableData(java.lang.String remoteDir,
                                java.lang.String fileName,
                                java.io.OutputStream outputStream,
                                long offset)
                         throws ChunkableDataSourceException
Specified by:
sourceChunkableData in interface ChunkableDataProvider
Throws:
ChunkableDataSourceException


Copyright © 2007-2010 Ikasan. All Rights Reserved.