Sun Adapter for Batch/FTP

com.stc.eways.batchext
Class LocalFileClientImpl

java.lang.Object
  extended by com.stc.eways.batchext.LocalFileClientImpl
All Implemented Interfaces:
ConfigChangeListener, LocalFileClient, com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter, com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter

public class LocalFileClientImpl
extends java.lang.Object
implements LocalFileClient, ConfigChangeListener


Field Summary
protected  LocalFileETD etd
           
protected  com.stc.eways.common.eway.standalone.streaming.FileInputStream is
           
protected  java.io.OutputStream os
           
protected  byte[] payload
           
protected  TransferNamesAndCommands tnc
           
protected  boolean transferAllowed
           
 
Constructor Summary
LocalFileClientImpl()
           
 
Method Summary
 void allowTransfer()
           
 void executePostCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
           
 void executePostCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
           
 void executePreCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
           
 void executePreCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
           
 void get()
          Performs an inbound transfer to the Payload field.
 void getIfExists()
          per QAI 94512 - requested by eXchange team
 com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter getInputStreamAdapter()
          Gets an InputStreamAdapter which can be used to perform inbound streaming transfers with this LocalFileClient.
 com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter getOutputStreamAdapter()
          Gets an OutputStreamAdapter which can be used to perform outbound streaming transfers with this LocalFileClient.
 byte[] getPayload()
          Gets the content of the Payload field.
 TransferNamesAndCommands getResolvedNamesToGet()
          Obtains a TransferNamesAndCommands instance, which can be used to get access to the resolved names and commands for the current inbound transfer.
 TransferNamesAndCommands getResolvedNamesToPut()
          Obtains a TransferNamesAndCommands instance, which can be used to get access to the resolved names and commands for the current outbound transfer.
 boolean getResumeReadingInProgress()
          Indicates whether there is a 'Resume Reading' operation in progres.
 void getTargetDirExists()
          Same as get but verify whether target directory is accessible
 void initialize(LocalFileETD etd)
           
 void notifyChanges()
           
 void put()
          Performs an outbound transfer from the Payload field.
 void releaseInputStream(boolean success)
           
 void releaseOutputStream(boolean success)
           
 java.io.InputStream requestInputStream()
           
 java.io.OutputStream requestOutputStream()
           
 boolean reset()
          Resets the LocalFileClient, so it can be used in subsequent transfers.
 void setPayload(byte[] payload)
          Sets the content of the Payload field.
 void undoPreCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
           
 void undoPreCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
           
 void undoTransferGet(LocalFileTransferNamesAndCommandsGet tncg)
           
 void undoTransferPut(LocalFileTransferNamesAndCommandsPut tncp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

etd

protected LocalFileETD etd

transferAllowed

protected boolean transferAllowed

tnc

protected TransferNamesAndCommands tnc

payload

protected byte[] payload

is

protected com.stc.eways.common.eway.standalone.streaming.FileInputStream is

os

protected java.io.OutputStream os
Constructor Detail

LocalFileClientImpl

public LocalFileClientImpl()
Method Detail

initialize

public void initialize(LocalFileETD etd)
Specified by:
initialize in interface LocalFileClient

reset

public boolean reset()
Description copied from interface: LocalFileClient
Resets the LocalFileClient, so it can be used in subsequent transfers.

Specified by:
reset in interface LocalFileClient
Returns:
true on success, otherwise false.

allowTransfer

public void allowTransfer()
Specified by:
allowTransfer in interface LocalFileClient

getResolvedNamesToGet

public TransferNamesAndCommands getResolvedNamesToGet()
                                               throws LocalFileException
Description copied from interface: LocalFileClient
Obtains a TransferNamesAndCommands instance, which can be used to get access to the resolved names and commands for the current inbound transfer.

Specified by:
getResolvedNamesToGet in interface LocalFileClient
Returns:
TransferNamesAndCommands instance.
Throws:
LocalFileException - If anything goes wrong. LocalFileException.getNestedException() can be used to retrieve the original exception that caused the failure, if any.

getResolvedNamesToPut

public TransferNamesAndCommands getResolvedNamesToPut()
                                               throws LocalFileException
Description copied from interface: LocalFileClient
Obtains a TransferNamesAndCommands instance, which can be used to get access to the resolved names and commands for the current outbound transfer.

Specified by:
getResolvedNamesToPut in interface LocalFileClient
Returns:
TransferNamesAndCommands instance.
Throws:
LocalFileException - If anything goes wrong. LocalFileException.getNestedException() can be used to retrieve the original exception that caused the failure, if any.

getPayload

public byte[] getPayload()
Description copied from interface: LocalFileClient
Gets the content of the Payload field.

Specified by:
getPayload in interface LocalFileClient
Returns:
The Payload content.

setPayload

public void setPayload(byte[] payload)
Description copied from interface: LocalFileClient
Sets the content of the Payload field.

Specified by:
setPayload in interface LocalFileClient
Parameters:
payload - The new Payload content.

getInputStreamAdapter

public com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter getInputStreamAdapter()
Description copied from interface: LocalFileClient
Gets an InputStreamAdapter which can be used to perform inbound streaming transfers with this LocalFileClient.

Specified by:
getInputStreamAdapter in interface LocalFileClient
Returns:
The InputStreamAdapter.

getOutputStreamAdapter

public com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter getOutputStreamAdapter()
Description copied from interface: LocalFileClient
Gets an OutputStreamAdapter which can be used to perform outbound streaming transfers with this LocalFileClient.

Specified by:
getOutputStreamAdapter in interface LocalFileClient
Returns:
The OutputStreamAdapter.

requestInputStream

public java.io.InputStream requestInputStream()
                                       throws com.stc.eways.common.eway.standalone.streaming.StreamingException
Specified by:
requestInputStream in interface com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter
Throws:
com.stc.eways.common.eway.standalone.streaming.StreamingException

releaseInputStream

public void releaseInputStream(boolean success)
                        throws com.stc.eways.common.eway.standalone.streaming.StreamingException
Specified by:
releaseInputStream in interface com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter
Throws:
com.stc.eways.common.eway.standalone.streaming.StreamingException

requestOutputStream

public java.io.OutputStream requestOutputStream()
                                         throws com.stc.eways.common.eway.standalone.streaming.StreamingException
Specified by:
requestOutputStream in interface com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter
Throws:
com.stc.eways.common.eway.standalone.streaming.StreamingException

releaseOutputStream

public void releaseOutputStream(boolean success)
                         throws com.stc.eways.common.eway.standalone.streaming.StreamingException
Specified by:
releaseOutputStream in interface com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter
Throws:
com.stc.eways.common.eway.standalone.streaming.StreamingException

get

public void get()
         throws LocalFileException
Description copied from interface: LocalFileClient
Performs an inbound transfer to the Payload field.

Specified by:
get in interface LocalFileClient
Throws:
LocalFileException - If anything goes wrong. LocalFileException.getNestedException() can be used to retrieve the original exception that caused the failure, if any.

getIfExists

public void getIfExists()
                 throws LocalFileException
per QAI 94512 - requested by eXchange team

Specified by:
getIfExists in interface LocalFileClient
Throws:
LocalFileException

getTargetDirExists

public void getTargetDirExists()
                        throws LocalFileException
Description copied from interface: LocalFileClient
Same as get but verify whether target directory is accessible

Specified by:
getTargetDirExists in interface LocalFileClient
Throws:
LocalFileException

put

public void put()
         throws LocalFileException
Description copied from interface: LocalFileClient
Performs an outbound transfer from the Payload field.

Specified by:
put in interface LocalFileClient
Throws:
LocalFileException - If anything goes wrong. LocalFileException.getNestedException() can be used to retrieve the original exception that caused the failure, if any.

getResumeReadingInProgress

public boolean getResumeReadingInProgress()
Description copied from interface: LocalFileClient
Indicates whether there is a 'Resume Reading' operation in progres.

Specified by:
getResumeReadingInProgress in interface LocalFileClient
Returns:
true if 'Resume Reading' state was recorded in the preceeding inbound transfer, otherwise false.

executePreCommandGet

public void executePreCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
                          throws LocalFileException,
                                 BatchException
Specified by:
executePreCommandGet in interface LocalFileClient
Throws:
LocalFileException
BatchException

undoPreCommandGet

public void undoPreCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
                       throws LocalFileException,
                              BatchException
Specified by:
undoPreCommandGet in interface LocalFileClient
Throws:
LocalFileException
BatchException

executePostCommandGet

public void executePostCommandGet(LocalFileTransferNamesAndCommandsGet tncg)
                           throws LocalFileException,
                                  BatchException
Specified by:
executePostCommandGet in interface LocalFileClient
Throws:
LocalFileException
BatchException

undoTransferGet

public void undoTransferGet(LocalFileTransferNamesAndCommandsGet tncg)
                     throws LocalFileException,
                            BatchException
Specified by:
undoTransferGet in interface LocalFileClient
Throws:
LocalFileException
BatchException

executePreCommandPut

public void executePreCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
                          throws LocalFileException,
                                 BatchException
Specified by:
executePreCommandPut in interface LocalFileClient
Throws:
LocalFileException
BatchException

undoPreCommandPut

public void undoPreCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
                       throws LocalFileException,
                              BatchException
Specified by:
undoPreCommandPut in interface LocalFileClient
Throws:
LocalFileException
BatchException

executePostCommandPut

public void executePostCommandPut(LocalFileTransferNamesAndCommandsPut tncp)
                           throws LocalFileException,
                                  BatchException
Specified by:
executePostCommandPut in interface LocalFileClient
Throws:
LocalFileException
BatchException

undoTransferPut

public void undoTransferPut(LocalFileTransferNamesAndCommandsPut tncp)
                     throws LocalFileException,
                            BatchException
Specified by:
undoTransferPut in interface LocalFileClient
Throws:
LocalFileException
BatchException

notifyChanges

public void notifyChanges()
Specified by:
notifyChanges in interface ConfigChangeListener

Sun Adapter for Batch/FTP