|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.BaseWebClient<IndexWebService> com.languagecomputer.api.IndexServiceWebClient
public class IndexServiceWebClient
Web service client wrapper for the IndexService
. Handles all the
web service interaction code. Combined with the IndexService
class, this provides a java-to-java interaction that masks the web service
functionality.
Constructor Summary | |
---|---|
IndexServiceWebClient(ServiceConfig serviceConfig)
Creates a new IndexServiceWebClient with the given
ServiceConfig . |
Method Summary | |
---|---|
void |
finish()
Indicates that the indexing process is finished or has reached some checkpoint stage. |
Document |
get(String docID)
Loads the Document with the given docID from the index. |
String |
getName()
Returns the name of the service to use for URL lookup. |
protected Class<IndexWebService> |
getWebServiceClass()
Returns the BaseWebService class this BaseWebClient
wraps. |
void |
index(Document document)
Indexes the given Document . |
void |
remove(String docID)
Removes the Document with the given docID from the index. |
void |
setPath(String path)
Sets the location of the index. |
Methods inherited from class com.languagecomputer.api.BaseWebClient |
---|
disconnect, getSessionID, getWebService, registerSession, sessionRegistered, setSession, setSessionID, 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.Service |
---|
setSession |
Constructor Detail |
---|
public IndexServiceWebClient(ServiceConfig serviceConfig)
IndexServiceWebClient
with the given
ServiceConfig
.
Method Detail |
---|
public String getName()
getName
in interface Service
getName
in class BaseWebClient<IndexWebService>
protected Class<IndexWebService> getWebServiceClass()
BaseWebService
class this BaseWebClient
wraps.
getWebServiceClass
in class BaseWebClient<IndexWebService>
public void setPath(String path) throws IOException
IndexService.index(Document)
. Calls to
IndexService.remove(String)
and IndexService.get(String)
, however, should throw an
IOException
. This is an optional operation.
setPath
in interface IndexService
path
- The path to the index.
IOException
- If there is an issue accessing any I/O component
required by the IndexService
. Implementors may or may not
validate the path and throw an exception if it is inaccessible.public void index(Document document) throws IOException
Document
. This should now be retrievable using
#getDocument(String)
. If no index currently exists at the location
given to IndexService.setPath(String)
, a new index should be created.
index
in interface IndexService
document
- The Document
to index.
IOException
- If there is an issue accessing any I/O component
required by the IndexService
.public void finish() throws IOException
finish
is called is left up to the
implementation.
finish
in interface IndexService
IOException
- If there is an issue accessing any I/O component
required by the IndexService
.public Document get(String docID) throws IOException
Document
with the given docID from the index.
get
in interface IndexService
docID
- Unique identifier for the Document
.
Document
with the given docID, or
null
if there is no such document in the index or if this
operation is not supported.
IOException
- If there is an issue accessing any I/O component
required by the IndexService
.public void remove(String docID) throws IOException
Document
with the given docID from the index.
remove
in interface IndexService
IOException
- If there is an issue accessing any I/O component
required by the IndexService
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |