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.peerreview.replay.playback
Class ReplayLayer<Identifier>

    java.lang.Object
      org.mpisws.p2p.transport.peerreview.Verifier<Identifier>
          org.mpisws.p2p.transport.peerreview.replay.playback.ReplayLayer<Identifier>

All Implemented Interfaces:
  PeerReviewEvents, TransportLayer<Identifier,java.nio.ByteBuffer>, Destructable

    public class ReplayLayer<Identifier>

extends Verifier<Identifier>
implements TransportLayer<Identifier,java.nio.ByteBuffer>

Field Summary

Fields inherited from class org.mpisws.p2p.transport.peerreview.Verifier
`hashProv, history, localHandle, logger, serializer`

Fields inherited from interface org.mpisws.p2p.transport.peerreview.PeerReviewEvents
`EVT_ACK, EVT_CHECKPOINT, EVT_INIT, EVT_RECV, EVT_SEND, EVT_SENDSIGN, EVT_SIGN, EVT_SOCKET_CAN_READ, EVT_SOCKET_CAN_RW, EVT_SOCKET_CAN_WRITE, EVT_SOCKET_CLOSE, EVT_SOCKET_CLOSED, EVT_SOCKET_EXCEPTION, EVT_SOCKET_OPEN_INCOMING, EVT_SOCKET_OPEN_OUTGOING, EVT_SOCKET_OPENED_OUTGOING, EVT_SOCKET_READ, EVT_SOCKET_WRITE`

Constructor Summary
`ReplayLayer(IdentifierSerializer<Identifier> serializer, HashProvider hashProv, SecureHistory history, Identifier localHandle, Environment environment)`

Method Summary
`void` | `acceptMessages(boolean b)` Toggle accepting incoming messages.
`void` | `acceptSockets(boolean b)` Toggle accepting new sockets.
`void` | `destroy()`
`static Environment` | `generateEnvironment(java.lang.String name, long startTime, long randSeed)`
`Identifier` | `getLocalIdentifier()` The local node.
`SocketRequestHandle<Identifier>` | `openSocket(Identifier i, SocketCallback<Identifier> deliverSocketToMe, java.util.Map<java.lang.String,java.lang.Integer> options)` Open a socket to the Identifier
`protected void` | `receive(Identifier from, java.nio.ByteBuffer msg, long timeToDeliver)`
`MessageRequestHandle<Identifier,java.nio.ByteBuffer>` | `sendMessage(Identifier i, java.nio.ByteBuffer m, MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Integer> options)` Send the message to the identifier
`void` | `setCallback(TransportLayerCallback<Identifier,java.nio.ByteBuffer> 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 class org.mpisws.p2p.transport.peerreview.Verifier
`fetchNextEvent, getNextEvent, getNextEventTime, makeProgress, registerEvent, registerEvent, send, verifiedOK`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ReplayLayer

    public ReplayLayer(IdentifierSerializer<Identifier> serializer,
                       HashProvider hashProv,
                       SecureHistory history,
                       Identifier localHandle,
                       Environment environment)
                throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### openSocket

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

  Description copied from interface: `TransportLayer`
  Open a socket to the Identifier

  Specified by:
    `openSocket` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`
  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

    public MessageRequestHandle<Identifier,java.nio.ByteBuffer> sendMessage(Identifier i,
                                                                            java.nio.ByteBuffer m,
                                                                            MessageCallback<Identifier,java.nio.ByteBuffer> deliverAckToMe,
                                                                            java.util.Map<java.lang.String,java.lang.Integer> options)

  Description copied from interface: `TransportLayer`
  Send the message to the identifier

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

### getLocalIdentifier

    public Identifier getLocalIdentifier()

  Description copied from interface: `TransportLayer`
  The local node.

  Specified by:
    `getLocalIdentifier` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`
  Returns:
    The local node.

### setCallback

    public void setCallback(TransportLayerCallback<Identifier,java.nio.ByteBuffer> callback)

  Description copied from interface: `TransportLayer`
  Set the callback for incoming sockets/messages

  Specified by:
    `setCallback` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`
  Parameters:
    `callback` - the callback for incoming sockets/messages

### setErrorHandler

    public void setErrorHandler(ErrorHandler<Identifier> handler)

  Description copied from interface: `TransportLayer`
  To be notified of problems not related to an outgoing messaage/socket. Or to be notified if a callback isn't provided.

  Specified by:
    `setErrorHandler` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`
  Parameters:
    `handler` - to be notified of problems not related to a specific messaage/socket.

### destroy

    public void destroy()

  Specified by:
    `destroy` in interface `Destructable`

### acceptMessages

    public void acceptMessages(boolean b)

  Description copied from interface: `TransportLayer`
  Toggle accepting incoming messages. Useful in flow control if overwhelmed by incoming sockets. Default: true

  Specified by:
    `acceptMessages` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`

### acceptSockets

    public void acceptSockets(boolean b)

  Description copied from interface: `TransportLayer`
  Toggle accepting new sockets. Useful in flow control if overwhelmed by incoming sockets. Default: true

  Specified by:
    `acceptSockets` in interface `TransportLayer<Identifier,java.nio.ByteBuffer>`

### receive

    protected void receive(Identifier from,
                           java.nio.ByteBuffer msg,
                           long timeToDeliver)

  Specified by:
    `receive` in class `Verifier<Identifier>`

### generateEnvironment

    public static Environment generateEnvironment(java.lang.String name,
                                                  long startTime,
                                                  long randSeed)

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.