|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DistributedMap
Maps keys to values in a distributed setting using Identifiers
as keys. Methods throw IOException if a network error occurs and
RoutingException if a routing specific error occurs in the overlay network.
Note that RoutingException is a subclass of IOException so if the
distinction is not needed, IOException is the only checked exception that
needs to be handled.
| Method Summary | |
|---|---|
void |
addNeighbourhoodListener(NeighbourhoodListener listener)
Adds a NeighbourhoodListener. |
void |
close()
Closes the map and releases all ressources. |
boolean |
contains(Identifier key)
Returns true if the map contains the specified key and
false otherwise. |
Serializable |
get(Identifier key)
Returns the value associated with the specified key or null
if does not exist. |
int |
getContactPort()
Returns the contact port set using the setContactPort(int) method. |
void |
put(Identifier key,
Serializable value)
Associates the specified value with the specified key. |
void |
remove(Identifier key)
Removes the mapping with the specified key from this map (optional operation). |
void |
removeNeighbourhoodListener(NeighbourhoodListener listener)
Removes a NeighbourhoodListener. |
List |
responsiblePeers(Identifier key)
Returns a List of InetSocketAddresses identifying the peers
responsible for the specified key according to the underlying
routing algorithm. |
void |
setContactPort(int port)
Sets the contact port of this peer. |
| Method Detail |
|---|
void close()
throws IOException
IOException
boolean contains(Identifier key)
throws IOException,
RoutingException
true if the map contains the specified key and
false otherwise.
IOException
RoutingException
Serializable get(Identifier key)
throws IOException,
RoutingException
null
if does not exist.
IOException
RoutingException
void put(Identifier key,
Serializable value)
throws IOException,
RoutingException
IOException
RoutingException
void remove(Identifier key)
throws IOException,
RoutingException
IOException
RoutingExceptionint getContactPort()
setContactPort(int) method.
void setContactPort(int port)
responsiblePeers(org.planx.xmlstore.routing.Identifier) method.
The behavoir of setting the contact port after bootstrapping is unspecified.
List responsiblePeers(Identifier key)
throws IOException,
RoutingException
InetSocketAddresses identifying the peers
responsible for the specified key according to the underlying
routing algorithm. The InetSocketAddresses consist of the IP number of
the peer and the contact port specified using the setContactPort(int)
method at the peer.
Note that the number of returned peers is not specified - the specific
number will be implementation dependent.
IOException
RoutingExceptionvoid addNeighbourhoodListener(NeighbourhoodListener listener)
NeighbourhoodListener.
void removeNeighbourhoodListener(NeighbourhoodListener listener)
NeighbourhoodListener.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||