Appia Documentation

net.sf.appia.protocols.total.sequencer
Class Buffer

java.lang.Object
  extended by net.sf.appia.protocols.total.sequencer.Buffer

public class Buffer
extends java.lang.Object

Class that implements a buffer to store events while waiting for the total order.


Constructor Summary
Buffer()
          Constructs a new Buffer object.
 
Method Summary
 InfoMessage find(int emissor, int seq)
          Finds and returns if available a InfoMessage object.
 GroupSendableEvent getMinimum()
          Returns an event from the buffer in a deterministic way.
 GroupSendableEvent getReadyEvent(int ordem)
          Gives an event ready to be delivered
 void insert(int o, int e, int seq, GroupSendableEvent ev)
          Insert a new InfoMessage
 void insertEvent(int emissor, int seq, GroupSendableEvent ev)
          Insert a new event
 void insertOrder(int o, int emissor, int seq)
          Insert a new order
 boolean isEmpty()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Buffer

public Buffer()
Constructs a new Buffer object.

Method Detail

insert

public void insert(int o,
                   int e,
                   int seq,
                   GroupSendableEvent ev)
Insert a new InfoMessage

Parameters:
o - total order of the message
e - sender of the message
seq - individual sequence number
ev - the event to be stored

find

public InfoMessage find(int emissor,
                        int seq)
Finds and returns if available a InfoMessage object.

Parameters:
emissor - sender of the message that wanted
seq - sequence number of the message wanted

insertOrder

public void insertOrder(int o,
                        int emissor,
                        int seq)
Insert a new order

Parameters:
o - the order to be given to the message
emissor - the sender of the message to be ordered
seq - the individual sequence number of the message to be ordered

insertEvent

public void insertEvent(int emissor,
                        int seq,
                        GroupSendableEvent ev)
Insert a new event

Parameters:
emissor - the sender of the message to be ordered
seq - the individual sequence number of the message to be ordered
ev - the event to be ordered

getReadyEvent

public GroupSendableEvent getReadyEvent(int ordem)
Gives an event ready to be delivered

Returns:
The event to be delivered or null if none is available

isEmpty

public boolean isEmpty()
Returns:
true if the buffer is empty and false otherwise

size

public int size()

getMinimum

public GroupSendableEvent getMinimum()
Returns an event from the buffer in a deterministic way. Used when there are view changes in the group

Returns:
The event

Appia Documentation

COPYRIGHT 2006-2009, University of Lisbon and INESC-ID
For updates and related information please see Appia Home Page
Send questions, sugestions or remarks to the appia-users mailing list