Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mpisws.p2p.transport
Interface TransportLayer<Identifier,MessageType>

Type Parameters:
  `Identifier` - The type of node this layer operates on.
  `MessageType` - The type of message this layer sends.
  `E` - The type of exceptions this layer produces.

All Superinterfaces:
  Destructable

All Known Subinterfaces:
  CertificateTransportLayer, CommonAPITransportLayer<Identifier>, LimitBandwidhtTransportLayer<Identifier>, LivenessTransportLayer<Identifier,MsgType>, LowerIdentity<Identifier,MessageType>, MultiInetAddressTransportLayer, PriorityTransportLayer<Identifier>, SourceRouteManager<Identifier>, SourceRouteTransportLayer<Identifier>, SSLTransportLayer, UpperIdentity<Identifier,MessageType>, WireTransportLayer

All Known Implementing Classes:
  BandwidthLimitingTransportLayer, CommonAPITransportLayerImpl, DirectTransportLayer, FirewallTLImpl, LimitSocketsTransportLayer, LivenessTransportLayerImpl, MagicNumberTransportLayer, MultiInetAddressTransportLayerImpl, NodeHandleAdapter, PeerReviewImpl, PriorityTransportLayerImpl, RecordLayer, RendezvousTransportLayerImpl, ReplayLayer, SourceRouteManagerImpl, SourceRouteTransportLayerImpl, WireTransportLayerImpl

    public interface TransportLayer<Identifier,MessageType>

extends Destructable

The transport layer does provides the minimum functionality to provide communication with flow control.

Author:
  Jeff Hoye

Method Summary
`void` | `acceptMessages(boolean b)` Toggle accepting incoming messages.
`void` | `acceptSockets(boolean b)` Toggle accepting new sockets.
`Identifier` | `getLocalIdentifier()` The local node.
`SocketRequestHandle<Identifier>` | `openSocket(Identifier i, SocketCallback<Identifier> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Object> options)` Open a socket to the Identifier
`MessageRequestHandle<Identifier,MessageType>` | `sendMessage(Identifier i, MessageType m, MessageCallback<Identifier,MessageType> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)` Send the message to the identifier
`void` | `setCallback(TransportLayerCallback<Identifier,MessageType> callback)` Set the callback for incoming sockets/messages
`void` | `setErrorHandler(ErrorHandler<Identifier> handler)` To be notified of problems not related to an outgoing messaage/socket.

Methods inherited from interface rice.Destructable
`destroy`

Method Detail

### openSocket

    SocketRequestHandle<Identifier> openSocket(Identifier i,
                                               SocketCallback<Identifier> deliverSocketToMe,
                                               java.util.Map<java.lang.String,java.lang.Object> options)

  Open a socket to the Identifier

  Parameters:
    `i` - who to open the socket to
    `deliverSocketToMe` - the callback when the socket is opened
    `options` - options on how to open the socket (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
  Returns:
    an object to cancel opening the socket if it takes to long, or is no longer relevent

### sendMessage

    MessageRequestHandle<Identifier,MessageType> sendMessage(Identifier i,
                                                             MessageType m,
                                                             MessageCallback<Identifier,MessageType> deliverAckToMe,
                                                             java.util.Map<java.lang.String,java.lang.Object> options)

  Send the message to the identifier

  Parameters:
    `i` - the destination
    `m` - the message
    `options` - delivery options (don't source route, encrypt etc) (may not be respected if layer cannot provide service)
    `deliverAckToMe` - layer dependent notification when the message is sent (can indicate placed on the wire, point-to-point acknowledgement, or end-to-end acknowledgement)
  Returns:
    ability to cancel the message if no longer relevent

### getLocalIdentifier

    Identifier getLocalIdentifier()

  The local node.

  Returns:
    The local node.

### acceptSockets

    void acceptSockets(boolean b)

  Toggle accepting new sockets. Useful in flow control if overwhelmed by incoming sockets. Default: true

  Parameters:
    `b` -

### acceptMessages

    void acceptMessages(boolean b)

  Toggle accepting incoming messages. Useful in flow control if overwhelmed by incoming sockets. Default: true

  Parameters:
    `b` -

### setCallback

    void setCallback(TransportLayerCallback<Identifier,MessageType> callback)

  Set the callback for incoming sockets/messages

  Parameters:
    `callback` - the callback for incoming sockets/messages

### setErrorHandler

    void setErrorHandler(ErrorHandler<Identifier> handler)

  To be notified of problems not related to an outgoing messaage/socket. Or to be notified if a callback isn't provided.

  Parameters:
    `handler` - to be notified of problems not related to a specific messaage/socket.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.