com.googlecode.solrgeonames.server
Class JsonDetailResponse

java.lang.Object
  extended by com.googlecode.solrgeonames.server.JsonDetailResponse
All Implemented Interfaces:
OpenSearchResponse

public class JsonDetailResponse
extends Object
implements OpenSearchResponse

A Response wrapper to rendering output for the 'detail' function.

Author:
Greg Pendlebury

Constructor Summary
JsonDetailResponse()
           
 
Method Summary
 String contentType()
          Get the content type to return to users for this response
 void init(javax.servlet.http.HttpServletRequest request)
          An initialisation function giving access to the HTTP input.
 String renderEmptyResponse()
          Render a response indicated no results were returned
 String renderError(String message)
          Render an error message response
 String renderResponse(org.apache.solr.client.solrj.response.QueryResponse results)
          Render a valid response to a search result list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonDetailResponse

public JsonDetailResponse()
Method Detail

init

public void init(javax.servlet.http.HttpServletRequest request)
An initialisation function giving access to the HTTP input.

Specified by:
init in interface OpenSearchResponse
Parameters:
request: - The incoming HTTP request

renderResponse

public String renderResponse(org.apache.solr.client.solrj.response.QueryResponse results)
Render a valid response to a search result list.

Specified by:
renderResponse in interface OpenSearchResponse
Parameters:
results: - The results list to render
Returns:
String: The rendered output

renderEmptyResponse

public String renderEmptyResponse()
Render a response indicated no results were returned

Specified by:
renderEmptyResponse in interface OpenSearchResponse
Returns:
String: The rendered output

renderError

public String renderError(String message)
Render an error message response

Specified by:
renderError in interface OpenSearchResponse
Parameters:
String: - The message to include in the response
Returns:
String: The rendered output

contentType

public String contentType()
Get the content type to return to users for this response

Specified by:
contentType in interface OpenSearchResponse
Returns:
String: The MIME type to use


Copyright © 2011. All Rights Reserved.