|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ikasan.connector.base.command.AbstractTransactionalResourceCommand
org.ikasan.connector.basefiletransfer.outbound.command.AbstractBaseFileTransferTransactionalResourceCommand
public abstract class AbstractBaseFileTransferTransactionalResourceCommand
This is the base class for all FileTransfer oriented TranasactionalResourceCommands This exists simply to provide access to all common low level File Transfer operations
| Field Summary | |
|---|---|
protected static java.lang.String |
CURRENT_DIRECTORY
current directory |
protected static java.lang.String |
EOL
EOL character |
protected java.lang.String |
fileSeparator
The file separator |
| 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 | |
|---|---|
AbstractBaseFileTransferTransactionalResourceCommand()
Constructor |
|
| Method Summary | |
|---|---|
protected void |
changeDirectory(java.lang.String path)
Execute a change directory on the server to directory passed in |
protected void |
deleteDir(java.lang.String directoryPath,
boolean recurse)
Deletes a remote directory |
protected void |
deleteFile(java.lang.String filename)
Deletes a remote file |
ExecutionOutput |
doExecute(TransactionalResource resource)
(non-Javadoc) |
protected ClientListEntry |
findFile(java.lang.String filePath)
Find a file in the current directory if it exists |
protected FileTransferClient |
getClient()
Return the FileTransferClient |
protected java.io.InputStream |
getContentAsStream(ClientListEntry entry)
Get the content from the file as an InputStream |
protected BaseFileTransferMappedRecord |
getFile(ClientListEntry entry)
Get the Mapped record that is a representation of the file |
protected BaseFileTransferMappedRecord |
getFile(java.lang.String filePath)
Get the SFYPMapped record that is a representation of the file |
protected java.util.List<ClientListEntry> |
listDirectory(java.lang.String directory)
Return a list of ClientListEntry objects |
protected void |
logFileList(java.util.List<ClientListEntry> list,
java.lang.String listDescription)
Method used to log a list of ClientListEntry entries. |
protected abstract ExecutionOutput |
performExecute()
execute method for subclasses to implement |
protected java.lang.String |
printWorkingDirectoryName()
Returns the working directory name |
protected void |
putFile(BaseFileTransferMappedRecord file)
Put the file given |
protected void |
putWithOutputStream(java.lang.String fileName,
java.io.InputStream inputStream)
Perform a PUT file operation suing an OutputStream |
protected void |
renameFile(java.lang.String oldPath,
java.lang.String newPath)
Rename the file from oldPath to newPath |
| Methods inherited from class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand |
|---|
commit, doCommit, doRollback, 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, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String EOL
protected static final java.lang.String CURRENT_DIRECTORY
protected java.lang.String fileSeparator
| Constructor Detail |
|---|
public AbstractBaseFileTransferTransactionalResourceCommand()
| Method Detail |
|---|
public ExecutionOutput doExecute(TransactionalResource resource)
throws javax.resource.ResourceException
doExecute in class AbstractTransactionalResourceCommandjavax.resource.ResourceExceptionAbstractTransactionalResourceCommand.doExecute(org.ikasan.connector.base.command.TransactionalResource)
protected abstract ExecutionOutput performExecute()
throws javax.resource.ResourceException
javax.resource.ResourceException - -
protected java.lang.String printWorkingDirectoryName()
throws javax.resource.ResourceException
javax.resource.ResourceException - -
protected void changeDirectory(java.lang.String path)
throws javax.resource.ResourceException
path - Path to change directory to
javax.resource.ResourceException - -
protected java.util.List<ClientListEntry> listDirectory(java.lang.String directory)
throws javax.resource.ResourceException
directory - The directory we are listing on
javax.resource.ResourceException - -
protected void logFileList(java.util.List<ClientListEntry> list,
java.lang.String listDescription)
ClientListEntry entries.
The level of detail logged depends on the runtime logging level.
list - - files in directorylistDescription - -
protected BaseFileTransferMappedRecord getFile(ClientListEntry entry)
throws javax.resource.ResourceException
entry - A wrapper that holds the information we need to get the file
javax.resource.ResourceException - failure to perform get
protected BaseFileTransferMappedRecord getFile(java.lang.String filePath)
throws javax.resource.ResourceException
filePath - The path to the file
javax.resource.ResourceException - - failure to perform get
protected void renameFile(java.lang.String oldPath,
java.lang.String newPath)
throws javax.resource.ResourceException
oldPath - Original PathnewPath - New Path
javax.resource.ResourceException - when renaming a file fails
protected void putFile(BaseFileTransferMappedRecord file)
throws javax.resource.ResourceException
file - - the file
javax.resource.ResourceException - when sending a file
protected void deleteFile(java.lang.String filename)
throws javax.resource.ResourceException
filename - - for file to be deleted
javax.resource.ResourceException - when removing a file fails
protected void deleteDir(java.lang.String directoryPath,
boolean recurse)
throws javax.resource.ResourceException
directoryPath - - directory to be removedrecurse - - flag to delete directory recursively or not.
javax.resource.ResourceException - when deleting a file fails
protected java.io.InputStream getContentAsStream(ClientListEntry entry)
throws javax.resource.ResourceException
entry - - the file
javax.resource.ResourceException - when downloding a file gails
protected void putWithOutputStream(java.lang.String fileName,
java.io.InputStream inputStream)
throws javax.resource.ResourceException
fileName - - the file nameinputStream - - file content as an input stream
javax.resource.ResourceException - when sending a file fails
protected ClientListEntry findFile(java.lang.String filePath)
throws javax.resource.ResourceException
filePath - - where to look for file
javax.resource.ResourceException - when finding the file failsprotected FileTransferClient getClient()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||