org.neociclo.odetteftp.protocol.v20
Class OdetteFtpVer20Handler
java.lang.Object
org.neociclo.odetteftp.protocol.DefaultHandler
org.neociclo.odetteftp.protocol.v13.OdetteFtpVer13Handler
org.neociclo.odetteftp.protocol.v14.OdetteFtpVer14Handler
org.neociclo.odetteftp.protocol.v20.OdetteFtpVer20Handler
- All Implemented Interfaces:
- ProtocolHandler
public class OdetteFtpVer20Handler
- extends OdetteFtpVer14Handler
- Version:
- $Rev: 801 $ $Date: 2010-10-19 23:53:43 -0200 (Tue, 19 Oct 2010) $
- Author:
- Rafael Marins
Method Summary |
void |
afterStartSession(OdetteFtpSession session)
Begin the Secure Authentication phase after having exchanged SSIDs. |
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)
|
protected AnswerReasonInfo |
buildAnswerReasonInfoObject(CommandExchangeBuffer response)
|
protected CommandExchangeBuffer |
buildAuthenticationChallenge(byte[] encodedChallenge)
|
protected CommandExchangeBuffer |
buildDeliveryNotificationCommand(DeliveryNotification notif)
|
protected CommandExchangeBuffer |
buildEndFileCommand(long recordCount,
long unitCount)
|
protected CommandExchangeBuffer |
buildEndFileNegativeAnswerCommand(AnswerReason reason,
String reasonText)
|
protected CommandExchangeBuffer |
buildEndFilePositiveAnswerCommand(boolean changeDirection)
|
protected CommandExchangeBuffer |
buildEndSessionCommand(EndSessionReason reason,
String reasonText)
|
protected EndSessionReasonInfo |
buildEndSessionReasonInfoObject(CommandExchangeBuffer esid)
|
protected DeliveryNotification |
buildEndToEndResponse(CommandExchangeBuffer eerp)
|
protected DeliveryNotification |
buildNegativeEndResponse(CommandExchangeBuffer nerp)
|
protected CommandExchangeBuffer |
buildReadyToReceiveCommand()
|
protected CommandExchangeBuffer |
buildSecurityChangeDirection()
|
protected CommandExchangeBuffer |
buildStartFileCommand(OdetteFtpSession session,
VirtualFile vf)
|
protected CommandExchangeBuffer |
buildStartFileNegativeAnswerCommand(AnswerReason reason,
String reasonText,
boolean retryLater)
|
protected CommandExchangeBuffer |
buildStartFilePositiveAnswerCommand(long answerCount)
|
protected CommandExchangeBuffer |
buildStartSessionCommand(String code,
String pswd,
String userData,
OdetteFtpSession session)
|
protected DefaultEnvelopedVirtualFile |
buildVirtualFileObject(OdetteFtpSession session,
CommandExchangeBuffer sfid)
|
protected void |
checkSecureAuthentication(OdetteFtpSession session)
|
protected void |
initiatorStartSessionReceived(OdetteFtpSession session,
CommandExchangeBuffer ssid)
The Initiator handle the returned Start Session Identification command to
perform its setup and complete the Start Session Phase. |
protected VirtualFile |
normalizeVirtualFile(OdetteFtpSession session,
VirtualFile vf)
|
protected long |
protocolMaxFileSizeSupported()
|
protected void |
responderSendStartSession(OdetteFtpSession session,
CommandExchangeBuffer ssid)
|
void |
securityChangeDirectionReceived(OdetteFtpSession session,
CommandExchangeBuffer command)
|
Methods inherited from class org.neociclo.odetteftp.protocol.DefaultHandler |
abnormalRelease, abort, buildSetCreditCommand, changeDirectionReceived, checkSessionParamsViolation, consumeIncomingCredits, consumeOutgoingCredits, dataBufferReceived, endFileNegativeAnswerReceived, endFilePositiveAnswerReceived, endFileReceived, endSessionReceived, endToEndResponseReceived, handleCallback, protocolRelease, readyMessageReceived, readyToReceiveReceived, release, resetIncomingCredits, resetOutgoingCredits, sessionConnected, setCreditReceived, speakerChangeDirection, speakerChangeDirectionPreventingLoop, speakerDeliveryNotification, speakerEndFile, speakerSendData, speakerStartFile, speakerTransmitRequests, startFileNegativeAnswerReceived, startFilePositiveAnswerReceived, startFileReceived, startSessionPasswordAuthentication, startSessionReceived |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_TRANSMITTED_FILE_SIZE_VER20
protected static final long MAX_TRANSMITTED_FILE_SIZE_VER20
- See Also:
- Constant Field Values
OdetteFtpVer20Handler
public OdetteFtpVer20Handler()
responderSendStartSession
protected void responderSendStartSession(OdetteFtpSession session,
CommandExchangeBuffer ssid)
throws OdetteFtpException
- Overrides:
responderSendStartSession
in class DefaultHandler
- Throws:
OdetteFtpException
initiatorStartSessionReceived
protected void initiatorStartSessionReceived(OdetteFtpSession session,
CommandExchangeBuffer ssid)
throws OdetteFtpException
- Description copied from class:
DefaultHandler
- The Initiator handle the returned Start Session Identification command to
perform its setup and complete the Start Session Phase.
- Overrides:
initiatorStartSessionReceived
in class DefaultHandler
- Throws:
OdetteFtpException
afterStartSession
public void afterStartSession(OdetteFtpSession session)
throws OdetteFtpException
- Begin the Secure Authentication phase after having exchanged SSIDs. This
phase is perform when the Secure Authentication option is agreed in the
Start Session negotiation phase.
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
- Specified by:
afterStartSession
in interface ProtocolHandler
- Overrides:
afterStartSession
in class DefaultHandler
- Throws:
OdetteFtpException
securityChangeDirectionReceived
public void securityChangeDirectionReceived(OdetteFtpSession session,
CommandExchangeBuffer command)
throws OdetteFtpException
- Specified by:
securityChangeDirectionReceived
in interface ProtocolHandler
- Overrides:
securityChangeDirectionReceived
in class OdetteFtpVer13Handler
- Throws:
OdetteFtpException
authenticationChallengeReceived
public void authenticationChallengeReceived(OdetteFtpSession session,
CommandExchangeBuffer auch)
throws OdetteFtpException
- Description copied from interface:
ProtocolHandler
- 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
- Specified by:
authenticationChallengeReceived
in interface ProtocolHandler
- Overrides:
authenticationChallengeReceived
in class OdetteFtpVer13Handler
- Throws:
OdetteFtpException
authenticationResponseReceived
public void authenticationResponseReceived(OdetteFtpSession session,
CommandExchangeBuffer aurp)
throws OdetteFtpException
- Specified by:
authenticationResponseReceived
in interface ProtocolHandler
- Overrides:
authenticationResponseReceived
in class OdetteFtpVer13Handler
- Throws:
OdetteFtpException
buildAnswerReasonInfoObject
protected AnswerReasonInfo buildAnswerReasonInfoObject(CommandExchangeBuffer response)
throws OdetteFtpException
- Overrides:
buildAnswerReasonInfoObject
in class OdetteFtpVer13Handler
- Throws:
OdetteFtpException
buildDeliveryNotificationCommand
protected CommandExchangeBuffer buildDeliveryNotificationCommand(DeliveryNotification notif)
- Overrides:
buildDeliveryNotificationCommand
in class OdetteFtpVer14Handler
buildEndFileCommand
protected CommandExchangeBuffer buildEndFileCommand(long recordCount,
long unitCount)
- Overrides:
buildEndFileCommand
in class OdetteFtpVer13Handler
buildEndFileNegativeAnswerCommand
protected CommandExchangeBuffer buildEndFileNegativeAnswerCommand(AnswerReason reason,
String reasonText)
- Overrides:
buildEndFileNegativeAnswerCommand
in class OdetteFtpVer13Handler
buildEndFilePositiveAnswerCommand
protected CommandExchangeBuffer buildEndFilePositiveAnswerCommand(boolean changeDirection)
- Overrides:
buildEndFilePositiveAnswerCommand
in class OdetteFtpVer13Handler
buildEndSessionCommand
protected CommandExchangeBuffer buildEndSessionCommand(EndSessionReason reason,
String reasonText)
- Overrides:
buildEndSessionCommand
in class OdetteFtpVer13Handler
buildEndSessionReasonInfoObject
protected EndSessionReasonInfo buildEndSessionReasonInfoObject(CommandExchangeBuffer esid)
throws OdetteFtpException
- Overrides:
buildEndSessionReasonInfoObject
in class OdetteFtpVer13Handler
- Throws:
OdetteFtpException
buildEndToEndResponse
protected DeliveryNotification buildEndToEndResponse(CommandExchangeBuffer eerp)
- Overrides:
buildEndToEndResponse
in class OdetteFtpVer13Handler
buildNegativeEndResponse
protected DeliveryNotification buildNegativeEndResponse(CommandExchangeBuffer nerp)
throws OdetteFtpException
- Overrides:
buildNegativeEndResponse
in class OdetteFtpVer14Handler
- Throws:
OdetteFtpException
buildReadyToReceiveCommand
protected CommandExchangeBuffer buildReadyToReceiveCommand()
- Overrides:
buildReadyToReceiveCommand
in class OdetteFtpVer13Handler
normalizeVirtualFile
protected VirtualFile normalizeVirtualFile(OdetteFtpSession session,
VirtualFile vf)
- Overrides:
normalizeVirtualFile
in class OdetteFtpVer14Handler
buildStartFileCommand
protected CommandExchangeBuffer buildStartFileCommand(OdetteFtpSession session,
VirtualFile vf)
- Overrides:
buildStartFileCommand
in class OdetteFtpVer14Handler
buildStartFileNegativeAnswerCommand
protected CommandExchangeBuffer buildStartFileNegativeAnswerCommand(AnswerReason reason,
String reasonText,
boolean retryLater)
- Overrides:
buildStartFileNegativeAnswerCommand
in class OdetteFtpVer13Handler
buildStartFilePositiveAnswerCommand
protected CommandExchangeBuffer buildStartFilePositiveAnswerCommand(long answerCount)
- Overrides:
buildStartFilePositiveAnswerCommand
in class OdetteFtpVer13Handler
buildStartSessionCommand
protected CommandExchangeBuffer buildStartSessionCommand(String code,
String pswd,
String userData,
OdetteFtpSession session)
- Overrides:
buildStartSessionCommand
in class OdetteFtpVer13Handler
buildVirtualFileObject
protected DefaultEnvelopedVirtualFile buildVirtualFileObject(OdetteFtpSession session,
CommandExchangeBuffer sfid)
throws OdetteFtpException
- Overrides:
buildVirtualFileObject
in class OdetteFtpVer14Handler
- Throws:
OdetteFtpException
protocolMaxFileSizeSupported
protected long protocolMaxFileSizeSupported()
- Overrides:
protocolMaxFileSizeSupported
in class OdetteFtpVer13Handler
checkSecureAuthentication
protected void checkSecureAuthentication(OdetteFtpSession session)
throws OdetteFtpException
- Throws:
OdetteFtpException
buildAuthenticationChallenge
protected CommandExchangeBuffer buildAuthenticationChallenge(byte[] encodedChallenge)
buildSecurityChangeDirection
protected CommandExchangeBuffer buildSecurityChangeDirection()
ACCORD