eu.emi.dsr.p2p
Class NeighborsManager

java.lang.Object
  extended by eu.emi.dsr.p2p.NeighborsManager

public class NeighborsManager
extends Object


Constructor Summary
protected NeighborsManager()
          Default constructor if you don't want to use as a singleton class
 
Method Summary
 void addNeighborsDSRs(org.codehaus.jettison.json.JSONArray entries, String type)
          Add neighbors GSRs.
static NeighborsManager getInstance()
          Get only one instance for the neighbors manager class.
 List<String> getNeighbors()
          Get list of neighbors.
 int getRetry()
          Get value of retry.
 void hashClear()
          Clear the hash table and set the neighbors count to 0.
 void resetUnavailableNeighbor(String url)
          Reset unavailable neighbor GSR if it is need.
 void setUnavailableNeighbor(String url)
          Set unavailable neighbor GSR.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeighborsManager

protected NeighborsManager()
Default constructor if you don't want to use as a singleton class

Parameters:
None -
Method Detail

getInstance

public static NeighborsManager getInstance()
Get only one instance for the neighbors manager class. Use this operation if you want to use this class as a Singleton.

Parameters:
None -
Returns:
NeighborsManager instance

hashClear

public void hashClear()
Clear the hash table and set the neighbors count to 0.

Parameters:
None -

getRetry

public int getRetry()
Get value of retry.

Parameters:
None -
Returns:
retry

getNeighbors

public List<String> getNeighbors()
Get list of neighbors.

Parameters:
None -
Returns:
list of neighbors URLs or own URL

addNeighborsDSRs

public void addNeighborsDSRs(org.codehaus.jettison.json.JSONArray entries,
                             String type)
Add neighbors GSRs.

Parameters:
List - of entries for global DSRs
Type - of the message (Register or Delete)

setUnavailableNeighbor

public void setUnavailableNeighbor(String url)
Set unavailable neighbor GSR.

Parameters:
URL - of the unavailable neighbor GSR

resetUnavailableNeighbor

public void resetUnavailableNeighbor(String url)
Reset unavailable neighbor GSR if it is need.

Parameters:
URL - of the available neighbor GSR


Copyright © 2012. All Rights Reserved.