ISSearch
Class ISPeerServer

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byISSearch.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

Field Summary
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
 
Fields inherited from class java.rmi.server.RemoteServer
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface ISSearch.ISPeerServerInterface
port, serviceName
 
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.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.

Method Detail

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.