org.neociclo.odetteftp.oftplet
Interface OftpletListener

All Known Subinterfaces:
OftpletEventListener
All Known Implementing Classes:
OftpletEventListenerAdapter, OftpletListenerAdapter, SharedQueueOftpletListener

public interface OftpletListener

Version:
$Rev: 725 $ $Date: 2010-09-27 13:07:49 -0300 (Mon, 27 Sep 2010) $
Author:
Rafael Marins

Method Summary
 StartFileResponse acceptStartFile(VirtualFile virtualFile)
          Callback method indicating a receive file request, used to construct and return the VirtualFile instance.
 void onDataReceived(VirtualFile virtualFile, long totalOctetsReceived)
           
 void onNotificationReceived(DeliveryNotification notif)
          Callback method to indicate the Oftplet about the receive of a delivery notification.
 EndFileResponse onReceiveFileEnd(VirtualFile virtualFile, long recordCount, long unitCount)
          Callback method indicating the file receive end request with given parameters information used to check the integrity of the received file.
 void onReceiveFileError(VirtualFile virtualFile, AnswerReasonInfo reason)
           
 void onReceiveFileStart(VirtualFile virtualFile, long answerCount)
           
 

Method Detail

acceptStartFile

StartFileResponse acceptStartFile(VirtualFile virtualFile)
Callback method indicating a receive file request, used to construct and return the VirtualFile instance. Returning null corresponds to refuse the file receiving - reply with Start File Negative Answer (SFNA) with AnswerReason.UNSPECIFIED reason.

The given parameters provide required information to map the transferring VirtualFile into the Oftplet implementation's local system.

Parameters:
virtualFile - holder of file receive indication parameters.
Returns:
the VirtualFile instance ready to start the file receiving.

onReceiveFileStart

void onReceiveFileStart(VirtualFile virtualFile,
                        long answerCount)

onDataReceived

void onDataReceived(VirtualFile virtualFile,
                    long totalOctetsReceived)

onReceiveFileEnd

EndFileResponse onReceiveFileEnd(VirtualFile virtualFile,
                                 long recordCount,
                                 long unitCount)
Callback method indicating the file receive end request with given parameters information used to check the integrity of the received file. When an inconsistency is found this method should throw a FileTransferException with the proper reason code.

The returning boolean value indicates whether the other peer, operating in the Speaker state, should issue a Change Direction (CD) command and revert this Oftplet implementation ODETTE-FTP entity state.

Parameters:
recordCount - number of records the other ODETTE-FTP peer sent in the VirtualFile.
unitCount - exact number of units (octets) transmitted.
Returns:
whether to change direction after complete the file receiving.

onReceiveFileError

void onReceiveFileError(VirtualFile virtualFile,
                        AnswerReasonInfo reason)

onNotificationReceived

void onNotificationReceived(DeliveryNotification notif)
Callback method to indicate the Oftplet about the receive of a delivery notification. Called when processing the receive of the End-to-End Response (EERP) or Negative End Response (NERP) command while in the Listener state.

Parameters:
notif - holder of the received delivery notification parameters.


ACCORD