net.tomp2p.replication
Class Replication

java.lang.Object
  extended by net.tomp2p.replication.Replication
All Implemented Interfaces:
PeerMapChangeListener

public class Replication
extends Object
implements PeerMapChangeListener

This class has 3 methods that are called from outside eventes: check, peerInsert, peerRemoved.


Constructor Summary
Replication(ReplicationStorage replicationStorage, PeerAddress selfAddress, PeerMap peerMap)
           
 
Method Summary
 void addResponsibilityListener(ResponsibilityListener responsibilityListener)
           
 void checkResponsibility(Number160 locationKey)
           
 boolean isReplicationEnabled()
           
 void peerInserted(PeerAddress peerAddress)
          This method is called if a peer is added to the map
 void peerRemoved(PeerAddress peerAddress)
          This method is called if a peer is removed from the map
 void peerUpdated(PeerAddress peerAddress)
          This method is called if a peer is updated.
 void removeResponsibilityListener(ResponsibilityListener responsibilityListener)
           
 void updatePeerMapIfCloser(Number160 locationKey, Number160 current)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replication

public Replication(ReplicationStorage replicationStorage,
                   PeerAddress selfAddress,
                   PeerMap peerMap)
Method Detail

isReplicationEnabled

public boolean isReplicationEnabled()

addResponsibilityListener

public void addResponsibilityListener(ResponsibilityListener responsibilityListener)

removeResponsibilityListener

public void removeResponsibilityListener(ResponsibilityListener responsibilityListener)

checkResponsibility

public void checkResponsibility(Number160 locationKey)

updatePeerMapIfCloser

public void updatePeerMapIfCloser(Number160 locationKey,
                                  Number160 current)

peerInserted

public void peerInserted(PeerAddress peerAddress)
Description copied from interface: PeerMapChangeListener
This method is called if a peer is added to the map

Specified by:
peerInserted in interface PeerMapChangeListener
Parameters:
peerAddress - The peer that has been added.

peerRemoved

public void peerRemoved(PeerAddress peerAddress)
Description copied from interface: PeerMapChangeListener
This method is called if a peer is removed from the map

Specified by:
peerRemoved in interface PeerMapChangeListener
Parameters:
peerAddress - The peer that has been removed and add to the cache.

peerUpdated

public void peerUpdated(PeerAddress peerAddress)
Description copied from interface: PeerMapChangeListener
This method is called if a peer is updated.

Specified by:
peerUpdated in interface PeerMapChangeListener
Parameters:
peerAddress - The peer can change its IP and some statistical data


Copyright © 2013. All Rights Reserved.