public abstract class AbstractBaseFileTransferTransactionalResourceCommand extends AbstractTransactionalResourceCommand implements TransactionCommitFailureObserverable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CURRENT_DIRECTORY
current directory
|
protected static String |
EOL
EOL character
|
protected String |
fileSeparator
The file separator
|
protected List<TransactionCommitFailureListener> |
listeners |
COMMIT_IN_PROGRESS, COMPLETED_COMMITTING, EXECUTED_STATE, EXECUTION_IN_PROGRESS, executionContext, INITIALISED_STATE, ROLLBACK_IN_PROGRESS, ROLLED_BACK_STATE, transactionalResource| Constructor and Description |
|---|
AbstractBaseFileTransferTransactionalResourceCommand()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TransactionCommitFailureListener listener) |
protected void |
changeDirectory(String path)
Execute a change directory on the server to directory passed in
|
protected void |
deleteDir(String directoryPath,
boolean recurse)
Deletes a remote directory
|
protected void |
deleteFile(String filename)
Deletes a remote file
|
ExecutionOutput |
doExecute(TransactionalResource resource)
(non-Javadoc)
|
protected ClientListEntry |
findFile(String filePath)
Find a file in the current directory if it exists
|
protected FileTransferClient |
getClient()
Return the FileTransferClient
|
protected 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(String filePath)
Get the SFYPMapped record that is a representation of the file
|
protected List<ClientListEntry> |
listDirectory(String directory)
Return a list of ClientListEntry objects
|
protected void |
logFileList(List<ClientListEntry> list,
String listDescription)
Method used to log a list of
ClientListEntry entries. |
protected void |
notifyListeners(TransactionCommitException exception) |
protected abstract ExecutionOutput |
performExecute()
execute method for subclasses to implement
|
protected String |
printWorkingDirectoryName()
Returns the working directory name
|
protected void |
putFile(BaseFileTransferMappedRecord file)
Put the file given
|
protected void |
putWithOutputStream(String fileName,
InputStream inputStream)
Perform a PUT file operation suing an OutputStream
|
protected void |
renameFile(String oldPath,
String newPath)
Rename the file from oldPath to newPath
|
commit, doCommit, doRollback, execute, getBeanFactory, getExecutionTimestamp, getId, getState, getXid, rollback, setBeanFactory, setExecutionContext, setTransactionalResource, setTransactionJournal, setXidprotected static final String EOL
protected static final String CURRENT_DIRECTORY
protected String fileSeparator
protected List<TransactionCommitFailureListener> listeners
public AbstractBaseFileTransferTransactionalResourceCommand()
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 String printWorkingDirectoryName() throws javax.resource.ResourceException
javax.resource.ResourceException - -protected void changeDirectory(String path) throws javax.resource.ResourceException
path - Path to change directory tojavax.resource.ResourceException - -protected List<ClientListEntry> listDirectory(String directory) throws javax.resource.ResourceException
directory - The directory we are listing onjavax.resource.ResourceException - -protected void logFileList(List<ClientListEntry> list, 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 filejavax.resource.ResourceException - failure to perform getprotected BaseFileTransferMappedRecord getFile(String filePath) throws javax.resource.ResourceException
filePath - The path to the filejavax.resource.ResourceException - - failure to perform getprotected void renameFile(String oldPath, String newPath) throws javax.resource.ResourceException
oldPath - Original PathnewPath - New Pathjavax.resource.ResourceException - when renaming a file failsprotected void putFile(BaseFileTransferMappedRecord file) throws javax.resource.ResourceException
file - - the filejavax.resource.ResourceException - when sending a fileprotected void deleteFile(String filename) throws javax.resource.ResourceException
filename - - for file to be deletedjavax.resource.ResourceException - when removing a file failsprotected void deleteDir(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 failsprotected InputStream getContentAsStream(ClientListEntry entry) throws javax.resource.ResourceException
entry - - the filejavax.resource.ResourceException - when downloding a file gailsprotected void putWithOutputStream(String fileName, InputStream inputStream) throws javax.resource.ResourceException
fileName - - the file nameinputStream - - file content as an input streamjavax.resource.ResourceException - when sending a file failsprotected ClientListEntry findFile(String filePath) throws javax.resource.ResourceException
filePath - - where to look for filejavax.resource.ResourceException - when finding the file failsprotected FileTransferClient getClient()
public void addListener(TransactionCommitFailureListener listener)
addListener in interface TransactionCommitFailureObserverableprotected void notifyListeners(TransactionCommitException exception)
Copyright © 2007-2017 Ikasan. All Rights Reserved.