viceroy
Interface LookupAlgorithm

All Known Implementing Classes:
FindFastAlgorithm, PapersAlgorithm, TraverseTreeAbsoluteAlgorithm, TraverseTreePlusAlgorithm

public interface LookupAlgorithm

Represents a lookup algorithm It is an interface since we wanted to try many lookup algorithms. It has 2 methods: nextOnLookup - gets the next step on the lookup path, according to the lookup algorithm getMessagePath - returns the path of the lookup message

Since:
1.72
Author:
Anat Talmy
, Oren Dobzinski

Method Summary
 MessagePath getMessagePath()
          Returns the path of the lookup message
 LookupAlgorithm newLookupAlgorithm(AuthorizedViceroyPeer peer)
          Creates a fresh new lookup algorithm, with empty path
 ViceroyPeer nextOnLookup(AuthorizedViceroyPeer peer, Resource valueToLook)
          Gets the next step on the lookup path, according to the lookup algorithm
 

Method Detail

nextOnLookup

public ViceroyPeer nextOnLookup(AuthorizedViceroyPeer peer,
                                Resource valueToLook)
                         throws ResourceNotFoundException
Gets the next step on the lookup path, according to the lookup algorithm

Parameters:
peer - the peer which performs the current step in the lookup
valueToLook -
Returns:
the next step on the lookup path, according to the lookup algorithm. A return value can be the given peer, which indicates that the lookup is over. Null is not a legal return value;
ResourceNotFoundException

getMessagePath

public MessagePath getMessagePath()
Returns the path of the lookup message

Returns:
returns the path of the lookup message

newLookupAlgorithm

public LookupAlgorithm newLookupAlgorithm(AuthorizedViceroyPeer peer)
Creates a fresh new lookup algorithm, with empty path

Parameters:
peer - starting point of the new algorithm
Returns:
a fresh new lookup algorithm, with empty path