at.ac.tuwien.infosys.rnue.interfaces
Interface ISearchResult

All Known Implementing Classes:
SearchResultImpl

public interface ISearchResult

The SearchResultImpl class represents a search result over all known peers. It is set up by the information stored in the SearchResponseImpl objects returned by peers owning the requested * document. The SearchResultImpl is implemented as a Hashtable. The owner is used as key the IFileList file list as value.

Its constructor creates an empty search result. Use putFileList method to add a SearchResponseImpl search responses using the owner (sender of the search response) as the key to the IFileList file lists. The search result can then be retrieved using the owners and getFileList methods.


Method Summary
 IFileList getFileList(java.lang.String owner)
          Returns the IFileList file list matching the search request at a specific peer.
 java.util.Enumeration owners()
          Returns an Enumeration of owners.
 void putFileList(java.lang.String owner, IFileList list)
          Use the putFileList method to add ISearchResponse search responses to the search result.
 

Method Detail

owners

public java.util.Enumeration owners()
Returns an Enumeration of owners. The owner can the be used to request the IFileList file list using the getFileList method.

Returns:
Enumeration of peers having documents in the file base that match the search request

getFileList

public IFileList getFileList(java.lang.String owner)
Returns the IFileList file list matching the search request at a specific peer.

Parameters:
owner - java.lang.String that specifies the peer to retrieve the file list.
Returns:
IFileList list of files matching the search request on the owner peer.

putFileList

public void putFileList(java.lang.String owner,
                        IFileList list)
Use the putFileList method to add ISearchResponse search responses to the search result.

Parameters:
owner - java.lang.String HumanReadableName identifying the peer owning the file list
list - IFileList list of files matching the search request on the owner peer.