it.unitn.ds.peersim.protocols
Class BestEffortBroadcast

java.lang.Object
  extended by it.unitn.ds.peersim.protocols.BestEffortBroadcast
All Implemented Interfaces:
java.lang.Cloneable, peersim.core.Protocol, peersim.edsim.EDProtocol, peersim.transport.Transport

public class BestEffortBroadcast
extends java.lang.Object
implements java.lang.Cloneable, peersim.transport.Transport, peersim.edsim.EDProtocol

Distributed Systems Course Project

Year: 2009/2010

University of Trento

BestEffortBroadcast. This class implements the Best Effort Broadcast.

Version:
1.0
Author:
Avancini Mattia, Giampaolo Farina
See Also:
http://peersim.sourceforge.net/

Constructor Summary
BestEffortBroadcast(java.lang.String prefix)
          Instantiates a new best effort broadcast.
 
Method Summary
 java.lang.Object clone()
           
 long getLatency(peersim.core.Node src, peersim.core.Node dest)
           
 void processEvent(peersim.core.Node node, int pid, java.lang.Object event)
          When a message is received by the Best Effort Broadcast, it is decapsulated and then it is sent to the upper layer, the consensus layer.
 void send(peersim.core.Node src, peersim.core.Node dest, java.lang.Object consensusMessage, int protocolID)
          Executes the broadcasts: sends the message to all the nodes of the network.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BestEffortBroadcast

public BestEffortBroadcast(java.lang.String prefix)
Instantiates a new best effort broadcast.

Parameters:
prefix - string prefix for config properties
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in interface peersim.core.Protocol
Overrides:
clone in class java.lang.Object
See Also:
Protocol.clone()

send

public void send(peersim.core.Node src,
                 peersim.core.Node dest,
                 java.lang.Object consensusMessage,
                 int protocolID)
Executes the broadcasts: sends the message to all the nodes of the network.

Specified by:
send in interface peersim.transport.Transport
See Also:
Transport.send(peersim.core.Node, peersim.core.Node, java.lang.Object, int)

processEvent

public void processEvent(peersim.core.Node node,
                         int pid,
                         java.lang.Object event)
When a message is received by the Best Effort Broadcast, it is decapsulated and then it is sent to the upper layer, the consensus layer.

Specified by:
processEvent in interface peersim.edsim.EDProtocol
See Also:
EDProtocol.processEvent(peersim.core.Node, int, java.lang.Object)

getLatency

public long getLatency(peersim.core.Node src,
                       peersim.core.Node dest)
Specified by:
getLatency in interface peersim.transport.Transport
See Also:
Transport.getLatency(peersim.core.Node, peersim.core.Node)