org.neociclo.odetteftp
Interface ProtocolHandler

All Known Implementing Classes:
DefaultHandler, OdetteFtpVer13Handler, OdetteFtpVer14Handler, OdetteFtpVer20Handler

public interface ProtocolHandler

Version:
$Rev: 94 $ $Date: 2009-03-24 08:50:13 -0300 (Tue, 24 Mar 2009) $
Author:
Rafael Marins

Method Summary
 void abnormalRelease(OdetteFtpSession session, EndSessionReason error, String errorText)
          Terminate current session by sending an End Session command with the specified error and raise the exception for the local user agent.
 void abort(OdetteFtpSession session, EndSessionReason error, String errorText)
           
 void afterStartSession(OdetteFtpSession session)
           
 void authenticationChallengeReceived(OdetteFtpSession session, CommandExchangeBuffer auch)
          Decrypts the challenge using the user private key and sends the decrypted challenge back to the remote peer in the Authentication Response (AURP).
 void authenticationResponseReceived(OdetteFtpSession session, CommandExchangeBuffer aurp)
           
 void changeDirectionReceived(OdetteFtpSession session)
           
 void dataBufferReceived(OdetteFtpSession session, DataExchangeBuffer data)
           
 void endFileNegativeAnswerReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void endFilePositiveAnswerReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void endFileReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void endSessionReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void endToEndResponseReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void negativeEndReponseReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void protocolRelease(OdetteFtpSession session, EndSessionReason reason, String reasonText)
           
 void readyMessageReceived(OdetteFtpSession session)
          The Initiator ODETTE-FTP entity receive the Start Session Ready Message sent by the Responder immediately after the network connection has been established, beginning the Start Session Phase.
 void readyToReceiveReceived(OdetteFtpSession session)
          Ready To Receive Command (RTR) received in the SPEAKER state.
 void securityChangeDirectionReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void sessionConnected(OdetteFtpSession session)
          Indication that the network connection has been established - occur in both entity states (SPEAKER or LISTENER).
 void setCreditReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void startFileNegativeAnswerReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void startFilePositiveAnswerReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void startFileReceived(OdetteFtpSession session, CommandExchangeBuffer command)
           
 void startSessionReceived(OdetteFtpSession session, CommandExchangeBuffer command)
          Negotiate the Start Session taking in account the right entity mode's behavior (Initiator or Responder).
 

Method Detail

abnormalRelease

void abnormalRelease(OdetteFtpSession session,
                     EndSessionReason error,
                     String errorText)
                     throws OdetteFtpException
Terminate current session by sending an End Session command with the specified error and raise the exception for the local user agent.

Parameters:
session -
err -
msg -
Throws:
EndSessionException - a raising exception for the given End Session error to user agent.
OdetteFtpException

abort

void abort(OdetteFtpSession session,
           EndSessionReason error,
           String errorText)
           throws OdetteFtpException
Throws:
OdetteFtpException

authenticationChallengeReceived

void authenticationChallengeReceived(OdetteFtpSession session,
                                     CommandExchangeBuffer auch)
                                     throws OdetteFtpException
Decrypts the challenge using the user private key and sends the decrypted challenge back to the remote peer in the Authentication Response (AURP).

The first authentication message must be sent by the Initiator.

 1. Initiator -- SECD ------------> Responder   Change Direction
 2.              <------------ AUCH --             Challenge
 3.              -- AURP ------------>             Response
 4.              <------------ SECD --             Change Direction
 5.              -- AUCH ------------>             Challenge
 6.              <------------ AURP --             Response
 

Parameters:
session -
auch -
Throws:
OdetteFtpException

authenticationResponseReceived

void authenticationResponseReceived(OdetteFtpSession session,
                                    CommandExchangeBuffer aurp)
                                    throws OdetteFtpException
Throws:
OdetteFtpException

changeDirectionReceived

void changeDirectionReceived(OdetteFtpSession session)
                             throws OdetteFtpException
Throws:
OdetteFtpException

dataBufferReceived

void dataBufferReceived(OdetteFtpSession session,
                        DataExchangeBuffer data)
                        throws OdetteFtpException
Throws:
OdetteFtpException

endFileNegativeAnswerReceived

void endFileNegativeAnswerReceived(OdetteFtpSession session,
                                   CommandExchangeBuffer command)
                                   throws OdetteFtpException
Throws:
OdetteFtpException

endFilePositiveAnswerReceived

void endFilePositiveAnswerReceived(OdetteFtpSession session,
                                   CommandExchangeBuffer command)
                                   throws OdetteFtpException
Throws:
OdetteFtpException

endFileReceived

void endFileReceived(OdetteFtpSession session,
                     CommandExchangeBuffer command)
                     throws OdetteFtpException
Throws:
OdetteFtpException

endSessionReceived

void endSessionReceived(OdetteFtpSession session,
                        CommandExchangeBuffer command)
                        throws OdetteFtpException
Throws:
OdetteFtpException

endToEndResponseReceived

