|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Represents a peer in some Lookup network. The network's topology can be of any type. the autorization stands for some additional permissions: join the network and leave it. Authorized peer can initiate these actions, unlike the non-authorized peer - LookupPeer
| Method Summary | |
void |
addResource(Resource newResource)
Adds new Resource to this peer, and to the viceroy network |
boolean |
containsResource(Resource resource)
Checks if this peer actually holds the given resource. |
void |
deleteResource(Resource resource)
Deletes a resource from this peer- if it is present |
boolean |
isResponsibleFor(HashValue value)
True if this peer is responsible for the given value - if the value is in the range of values that this peer is responsible for (predecessor,id] |
void |
join()
Joins this peer to the network |
void |
leave()
Removes this peer from the network |
| Methods inherited from interface viceroy.LookupPeer |
getAddress, lookup, lookup |
| Method Detail |
public void join()
public void leave()
public boolean isResponsibleFor(HashValue value)
value - the value to check
public void addResource(Resource newResource)
throws IllegalResourceInsertionException
newResource - The new resource to be added
IllegalResourceInsertionException - if !this.isResponsibleFor(newResource.hashValue())
public void deleteResource(Resource resource)
throws IllegalResourceInsertionException
resource - The resource to be deleted
IllegalResourceInsertionException - if !this.isResponsibleFor(newResource.hashValue())public boolean containsResource(Resource resource)
resource - the resource to be checked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||