|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The IHostList interface specifies the functionality to manage the list of known and online peers. It specifies methods to add, remove, and retrieve peers (hosts).
Classes implementing this interface are also responsible to
remove hosts (garbage collection) that seem to be no longer alive
(no IAmAlive message within
IConstants.LIFETIME_OF_HOSTINFOS). This should be
implemented as a thread that can be stopped using the
stopGarbageCollector
method.
Method Summary | |
boolean |
contains(IHostInfo info)
Returns whether a given host identified by a IHostInfo object is contained in the host list. |
java.util.Enumeration |
elements()
Returns an enumeration with all the elements stored in the host list. |
IHostInfo |
get(java.lang.String hostId)
Retrieve a IHostInfo object from the host list. |
java.util.Enumeration |
keys()
Returns an enumeration with all the keys stored in the host list. |
IHostInfo |
put(IHostInfo info)
Insert a new IHostInfo object into this host list. |
IHostInfo |
remove(java.lang.String hostId)
Remove a host from the host list. |
void |
stopGarbageCollector()
Stop the garbage collector thread that removes inactive hosts from the host list. |
Method Detail |
public IHostInfo get(java.lang.String hostId)
hostId
- identifies the host to be retrieved. The format of
this identifier is registryHost:registryPort.
null
if the key is not mapped to any value in this
IHostList.public IHostInfo put(IHostInfo info)
info
- New IHostInfo object to be inserted.
null
if it did not have one.public IHostInfo remove(java.lang.String hostId)
hostId
- identifies the host to be retrieved. The format of
this identifier is registryHost:registryPort.
null
if the key did not have a
mapping.public boolean contains(IHostInfo info)
info
- the IHostInfo objecct identifying the host.
true
if this map maps one or more keys to
the specified value.public java.util.Enumeration keys()
public java.util.Enumeration elements()
public void stopGarbageCollector()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |