net.sf.beep4j.internal
Interface TransportMapping

All Superinterfaces:
SessionListener
All Known Implementing Classes:
TCPMapping

public interface TransportMapping
extends SessionListener

A TransportMapping implements a transport mapping as described by section 2.5 of the BEEP specification (RFC 3080). The interface is meant to be generally applicable. But it could be that it needs some rework for other transport mappings as those specified by RFC 3081.

General responsibilities of implementors are:

Author:
Simon Raess

Method Summary
 void checkFrame(int channel, long seqno, int size)
          Checks that an incoming frame is valid.
 void closeTransport()
          Instructs the mapping to close the underlying Transport object.
 void frameReceived(int channel, long seqno, int size)
          Invoked by the framework to notify the mapping that the parsing of the message has completed.
 void processMappingFrame(java.lang.String[] token)
          Process a mapping frame.
 void sendANS(int channel, int messageNumber, int answerNumber, Message message)
          Sends a message of type ANS.
 void sendERR(int channel, int messageNumber, Message message)
          Sends a message of type ERR.
 void sendMSG(int channel, int messageNumber, Message message)
          Sends a message of type MSG.
 void sendNUL(int channel, int messageNumber)
          Sends a message of type NUL.
 void sendRPY(int channel, int messageNumber, Message message)
          Sends a message of type RPY.
 
Methods inherited from interface net.sf.beep4j.internal.SessionListener
channelClosed, channelStarted
 

Method Detail

processMappingFrame

void processMappingFrame(java.lang.String[] token)
Process a mapping frame. This method receives the header tokens. As the TCP mapping is currently the only existing mapping, this is sufficient. If there ever exists another mapping that defines a payload for mapping frames, some changes would have to be implemented.

Parameters:
token - the header tokens (i.e. header is split on spaces)

checkFrame

void checkFrame(int channel,
                long seqno,
                int size)
Checks that an incoming frame is valid. This method is called after the header has been parsed, but before the parsing of the body has started.

Parameters:
channel - the channel number of the message
seqno - the sequence number of the message
size - the payload size of the message

frameReceived

void frameReceived(int channel,
                   long seqno,
                   int size)
Invoked by the framework to notify the mapping that the parsing of the message has completed.

Parameters:
channel - the channel number of the message
seqno - the sequence number of the message
size - the size of the message

sendMSG

void sendMSG(int channel,
             int messageNumber,
             Message message)
Sends a message of type MSG.

Parameters:
channel - the channel number
messageNumber - the message number
message - the message

sendRPY

void sendRPY(int channel,
             int messageNumber,
             Message message)
Sends a message of type RPY.

Parameters:
channel - the channel number
messageNumber - the message number
message - the message

sendERR

void sendERR(int channel,
             int messageNumber,
             Message message)
Sends a message of type ERR.

Parameters:
channel - the channel number
messageNumber - the message number
message - the message

sendANS

void sendANS(int channel,
             int messageNumber,
             int answerNumber,
             Message message)
Sends a message of type ANS.

Parameters:
channel - the channel number
messageNumber - the message number
message - the message

sendNUL

void sendNUL(int channel,
             int messageNumber)
Sends a message of type NUL.

Parameters:
channel - the channel number
messageNumber - the message number
message - the message

closeTransport

void closeTransport()
Instructs the mapping to close the underlying Transport object.



Copyright © 2007 null. All Rights Reserved.