com.languagecomputer.api
Class IndexWebServiceImpl

java.lang.Object
  extended by com.languagecomputer.api.BaseWebServiceImpl
      extended by com.languagecomputer.api.IndexWebServiceImpl
All Implemented Interfaces:
BaseWebService, IndexWebService

public class IndexWebServiceImpl
extends BaseWebServiceImpl
implements IndexWebService

Implementation of IndexWebService.

Since:
1.0
Author:
Kirk Roberts

Field Summary
 
Fields inherited from class com.languagecomputer.api.BaseWebServiceImpl
sessionManager
 
Constructor Summary
IndexWebServiceImpl(SessionManager sessionManager)
          Creates a new IndexWebServiceImpl using the given sessionManager.
 
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 class com.languagecomputer.api.BaseWebServiceImpl
registerSession, unregisterSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.languagecomputer.api.BaseWebService
registerSession, unregisterSession
 

Constructor Detail

IndexWebServiceImpl

public IndexWebServiceImpl(SessionManager sessionManager)
Creates a new IndexWebServiceImpl using the given sessionManager.

Parameters:
sessionManager - The SessionManager to use for Session control.
Method Detail

setPath

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

Specified by:
setPath in interface IndexWebService
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

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

Specified by:
index in interface IndexWebService
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

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

Specified by:
finish in interface IndexWebService
Parameters:
sessionID - The unique identifier String for the session for this operation.
Throws:
Exception - If there was an error finishing the indexing.

get

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

Specified by:
get in interface IndexWebService
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

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

Specified by:
remove in interface IndexWebService
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.