com.languagecomputer.api
Class DocumentWebServiceImpl

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

public class DocumentWebServiceImpl
extends BaseWebServiceImpl
implements DocumentWebService

Implementation of DocumentWebService.

Since:
1.0
Author:
Toby Jungen

Field Summary
 
Fields inherited from class com.languagecomputer.api.BaseWebServiceImpl
sessionManager
 
Constructor Summary
DocumentWebServiceImpl(SessionManager sessionManager)
          Creates a new DocumentWebServiceImpl using the given sessionManager.
 
Method Summary
 String process(String sessionID, String url, String type, String format)
          Processes a document at a specific URL by downloading it and ingesting it.
 String processContent(String sessionID, byte[] content, String type, String format)
          Processes a document with the given content.
 
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

DocumentWebServiceImpl

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

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

process

public String process(String sessionID,
                      String url,
                      String type,
                      String format)
               throws Exception
Processes a document at a specific URL by downloading it and ingesting it. Strips extraneous markup and normalizes the text.

Specified by:
process in interface DocumentWebService
Parameters:
sessionID - The unique identifier String for the session for this operation.
url - The URL of the document to be processed.
type - The type of document specified in the url. Defaults to AUTO
format - The format in which the document should be returned. Defaults to XML.
Returns:
The processed document in the format requested.
Throws:
Exception - If there was an error processing the document.

processContent

public String processContent(String sessionID,
                             byte[] content,
                             String type,
                             String format)
                      throws Exception
Processes a document with the given content. Strips extraneous markup and normalizes the text.

Specified by:
processContent in interface DocumentWebService
Parameters:
sessionID - The unique identifier String for the session for this operation.
content - The document content to process.
type - The type of document specified in the url. Defaults to AUTO
format - The format in which the document should be returned. Defaults to XML.
Returns:
The processed document in the format requested.
Throws:
Exception - If there was an error processing the document.


Copyright © 2009. All Rights Reserved.