viceroy
Interface LookupPeer

All Known Subinterfaces:
AuthorizedLookupPeer, AuthorizedViceroyPeer, ViceroyPeer
All Known Implementing Classes:
LocalViceroyPeer, RemoteViceroyPeer

public interface LookupPeer

Represents a peer in some Lookup network. The network's topology can be of any type. Has only 3 methods: lookup (2 methods), getAdderss.

Since:
1.1
Author:
Anat Talmy
, Oren Dobzinski

Method Summary
 Address getAddress()
          Returns a real-world address for sending messages
 void lookup(Resource valueToLook, LookupAlgorithm method)
          Performs a lookup operation on this peer
 void lookup(Resource valueToLook, LookupPeer returnAddress, LookupAlgorithm method)
          Performs a lookup operation on this peer
 

Method Detail

lookup

public void lookup(Resource valueToLook,
                   LookupPeer returnAddress,
                   LookupAlgorithm method)
Performs a lookup operation on this peer

Parameters:
valueToLook - the value to lookup
returnAddress - the peer who initiated this search
method - the lookup algorithm to use
Throws:
java.lang.IllegalStateException - if the peer is not in a legal state for looking up.
See Also:
LookupState

lookup

public void lookup(Resource valueToLook,
                   LookupAlgorithm method)
            throws ResourceNotFoundException
Performs a lookup operation on this peer

Parameters:
valueToLook - the value to lookup
method - the lookup algorithm to use
Throws:
java.lang.IllegalStateException - if the peer is not in a legal state for looking up.
ResourceNotFoundException

getAddress

public Address getAddress()
Returns a real-world address for sending messages

Returns:
a real-world address for sending messages