org.fossilec.odettej.transport.mbgw
Class MoreDataBitTransport

java.lang.Object
  extended by org.fossilec.odettej.transport.tcp.TCPTransport
      extended by org.fossilec.odettej.transport.mbgw.MoreDataBitTransport
All Implemented Interfaces:
Transport

public class MoreDataBitTransport
extends TCPTransport

This is a transport implementation of the More Data Bit protocol for tunneling TCP/IP packages over X.25. It control the streaming sequence of bytes over TCP/IP transmission using a header flag. In this implementation it's done by overriding send() and receive() methods from the TCPTransport class.

The More Data Bit protocol is required for using OdetteJ with TCP/IP - X.25 gateways. It have been specific used with Access equipments by Microtronix (http://www.microtronix.com/).

Author:
Rafael Marins
See Also:
Transport

Constructor Summary
MoreDataBitTransport()
          Default constructor.
MoreDataBitTransport(java.nio.channels.SocketChannel channel)
          Creates a new class instance providing an existing SocketChannel.
 
Method Summary
 int receive(java.nio.ByteBuffer dest)
          Control the receiving More Data Bit packet headers using parent's receive() method.
 int send(java.nio.ByteBuffer buffer)
          Send a buffer using the More Data Bit control header.
 
Methods inherited from class org.fossilec.odettej.transport.tcp.TCPTransport
connect, connect, disconnect, getChannel, getLocalAddress, getRemoteAddress, isConnected, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoreDataBitTransport

public MoreDataBitTransport()
Default constructor.

See Also:
TCPTransport.TCPTransport()

MoreDataBitTransport

public MoreDataBitTransport(java.nio.channels.SocketChannel channel)
                     throws OdetteFTPException
Creates a new class instance providing an existing SocketChannel.

Throws:
OdetteFTPException
See Also:
TCPTransport.TCPTransport(SocketChannel)
Method Detail

receive

public int receive(java.nio.ByteBuffer dest)
            throws OdetteFTPException
Control the receiving More Data Bit packet headers using parent's receive() method. More information on this method function see TCPTransport.receive(ByteBuffer) for details.

Specified by:
receive in interface Transport
Overrides:
receive in class TCPTransport
Parameters:
dest - The buffer into which bytes are to be transferred
Returns:
The number of bytes received, possibly zero, or -1 if the channel has reached end-of-stream
Throws:
NotConnectedException - Transport not yet connected
OdetteFTPException - Thrown by unexpected exception
See Also:
TCPTransport.receive(ByteBuffer)

send

public int send(java.nio.ByteBuffer buffer)
         throws OdetteFTPException
Send a buffer using the More Data Bit control header. More information on this method function see TCPTransport.send(ByteBuffer).

Specified by:
send in interface Transport
Overrides:
send in class TCPTransport
Parameters:
buffer - The buffer from which bytes are to be retrieved
Returns:
The number of bytes sent, possibly zero
Throws:
NotConnectedException - Transport not yet connected
OdetteFTPException - unexpected exception
See Also:
TCPTransport.send(ByteBuffer)


Copyright © 2005 ObjectWeb Consortium. All Rights Reserved.