void endToEndResponseReceived(OdetteFtpSession session,
                              CommandExchangeBuffer command)
                              throws OdetteFtpException
Throws:
OdetteFtpException

negativeEndReponseReceived

void negativeEndReponseReceived(OdetteFtpSession session,
                                CommandExchangeBuffer command)
                                throws OdetteFtpException
Throws:
OdetteFtpException

protocolRelease

void protocolRelease(OdetteFtpSession session,
                     EndSessionReason reason,
                     String reasonText)
                     throws OdetteFtpException
Throws:
OdetteFtpException

readyMessageReceived

void readyMessageReceived(OdetteFtpSession session)
                          throws OdetteFtpException
The Initiator ODETTE-FTP entity receive the Start Session Ready Message sent by the Responder immediately after the network connection has been established, beginning the Start Session Phase.

Thus, the both negotiate session authentication and parameters exchanging the SSID command.

Protocol Sequence

 1. Initiator <-------------SSRM -- Responder   Ready Message
 2.           -- SSID ------------>             Identification
 3.           <------------ SSID --             Identification
 

Parameters:
session -
Throws:
OdetteFtpException

readyToReceiveReceived

void readyToReceiveReceived(OdetteFtpSession session)
                            throws OdetteFtpException
Ready To Receive Command (RTR) received in the SPEAKER state. Command received to indicate that the End Response (EERP or NERP) sent has been successfully received by the other peer.

In order to avoid congestion between two adjacent nodes caused by a continuous flow of EERPs and NERPs, a Ready To Receive (RTR) command is provided. The RTR acts as an EERP/NERP acknowledgement for flow control but has no end-to-end significance.

Protocol Sequence

 1. Speaker  -- EERP ------------> Listener   End to End Response
 2.          <------------- RTR --            Ready to Receive
 3.          -- EERP ------------>            End to End Response
 4.          <------------- RTR --            Ready to Receive
 5.          -- NERP ------------>            Negative End Response
 6.          <------------- RTR --            Ready to Receive
 7.          -- SFID ------------>            Start File
                         or
 8.          -- CD -------------->            Exchange the turn
 
After sending an EERP or NERP, the Speaker must wait for an RTR before sending any other commands. The only acceptable commands to follow are:
      EERP
      NERP
      SFID or CD (if there are no more EERPs or NERPs to be sent)
 

Parameters:
session -
Throws:
OdetteFtpException

securityChangeDirectionReceived

void securityChangeDirectionReceived(OdetteFtpSession session,
                                     CommandExchangeBuffer command)
                                     throws OdetteFtpException
Throws:
OdetteFtpException

sessionConnected

void sessionConnected(OdetteFtpSession session)
                      throws OdetteFtpException
Indication that the network connection has been established - occur in both entity states (SPEAKER or LISTENER). Allow handler to take the proper protocol control when the session is connected.

Answer attended calls with a Start Session Ready Message command when this ODETTE FTP entity is the Responder. Otherwise, do nothing else of expecting same command from the peer.

The Start Session phase is entered immediately after the network connection has been established. The ODETTE FTP entity that took the initiative to establish the network connection becomes the Initiator. It's peer becomes the Responder.

The first message must be sent by the Responder.

Protocol Sequence

 1. Initiator <-------------SSRM -- Responder   Ready Message
 2.           -- SSID ------------>             Identification
 3.           <------------ SSID --             Identification
 

Parameters:
session -
Throws:
OdetteFtpException

setCreditReceived

void setCreditReceived(OdetteFtpSession session,
                       CommandExchangeBuffer command)
                       throws OdetteFtpException
Throws:
OdetteFtpException

startFileNegativeAnswerReceived

void startFileNegativeAnswerReceived(OdetteFtpSession session,
                                     CommandExchangeBuffer command)
                                     throws OdetteFtpException
Throws:
OdetteFtpException

startFilePositiveAnswerReceived

void startFilePositiveAnswerReceived(OdetteFtpSession session,
                                     CommandExchangeBuffer command)
                                     throws OdetteFtpException
Throws:
OdetteFtpException

startFileReceived

void startFileReceived(OdetteFtpSession session,
                       CommandExchangeBuffer command)
                       throws OdetteFtpException
Throws:
OdetteFtpException

startSessionReceived

void startSessionReceived(OdetteFtpSession session,
                          CommandExchangeBuffer command)
                          throws OdetteFtpException
Negotiate the Start Session taking in account the right entity mode's behavior (Initiator or Responder). The Responder use the received SSID (in step 2) to authenticate the peer and determine the average session parameters, meanwhile the Initiator handle the received SSID (in step 3) to complete the Session Setup.

Protocol Sequence

 1. Initiator <-------------SSRM -- Responder   Ready Message
 2.           -- SSID ------------>             Identification
 3.           <------------ SSID --             Identification
 

Parameters:
session -
command -
Throws:
OdetteFtpException

afterStartSession

void afterStartSession(OdetteFtpSession session)
                       throws OdetteFtpException
Throws:
OdetteFtpException


ACCORD