Class BaseFileTransferConnectionImpl
- java.lang.Object
-
- org.ikasan.connector.basefiletransfer.outbound.BaseFileTransferConnectionImpl
-
- All Implemented Interfaces:
javax.resource.cci.Connection,org.ikasan.connector.BaseFileTransferConnection,org.ikasan.connector.listener.TransactionCommitFailureObserverable
public abstract class BaseFileTransferConnectionImpl extends java.lang.Object implements org.ikasan.connector.BaseFileTransferConnection, javax.resource.cci.ConnectionA Base implementation for File transfer connections- Author:
- Ikasan Development Team
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.xml.bind.JAXBContextjaxbContextprotected java.util.List<org.ikasan.connector.listener.TransactionCommitFailureListener>listenersprotected javax.xml.bind.Marshallermarshallerprotected static java.lang.StringREFERENCE_PAYLOAD_ATTRIBUTEprotected javax.xml.bind.Unmarshallerunmarshaller
-
Constructor Summary
Constructors Constructor Description BaseFileTransferConnectionImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddListener(org.ikasan.connector.listener.TransactionCommitFailureListener listener)protected voidaddListenersToCommand(org.ikasan.connector.base.command.TransactionalResourceCommand command)javax.resource.cci.InteractioncreateInteraction()Connection MethodsvoiddeliverInputStream(java.io.InputStream inputStream, java.lang.String fileName, java.lang.String outputDir, boolean overwrite, java.lang.String renameExtension, boolean checksumDelivered, boolean unzip, boolean createParentDirectory, java.lang.String tempFileName)Deliver the InputStream TODO Add in the checksumDelivered featureprotected abstract org.ikasan.connector.base.command.ExecutionOutputexecuteCommand(org.ikasan.connector.base.command.TransactionalResourceCommand deliveryCommand, org.ikasan.connector.base.command.ExecutionContext executionContext)Execute the commandprotected org.ikasan.filetransfer.PayloadfileChunkHeaderToPayload(org.ikasan.connector.util.chunking.model.FileChunkHeader header)Method used to map anFTPMappedRecordobject to aPayloadobject.javax.resource.cci.LocalTransactiongetLocalTransaction()javax.resource.cci.ConnectionMetaDatagetMetaData()javax.resource.cci.ResultSetInfogetResultSetInfo()protected booleanisChunkReference(org.ikasan.filetransfer.Payload payload)Determines if we need to handle this as a chunk reference-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
REFERENCE_PAYLOAD_ATTRIBUTE
protected static final java.lang.String REFERENCE_PAYLOAD_ATTRIBUTE
- See Also:
- Constant Field Values
-
listeners
protected java.util.List<org.ikasan.connector.listener.TransactionCommitFailureListener> listeners
-
jaxbContext
protected javax.xml.bind.JAXBContext jaxbContext
-
unmarshaller
protected javax.xml.bind.Unmarshaller unmarshaller
-
marshaller
protected javax.xml.bind.Marshaller marshaller
-
-
Method Detail
-
deliverInputStream
public void deliverInputStream(java.io.InputStream inputStream, java.lang.String fileName, java.lang.String outputDir, boolean overwrite, java.lang.String renameExtension, boolean checksumDelivered, boolean unzip, boolean createParentDirectory, java.lang.String tempFileName) throws javax.resource.ResourceExceptionDeliver the InputStream TODO Add in the checksumDelivered feature- Specified by:
deliverInputStreamin interfaceorg.ikasan.connector.BaseFileTransferConnection- Parameters:
inputStream- to deliverfileName- The name of the fileoutputDir- The output directory to deliver tooverwrite- Whether to overwrite or notrenameExtension- The extension for renaming the filechecksumDelivered- A flag to see if we check the checksum on deliveryunzip- flag- Throws:
javax.resource.ResourceException- - Exception from the JCA connector
-
executeCommand
protected abstract org.ikasan.connector.base.command.ExecutionOutput executeCommand(org.ikasan.connector.base.command.TransactionalResourceCommand deliveryCommand, org.ikasan.connector.base.command.ExecutionContext executionContext) throws javax.resource.ResourceExceptionExecute the command- Parameters:
deliveryCommand- The command to executeexecutionContext- The execution context- Returns:
- The output of that Execution
- Throws:
javax.resource.ResourceException- The Exception from the JCA connector
-
fileChunkHeaderToPayload
protected org.ikasan.filetransfer.Payload fileChunkHeaderToPayload(org.ikasan.connector.util.chunking.model.FileChunkHeader header)
Method used to map anFTPMappedRecordobject to aPayloadobject. TODO Is there any other Payload stuff to set here?- Parameters:
header- The record as returned from the FileTransferProtocolClient- Returns:
- A payload constructed from the record.
-
isChunkReference
protected boolean isChunkReference(org.ikasan.filetransfer.Payload payload)
Determines if we need to handle this as a chunk reference- Parameters:
payload- - The payload to check- Returns:
- true if the payload is simply a reference to a set of chunks
-
addListenersToCommand
protected void addListenersToCommand(org.ikasan.connector.base.command.TransactionalResourceCommand command)
- Parameters:
command-
-
addListener
public void addListener(org.ikasan.connector.listener.TransactionCommitFailureListener listener)
- Specified by:
addListenerin interfaceorg.ikasan.connector.listener.TransactionCommitFailureObserverable
-
createInteraction
public javax.resource.cci.Interaction createInteraction()
Connection Methods- Specified by:
createInteractionin interfacejavax.resource.cci.Connection
-
getLocalTransaction
public javax.resource.cci.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException- Specified by:
getLocalTransactionin interfacejavax.resource.cci.Connection- Throws:
javax.resource.ResourceException
-
getMetaData
public javax.resource.cci.ConnectionMetaData getMetaData()
- Specified by:
getMetaDatain interfacejavax.resource.cci.Connection
-
getResultSetInfo
public javax.resource.cci.ResultSetInfo getResultSetInfo()
- Specified by:
getResultSetInfoin interfacejavax.resource.cci.Connection
-
-