|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.tomp2p.replication.Replication
public class Replication
This class has 3 methods that are called from outside eventes: check, peerInsert, peerRemoved.
| Constructor Summary | |
|---|---|
Replication(ReplicationStorage replicationStorage,
PeerAddress selfAddress,
PeerMap peerMap,
int replicationFactor)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addResponsibilityListener(ResponsibilityListener responsibilityListener)
Add responsibility listener. |
int |
getReplicationFactor()
|
boolean |
isReplicationEnabled()
Checks if the user enabled replication. |
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)
Remove a responsibility listener. |
void |
setReplicationFactor(int replicationFactor)
|
void |
updateAndNotifyResponsibilities(Number160 locationKey)
Update responsibilities. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Replication(ReplicationStorage replicationStorage,
PeerAddress selfAddress,
PeerMap peerMap,
int replicationFactor)
replicationStorage - The interface where we shore the replication responsibilitiesselfAddress - My address to know for what my peer is responsiblepeerMap - The map of my neighborsreplicationFactor - The replication factor| Method Detail |
|---|
public void setReplicationFactor(int replicationFactor)
replicationFactor - Set the replication factorpublic int getReplicationFactor()
public boolean isReplicationEnabled()
public void addResponsibilityListener(ResponsibilityListener responsibilityListener)
responsibilityListener - The responsibility listener.public void removeResponsibilityListener(ResponsibilityListener responsibilityListener)
responsibilityListener - The responsibility listener.public void updateAndNotifyResponsibilities(Number160 locationKey)
locationKey - The location key.public void peerInserted(PeerAddress peerAddress)
PeerMapChangeListener
peerInserted in interface PeerMapChangeListenerpeerAddress - The peer that has been added.public void peerRemoved(PeerAddress peerAddress)
PeerMapChangeListener
peerRemoved in interface PeerMapChangeListenerpeerAddress - The peer that has been removed and add to the cache.public void peerUpdated(PeerAddress peerAddress)
PeerMapChangeListener
peerUpdated in interface PeerMapChangeListenerpeerAddress - The peer can change its IP and some statistical data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||