|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kth.dks.JDHT
public class JDHT
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
JDHT()
Creates an empty local Distributed Hash Table (DHT), listening on default port 4440 Other nodes can connect to this DHT using a reference to this instance An IMPORTANT invariant is to call close() upon exit to disconnect. |
|
JDHT(int port)
Creates an empty local Distributed Hash Table (DHT), listening on default port 4440 Other nodes can connect to this DHT using a reference to this instance An IMPORTANT invariant is to call close() upon exit to disconnect. |
|
JDHT(int port,
java.lang.String url)
Joins an existing Distributed Hash Table (DHT) running on some machines, will bind to the supplied local port number An IMPORTANT invariant is to call close() upon exit to disconnect. |
|
JDHT(java.lang.String url)
Joins an existing Distributed Hash Table (DHT) running on some machines, will bind to local port 4444 An IMPORTANT invariant is to call close() upon exit to disconnect. |
|
| Method Summary | |
|---|---|
void |
clear()
Currently unimplemented, will throw UnsupportedOperationException |
void |
close()
Unbinds from the local port and disconnects from the DHT. |
boolean |
containsKey(java.lang.Object key)
Returns whether the key exists in the DHT Makes use of hashCode() in key |
boolean |
containsValue(java.lang.Object value)
Currently unimplemented, will throw UnsupportedOperationException |
java.util.Set |
entrySet()
Currently unimplemented, will throw UnsupportedOperationException |
boolean |
equals(java.lang.Object o)
Currently unimplemented, will throw UnsupportedOperationException |
java.lang.Object |
get(java.lang.Object key)
Gets the value associated with key in the DHT Makes use of hashCode() in key |
java.lang.String |
getReference()
Returns a stringified reference to the current DHT instance. |
boolean |
isEmpty()
Currently unimplemented, will throw UnsupportedOperationException |
java.util.Set |
keySet()
Currently unimplemented, will throw UnsupportedOperationException |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Inserts an item (key/value pair) into the DHT It requires the value to be serializable, and depends on the hashCode() implementation of key |
void |
putAll(java.util.Map t)
Currently unimplemented, will throw UnsupportedOperationException |
java.lang.Object |
remove(java.lang.Object key)
Currently unimplemented, will throw UnsupportedOperationException |
int |
size()
Currently unimplemented, will throw UnsupportedOperationException |
java.util.Collection |
values()
Currently unimplemented, will throw UnsupportedOperationException |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode |
| Constructor Detail |
|---|
public JDHT()
throws java.io.IOException
java.io.IOException - thrown if it cannot bind to the local portclose(),
getReference()
public JDHT(int port)
throws java.io.IOException
port - int port number to bind to
java.io.IOException - thrown if it cannot bind to the local portclose(),
getReference()
public JDHT(java.lang.String url)
throws java.io.IOException,
DKSTooManyRestartJoins,
DKSIdentifierAlreadyTaken,
DKSRefNoResponse
url - String reference to an existing node running a DHT
java.io.IOException - thrown if there is a problem binding to the local port
DKSTooManyRestartJoins - if it cannot join (see DKS documentation)
DKSIdentifierAlreadyTaken - if the internal DKS identifier is already taken
DKSRefNoResponse - if the existing node (url) does not respondgetReference(),
close()
public JDHT(int port,
java.lang.String url)
throws java.io.IOException,
DKSTooManyRestartJoins,
DKSIdentifierAlreadyTaken,
DKSRefNoResponse
port - int local port number to bind tourl - String reference to an existing node running a DHT
java.io.IOException - thrown if there is a problem binding to the local port
DKSTooManyRestartJoins - if it cannot join (see DKS documentation)
DKSIdentifierAlreadyTaken - if the internal DKS identifier is already taken
DKSRefNoResponse - if the existing node (url) does not respondclose(),
getReference()| Method Detail |
|---|
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapkey - Object key of the itemvalue - Object value of the item
public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapkey - Object key of the item
public java.lang.String getReference()
public void close()
public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mapkey - Object key of the item
public java.lang.Object remove(java.lang.Object key)
throws java.lang.UnsupportedOperationException
remove in interface java.util.Mapkey - Object
java.lang.UnsupportedOperationException
public void clear()
throws java.lang.UnsupportedOperationException
clear in interface java.util.Mapjava.lang.UnsupportedOperationException
public boolean containsValue(java.lang.Object value)
throws java.lang.UnsupportedOperationException
containsValue in interface java.util.Mapvalue - Object
java.lang.UnsupportedOperationException
public java.util.Set entrySet()
throws java.lang.UnsupportedOperationException
entrySet in interface java.util.Mapjava.lang.UnsupportedOperationException
public boolean equals(java.lang.Object o)
throws java.lang.UnsupportedOperationException
equals in interface java.util.Mapequals in class java.lang.Objecto - Object
java.lang.UnsupportedOperationException
public boolean isEmpty()
throws java.lang.UnsupportedOperationException
isEmpty in interface java.util.Mapjava.lang.UnsupportedOperationException
public java.util.Set keySet()
throws java.lang.UnsupportedOperationException
keySet in interface java.util.Mapjava.lang.UnsupportedOperationException
public void putAll(java.util.Map t)
throws java.lang.UnsupportedOperationException
putAll in interface java.util.Mapt - Map
java.lang.UnsupportedOperationException
public int size()
throws java.lang.UnsupportedOperationException
size in interface java.util.Mapjava.lang.UnsupportedOperationException
public java.util.Collection values()
throws java.lang.UnsupportedOperationException
values in interface java.util.Mapjava.lang.UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||