ISSearch
Class ISPeerServer
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
ISSearch.ISPeerServer
- All Implemented Interfaces:
- ISPeerServerInterface, Remote, Serializable
- public class ISPeerServer
- extends UnicastRemoteObject
- implements ISPeerServerInterface
Sample Server Class for the distributed ISSearch search engine.
This Server returns one and the same match (www.yahoo.de) for any given query.
- See Also:
- Serialized Form
Constructor Summary |
ISPeerServer()
The constructor of the ISPeerServer class. |
Method Summary |
static void |
main(String[] argv)
Starts the RMI Server program for the IS search engine. |
ISPeerResultInterface[] |
search(String query,
int numResults)
Sample search function for the RMI server of the ISSearch search engine. |
ISPeerServer
public ISPeerServer()
throws RemoteException
- The constructor of the ISPeerServer class. According to the RMI requirements,
the default constructor
is required to catch the
RemoteException
. To this end,
it must be present
in the class even if the construction of a new instance requires no special action.
search
public ISPeerResultInterface[] search(String query,
int numResults)
throws RemoteException
- Sample search function for the RMI server of the ISSearch search engine.
- Specified by:
search
in interface ISPeerServerInterface
- Parameters:
query
- The query that is submitted by the client. The query syntax is prescribed by Assignment 4 (Query Processor).numResults
- The max number of best matches that can be returned as search results for the query.
- Returns:
- The array of search results that contains up to
numResults
matches, sorted
in DESCENDING ORDER of relevance.
The relevance is defined as the similarity
between the document and the query (we use the scalar product
between two feature vectors that represent the query and the document
as the similarity metric).
- Throws:
RemoteException
- if the remote invocation of the search fails.
main
public static void main(String[] argv)
- Starts the RMI Server program for the IS search engine.
- Parameters:
argv
- The command line arguments which are ignored.