no.sesat.search.mode.command
Class AbstractXmlRestful

java.lang.Object
  extended by no.sesat.search.mode.command.AbstractXmlRestful
All Implemented Interfaces:
Restful, XmlRestful

public abstract class AbstractXmlRestful
extends Object
implements XmlRestful

Base implementation for search commands that are RESTful and have XML responses. The RESTful server is defined through: host: AbstractXmlSearchConfiguration.getHost() port: AbstractXmlSearchConfiguration.getPort()

Version:
$Id: AbstractXmlRestful.java 7225 2009-04-09 00:32:20Z ssmiweve $

Constructor Summary
AbstractXmlRestful(SearchCommand.Context cxt)
          Create new xml based command.
 
Method Summary
 SearchCommand.Context getContext()
           
 BufferedReader getHttpReader(String encoding)
          Obtain a BufferedReader, in the given encoding, of the RESTful result.
 Document getXmlResult()
          Obtain the loaded Document, of the RESTful result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface no.sesat.search.mode.command.Restful
createRequestURL
 

Constructor Detail

AbstractXmlRestful

public AbstractXmlRestful(SearchCommand.Context cxt)
Create new xml based command.

Parameters:
cxt - The context to execute in.
Method Detail

getXmlResult

public final Document getXmlResult()
                            throws IOException,
                                   SAXException
Description copied from interface: XmlRestful
Obtain the loaded Document, of the RESTful result. Makes the presumption that the RESTful service returns an well formed xml response.

Specified by:
getXmlResult in interface XmlRestful
Returns:
the w3c dom Document
Throws:
IOException - failure to read the response (or sent the request)
SAXException - failure to parse/load the xml into a dom

getHttpReader

public final BufferedReader getHttpReader(String encoding)
                                   throws IOException
Description copied from interface: Restful
Obtain a BufferedReader, in the given encoding, of the RESTful result. Makes the presumption that the RESTful service returns an ascii and not binary response.

Specified by:
getHttpReader in interface Restful
Returns:
Throws:
IOException

getContext

public SearchCommand.Context getContext()


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.