|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AsynChord
Interface to Chord distributed hash table for asynchronous method invocations.
The methods
insert(Key, Serializable, ChordCallback)remove(Key, Serializable, ChordCallback)retrieve(Key, ChordCallback)callback object.
The methods
perform the requested operation (insert, remove, or retrieve) and the result can be obtained or the completion of the method can be detected with help of the returned instance ofChordFuture.
| Method Summary | |
|---|---|
void |
create()
Creates a new chord network which is not connected to any other node. |
void |
create(URL localURL)
Creates a new chord network which is not connected to any other node. |
void |
create(URL localURL,
ID localID)
Creates a new chord network which is not connected to any other node. |
ID |
getID()
Returns the ID of the local node; is null if no network has been
created or joined. |
URL |
getURL()
Returns the URL of the local node; is null if no network has been
created or joined. |
void |
insert(Key key,
Serializable entry,
ChordCallback callback)
Asynchronous method to insert entry under the provided
key. |
ChordFuture |
insertAsync(Key key,
Serializable entry)
Asynchronous method to insert entry with key. |
void |
join(URL bootstrapURL)
Joins an existing chord network and announces its presence to the other nodes. |
void |
join(URL localURL,
ID localID,
URL bootstrapURL)
Joins an existing chord network and announces its presence to the other nodes. |
void |
join(URL localURL,
URL bootstrapURL)
Joins an existing chord network and announces its presence to the other nodes. |
void |
leave()
Disconnects from the network. |
void |
remove(Key key,
Serializable entry,
ChordCallback callback)
Asynchronous method to remove entry under the provided
key. |
ChordFuture |
removeAsync(Key key,
Serializable entry)
Asynchronous method to remove entry with key. |
void |
retrieve(Key key,
ChordCallback callback)
Asynchronous method to retrieve the entries associated with key. |
ChordRetrievalFuture |
retrieveAsync(Key key)
Asynchronous method to retrieve the entries associated with key. |
void |
setID(ID nodeID)
Sets the ID of the local node to the given value; only available
before creating or joining a network. |
void |
setURL(URL nodeURL)
Sets the URL of the local node to the given value; only available
before creating or joining a network. |
| Method Detail |
|---|
URL getURL()
URL of the local node; is null if no network has been
created or joined.
URL of local node.
void setURL(URL nodeURL)
throws IllegalStateException
URL of the local node to the given value; only available
before creating or joining a network.
nodeURL - New URL of local node.
NullPointerException - If given URL reference has value null.
IllegalStateException - If network has already been created or joined.ID getID()
ID of the local node; is null if no network has been
created or joined.
ID of local node.
void setID(ID nodeID)
throws IllegalStateException
ID of the local node to the given value; only available
before creating or joining a network.
nodeID - New ID of local node.
NullPointerException - If given ID reference has value null.
IllegalStateException - If network has already been created or joined.
void create()
throws ServiceException
setURL(de.uniba.wiai.lspi.chord.data.URL).
If no ID has been set before, it is generated by applying a hash function
on the node URL.
ServiceException - Is thrown if creating the local chord node fails, e.g. due to
unability of creating the endpoint for incoming messages. Is
also thrown if no URL has been set before.
void create(URL localURL)
throws ServiceException
URL.
localURL - URL on which this node accepts incoming requests from
other chord nodes. The ID of this node is generated by
applying a hash function on the node URL.
NullPointerException - If localURL is null.
ServiceException - Is thrown if creating the local chord node fails, e.g. due to
unability of creating the endpoint for incoming messages.
void create(URL localURL,
ID localID)
throws ServiceException
localURL - URL on which this node accepts incoming requests from
other chord nodes.localID - ID of this node.
NullPointerException - If localURL or localID is
null.
ServiceException - Is thrown if creating the local chord node fails, e.g. due to
unability of creating the endpoint for incoming messages.
void join(URL bootstrapURL)
throws ServiceException
URL has been set before by
setURL(de.uniba.wiai.lspi.chord.data.URL). If no ID has been set before, it is generated
by applying a hash function on the node URL.
bootstrapURL - URL of one existing node which is used as bootstrap
node.
NullPointerException - If bootstrapURL is null.
ServiceException - If joining fails this exception is thrown. This may be due to
failure of establishing an endpoint or communication problems
when contacting the bootstrap node. Is also thrown if no URL
has been set before.
void join(URL localURL,
URL bootstrapURL)
throws ServiceException
ID is generated by applying a hash function on
the node URL.
localURL - The local node is made available under this URL.bootstrapURL - URL of one existing node which is used as bootstrap
node.
NullPointerException - If localURL or bootstrapURL is
null.
ServiceException - If joining fails this exception is thrown. This may be due to
failure of establishing an endpoint or communication problems
when contacting the bootstrap node.
void join(URL localURL,
ID localID,
URL bootstrapURL)
throws ServiceException
localURL - The local node is made available under this URL.localID - ID of this node.bootstrapURL - URL of one existing node which is used as bootstrap
node.
NullPointerException - If localURL, localID, or
bootstrapURL is null.
ServiceException - If joining fails this exception is thrown. This may be due to
failure of establishing an endpoint or communication problems
when contacting the bootstrap node.
void leave()
throws ServiceException
ServiceException - If properly leaving the network fails this exception is
thrown. The network might have been left as if the local node
has failed. However, disconnecting from the network is done
in every case.
void retrieve(Key key,
ChordCallback callback)
key. Implementations of this method must return
immediately and the result of the retrieval must be passed to the
provided callback instance.
key - The key for which the associated entries should be retrieved.callback - The ChordCallback to which to pass the retrieval
result.
void insert(Key key,
Serializable entry,
ChordCallback callback)
entry under the provided
key. Implementations of this method must return
immediately and the completion of the insertion must be reported to the
provided callback instance.
key - The Key to associate with entryentry - The entry to insert.callback - The ChordCallback to which to pass the retrieval
result.
void remove(Key key,
Serializable entry,
ChordCallback callback)
entry under the provided
key. Implementations of this method must return
immediately and the completion of the removal must be reported to the
provided callback instance.
key - The Key associated with entryentry - The entry to insert.callback - The ChordCallback to which to pass the retrieval
result.ChordRetrievalFuture retrieveAsync(Key key)
key. Implementations of this method must return
immediately and return an implementation of ChordRetrievalFuture,
which can be used later on to retrieve the retrieved results.
key - The Key for that the associated entries should be
retrieved.
ChordRetrievalFuture that represents the result of the
retrieve method.
ChordFuture insertAsync(Key key,
Serializable entry)
entry with key.
Implementations of this method must return immediately and return an
implementation of ChordFuture, which can be used later on to
determine completion of the insertion.
key - The Key with which entry will be
associated.entry - The entry to insert.
ChordFuture, which can be used later on to determine
completion of the insertion.
ChordFuture removeAsync(Key key,
Serializable entry)
entry with key.
Implementations of this method must return immediately and return an
implementation of ChordFuture, which can be used later on to
determine completion of the removal.
key - The Key with which entry is associated.entry - The entry to remove.
ChordFuture, which can be used later on to determine
completion of the removal.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||