com.languagecomputer.api
Interface IndexWebService

All Superinterfaces:
BaseWebService
All Known Implementing Classes:
IndexWebServiceImpl

public interface IndexWebService
extends BaseWebService

Interface for indexing web service. Indexes single documents into a persistent index, allows for retrieval of specific documents from that index by document ID, and searching on the index. The web service corresponds to a single persistent index. If multiple indexes are used, then multiple web services are required.

Since:
1.0
Author:
Kirk Roberts

Method Summary
 void finish(String sessionID)
          Indicates that the current indexing session is finished and all changes to the the index should be flushed.
 String get(String sessionID, String docID, String format)
          Loads the document with the given docID from the index.
 void index(String sessionID, String document, String format)
          Indexes the provided document.
 void remove(String sessionID, String docID)
          Removes the document with the given docID from the index.
 void setPath(String sessionID, String path)
          Changes the index path.
 
Methods inherited from interface com.languagecomputer.api.BaseWebService
registerSession, unregisterSession
 

Method Detail

setPath

void setPath(String sessionID,
             String path)
             throws Exception
Changes the index path.

Parameters:
sessionID - The unique identifier String for the session for this operation.
path - The new path to the index.
Throws:
Exception - If there was an error changing the index path.

index

void index(String sessionID,
           String document,
           String format)
           throws Exception
Indexes the provided document.

Parameters:
sessionID - The unique identifier String for the session for this operation.
document - The document in the format described in the format parameter.
format - The format in which the given document is in. Defaults to XML.
Throws:
Exception - If there was an error indexing the document.

finish

void finish(String sessionID)
            throws Exception
Indicates that the current indexing session is finished and all changes to the the index should be flushed.

Parameters:
sessionID - The unique identifier String for the session for this operation.
Throws:
Exception - If there was an error finishing the indexing.

get

String get(String sessionID,
           String docID,
           String format)
           throws Exception
Loads the document with the given docID from the index.

Parameters:
sessionID - The unique identifier String for the session for this operation.
docID - The id of the document to load and return.
format - The format in which the annotations should be returned. Defaults to XML.
Returns:
The loaded document in the format requested.
Throws:
Exception - If there was an error retrieving the document.

remove

void remove(String sessionID,
            String docID)
            throws Exception
Removes the document with the given docID from the index.

Parameters:
sessionID - The unique identifier String for the session for this operation.
docID - The id of the document to load and return.
Throws:
Exception - If there was an error removing the document.


Copyright © 2009. All Rights Reserved.