public class FileTransferConnectionTemplate extends Object implements TransactionCommitFailureObserverable
| Modifier and Type | Field and Description |
|---|---|
protected List<TransactionCommitFailureListener> |
listeners |
| Constructor and Description |
|---|
FileTransferConnectionTemplate(javax.resource.cci.ConnectionSpec connectionSpec,
TransactionalResourceCommandDAO transactionalResourceCommandDAO,
FileChunkDao fileChunkDao,
BaseFileTransferDao baseFileTransferDao,
org.springframework.transaction.jta.JtaTransactionManager transactionManager)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TransactionCommitFailureListener listener) |
protected void |
addListenersToConnection(BaseFileTransferConnection connection)
Helper method to add the listeners to the connection.
|
static void |
closeConnection(javax.resource.cci.Connection connection)
Closes the connection, suppressing any exceptions
|
void |
deliverInputStream(InputStream inputStream,
String fileName,
String outputDir,
boolean overwrite,
String renameExtension,
boolean checksumDelivered,
boolean unzip,
boolean createParentDirectory,
String tempFileName)
Delivering an InputStream
|
void |
deliverPayload(Payload payload,
String outputDir,
Map<String,String> outputTargets,
boolean overwrite,
String renameExtension,
boolean checksumDelivered,
boolean unzip,
boolean cleanup)
Deprecated.
- use deliverInputStream
|
Object |
execute(ConnectionCallback action)
Execute the action specified by the given action object with a
Connection.
|
Payload |
getDiscoveredFile(String sourceDir,
String filenamePattern,
boolean renameOnSuccess,
String renameOnSuccessExtension,
boolean moveOnSuccess,
String moveOnSuccessNewPath,
boolean chunking,
int chunkSize,
boolean checksum,
long minAge,
boolean destructive,
boolean filterDuplicates,
boolean filterOnFilename,
boolean filterOnLastModifedDate,
boolean chronological,
boolean isRecursive)
Test the getDiscoveredFile
|
protected TransactionJournal |
getTransactionJournal(TransactionalResourceCommandDAO transactionalResourceCommandDAO,
FileChunkDao fileChunkDao)
Lazily instantiates the TransactionJournal
|
void |
housekeep(int maxRows,
int ageOfFiles)
Housekeep the FileFilter table
|
protected List<TransactionCommitFailureListener> listeners
public FileTransferConnectionTemplate(javax.resource.cci.ConnectionSpec connectionSpec,
TransactionalResourceCommandDAO transactionalResourceCommandDAO,
FileChunkDao fileChunkDao,
BaseFileTransferDao baseFileTransferDao,
org.springframework.transaction.jta.JtaTransactionManager transactionManager)
throws javax.resource.ResourceException
connectionSpec - - THe connection specjavax.resource.ResourceExceptionpublic void deliverPayload(Payload payload, String outputDir, Map<String,String> outputTargets, boolean overwrite, String renameExtension, boolean checksumDelivered, boolean unzip, boolean cleanup) throws javax.resource.ResourceException
payload - - The payload to deliveroutputDir - - The directory to place the file inoutputTargets - - The Map of targets to deliver the file tooverwrite - - Overwrite existing files flagrenameExtension - - The extension for the temp file renamechecksumDelivered - - Flag for whether we perform checksummingunzip - - Flag for whether we unzip the delivered filecleanup - - Cleanup txn journal flagjavax.resource.ResourceException - - Exception if JCA connector failspublic void deliverInputStream(InputStream inputStream, String fileName, String outputDir, boolean overwrite, String renameExtension, boolean checksumDelivered, boolean unzip, boolean createParentDirectory, String tempFileName) throws javax.resource.ResourceException
inputStream - - The 'file'fileName - - The name of the fileoutputDir - - The directory to place the file inoverwrite - - Overwrite existing files flagrenameExtension - - The extension for the temp file renamechecksumDelivered - - Flag for whether we perform checksummingunzip - - Flag for whether we unzip the delivered filecreateParentDirectory - -tempFileName - -javax.resource.ResourceException - - Exception if JCA connector failspublic Payload getDiscoveredFile(String sourceDir, String filenamePattern, boolean renameOnSuccess, String renameOnSuccessExtension, boolean moveOnSuccess, String moveOnSuccessNewPath, boolean chunking, int chunkSize, boolean checksum, long minAge, boolean destructive, boolean filterDuplicates, boolean filterOnFilename, boolean filterOnLastModifedDate, boolean chronological, boolean isRecursive) throws javax.resource.ResourceException
sourceDir - - The directory to get the file fromfilenamePattern - - The pattern to search onrenameOnSuccess - - Whether we rename a file on successful deliveryrenameOnSuccessExtension - - The extension to rename tomoveOnSuccess - - Whether we move the file on successful deliverymoveOnSuccessNewPath - - Where we move the file tochunking - - Whether we are chunking enabledchunkSize - - The size of the chunkschecksum - - Whether we checksum the pickupminAge - - The minimum age the file has to be in order to be picked updestructive - - Whether we pick up destructivelyfilterDuplicates - - Whether we filter duplicatesfilterOnFilename - - Whether we filter duplicates based on file namefilterOnLastModifedDate - - Whether we filter duplicates based on file namechronological - - Whether we pickup files in age orderisRecursive - - Whether we pickup files and all subdirectoriesjavax.resource.ResourceException - - Exception if the JCA connector failspublic void housekeep(int maxRows,
int ageOfFiles)
throws javax.resource.ResourceException
maxRows - Max rows the housekeeper will deal withageOfFiles - How old the files have to be in days to
be considered for housekeepingjavax.resource.ResourceException - - Exception if JCA connector failsprotected void addListenersToConnection(BaseFileTransferConnection connection)
connection - public void addListener(TransactionCommitFailureListener listener)
addListener in interface TransactionCommitFailureObserverablepublic Object execute(ConnectionCallback action) throws javax.resource.ResourceException
action - callback object that exposes the Connectionjavax.resource.ResourceException - if there is any problempublic static void closeConnection(javax.resource.cci.Connection connection)
connection - - possibly null, not necessarily openprotected TransactionJournal getTransactionJournal(TransactionalResourceCommandDAO transactionalResourceCommandDAO, FileChunkDao fileChunkDao)
Copyright © 2007-2017 Ikasan. All Rights Reserved.