org.neociclo.odetteftp.oftplet
Interface Oftplet

All Known Subinterfaces:
ServerOftplet
All Known Implementing Classes:
InOutSharedQueueOftplet, OftpletAdapter

public interface Oftplet

Define the methods that Oftplets must implement.

An Oftplet is a small Java program that run within the Odette FTP Library. Oftplets provides complementary implementation to the OdetteFtpHandler on the support for protocol data movement and acknowledgment.

  1. The Oftplet is constructed using an OftpletFactory on the event of the channel open.
  2. Then initialized with the init(OdetteFtpSession).
  3. Callback methods are invoked as appropriate in circumstance of performing protocol procedures.
  4. The Oftplet is taken out of service, then destroyed with the destroy() method.

The referred Oftplet container will always be the OdetteFtpHandler during the life cycle of the communication session.

Version:
$Rev: 804 $ $Date: 2010-10-20 00:51:46 -0200 (Wed, 20 Oct 2010) $
Author:
Rafael Marins

Method Summary
 void destroy()
          Called by the Oftplet container to indicate it is being taken out of service.
 OftpletListener getListener()
           
 SecurityContext getSecurityContext()
           
 OftpletSpeaker getSpeaker()
           
 void init(OdetteFtpSession session)
          Called by the Oftplet container to indicate that it is placed into service.
 boolean isProtocolVersionSupported(OdetteFtpVersion version)
           
 void onExceptionCaught(Throwable cause)
          Callback method called on event of an unexpected exception during the communication session and while performing file transfer.
 void onSessionEnd()
          Callback method indicating protocol release of End Session (ESID) command - normal or abnormal protocol termination.
 void onSessionStart()
           
 

Method Detail

init

void init(OdetteFtpSession session)
          throws OdetteFtpException
Called by the Oftplet container to indicate that it is placed into service.

The implementation of this method might set up the given session in the context with parameters configuration for the initial handshaking (SSID).

Parameters:
s -
Throws:
OdetteFtpException

destroy

void destroy()
Called by the Oftplet container to indicate it is being taken out of service.


onSessionStart

void onSessionStart()

onSessionEnd

void onSessionEnd()
Callback method indicating protocol release of End Session (ESID) command - normal or abnormal protocol termination.

There ISN'T a corresponding onSessionStart() method but the Oftplet#init(OdetteFtpContext) method can be used with similar way, since it's invoked when the protocol session is just created.

Parameters:
reasonText -

onExceptionCaught

void onExceptionCaught(Throwable cause)
Callback method called on event of an unexpected exception during the communication session and while performing file transfer. The Oftplet might check the current ODETTE-FTP entity state and if in the circumstance of file transfer when handling the exceptions thrown.

Parameters:
cause -

isProtocolVersionSupported

boolean isProtocolVersionSupported(OdetteFtpVersion version)
Parameters:
version -
Returns:

getSecurityContext

SecurityContext getSecurityContext()

getSpeaker

OftpletSpeaker getSpeaker()

getListener

OftpletListener getListener()


ACCORD