Rice Pastry API

org.mpisws.p2p.transport.priority
Interface PriorityTransportLayer<Identifier>

All Superinterfaces:
Destructable, TransportLayer<Identifier,java.nio.ByteBuffer>
All Known Implementing Classes:
PriorityTransportLayerImpl

public interface PriorityTransportLayer<Identifier>
extends TransportLayer<Identifier,java.nio.ByteBuffer>

Does 3 things: a) Sends messages on a Socket (depending on the options). b) Prioritizes messages into queues. c) calls sendFailed if there is a liveness change

Author:
Jeff Hoye

Field Summary
static byte DEFAULT_PRIORITY
           
static byte HIGH_PRIORITY
           
static byte LOW_PRIORITY
           
static byte LOWEST_PRIORITY
           
static byte MAX_PRIORITY
           
static byte MEDIUM_HIGH_PRIORITY
           
static byte MEDIUM_LOW_PRIORITY
           
static byte MEDIUM_PRIORITY
           
static java.lang.String OPTION_PRIORITY
           
static int STATUS_CONNECTED
           
static int STATUS_CONNECTING
           
static int STATUS_NOT_CONNECTED
           
 
Method Summary
 void addPrimarySocketListener(PrimarySocketListener<Identifier> listener)
           
 void addPriorityTransportLayerListener(PriorityTransportLayerListener<Identifier> listener)
           
 void addTransportLayerListener(TransportLayerListener<Identifier> listener)
           
 long bytesPending(Identifier i)
          The number of bytes to be sent to the identifier
 java.util.Map<java.lang.String,java.lang.Object> connectionOptions(Identifier i)
          Returns the options on the primary connection
 int connectionStatus(Identifier i)
          Returns if there is a primary connection to the identifier
 java.util.List<MessageInfo> getPendingMessages(Identifier i)
          The number of bytes to be sent to the identifier
 java.util.Collection<Identifier> nodesWithPendingMessages()
          usually used with bytesPending() or queueLength()
 void openPrimaryConnection(Identifier i, java.util.Map<java.lang.String,java.lang.Object> options)
          open a primary connection
 int queueLength(Identifier i)
          Returns the number of messages pending to be sent
 void removePrimarySocketListener(PrimarySocketListener<Identifier> listener)
           
 void removePriorityTransportLayerListener(PriorityTransportLayerListener<Identifier> listener)
           
 void removeTransportLayerListener(TransportLayerListener<Identifier> listener)
           
 
Methods inherited from interface org.mpisws.p2p.transport.TransportLayer
acceptMessages, acceptSockets, getLocalIdentifier, openSocket, sendMessage, setCallback, setErrorHandler
 
Methods inherited from interface rice.Destructable
destroy
 

Field Detail

OPTION_PRIORITY

static final java.lang.String OPTION_PRIORITY
See Also:
Constant Field Values

MAX_PRIORITY

static final byte MAX_PRIORITY
See Also:
Constant Field Values

HIGH_PRIORITY

static final byte HIGH_PRIORITY
See Also:
Constant Field Values

MEDIUM_HIGH_PRIORITY

static final byte MEDIUM_HIGH_PRIORITY
See Also:
Constant Field Values

MEDIUM_PRIORITY

static final byte MEDIUM_PRIORITY
See Also:
Constant Field Values

MEDIUM_LOW_PRIORITY

static final byte MEDIUM_LOW_PRIORITY
See Also:
Constant Field Values

LOW_PRIORITY

static final byte LOW_PRIORITY
See Also:
Constant Field Values

LOWEST_PRIORITY

static final byte LOWEST_PRIORITY
See Also:
Constant Field Values

DEFAULT_PRIORITY

static final byte DEFAULT_PRIORITY
See Also:
Constant Field Values

STATUS_NOT_CONNECTED

static final int STATUS_NOT_CONNECTED
See Also:
Constant Field Values

STATUS_CONNECTING

static final int STATUS_CONNECTING
See Also:
Constant Field Values

STATUS_CONNECTED

static final int STATUS_CONNECTED
See Also:
Constant Field Values
Method Detail

addTransportLayerListener

void addTransportLayerListener(TransportLayerListener<Identifier> listener)

removeTransportLayerListener

void removeTransportLayerListener(TransportLayerListener<Identifier> listener)

addPriorityTransportLayerListener

void addPriorityTransportLayerListener(PriorityTransportLayerListener<Identifier> listener)

removePriorityTransportLayerListener

void removePriorityTransportLayerListener(PriorityTransportLayerListener<Identifier> listener)

connectionStatus

int connectionStatus(Identifier i)
Returns if there is a primary connection to the identifier

Parameters:
i -
Returns:
STATUS_NOT_CONNECTED, STATUS_CONNECTING, STATUS_CONNECTED

connectionOptions

java.util.Map<java.lang.String,java.lang.Object> connectionOptions(Identifier i)
Returns the options on the primary connection

Parameters:
i -
Returns:

nodesWithPendingMessages

java.util.Collection<Identifier> nodesWithPendingMessages()
usually used with bytesPending() or queueLength()

Returns:
any Identifier with messages to be sent

queueLength

int queueLength(Identifier i)
Returns the number of messages pending to be sent

Parameters:
i -
Returns:

bytesPending

long bytesPending(Identifier i)
The number of bytes to be sent to the identifier

Parameters:
i -
Returns:

getPendingMessages

java.util.List<MessageInfo> getPendingMessages(Identifier i)
The number of bytes to be sent to the identifier

Parameters:
i -
Returns:

openPrimaryConnection

void openPrimaryConnection(Identifier i,
                           java.util.Map<java.lang.String,java.lang.Object> options)
open a primary connection

Parameters:
i -
notifyMe - when it is open

addPrimarySocketListener

void addPrimarySocketListener(PrimarySocketListener<Identifier> listener)

removePrimarySocketListener

void removePrimarySocketListener(PrimarySocketListener<Identifier> listener)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection