com.senseidb.svc.impl
Class HttpRestSenseiServiceImpl

java.lang.Object
  extended by com.senseidb.svc.impl.HttpRestSenseiServiceImpl
All Implemented Interfaces:
SenseiService

public class HttpRestSenseiServiceImpl
extends Object
implements SenseiService


Constructor Summary
HttpRestSenseiServiceImpl(String urlString)
           
HttpRestSenseiServiceImpl(String scheme, String host, int port, String path)
           
HttpRestSenseiServiceImpl(String scheme, String host, int port, String path, int defaultKeepAliveDurationMS, int maxRetries)
           
HttpRestSenseiServiceImpl(String scheme, String host, int port, String path, int defaultKeepAliveDurationMS, int maxRetries, org.apache.http.client.HttpRequestRetryHandler retryHandler)
           
 
Method Summary
 URI buildRequestURI(List<org.apache.http.NameValuePair> qparams)
           
static SenseiResult buildSenseiResult(org.json.JSONObject jsonObj)
           
static SenseiSystemInfo buildSysInfo(org.json.JSONObject jsonObj)
           
 URI buildSysInfoRequestURI()
           
static void convertFacetInitParams(List<org.apache.http.NameValuePair> qparams, Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> initParams)
           
static String convertFacetSortSpec(com.browseengine.bobo.api.FacetSpec.FacetSortSpec spec)
           
static void convertFacetSpecs(List<org.apache.http.NameValuePair> qparams, Map<String,com.browseengine.bobo.api.FacetSpec> facetSpecs)
           
static void convertPartitionParams(List<org.apache.http.NameValuePair> qparams, Set<Integer> partitions)
           
static List<org.apache.http.NameValuePair> convertRequestToQueryParams(SenseiRequest req)
           
static void convertScalarParams(List<org.apache.http.NameValuePair> qparams, SenseiRequest req)
           
static void convertSelectionNames(List<org.apache.http.NameValuePair> qparams, SenseiRequest req)
           
static void convertSenseiQuery(List<org.apache.http.NameValuePair> qparams, SenseiQuery query)
           
static String convertSortField(org.apache.lucene.search.SortField field)
           
static void convertSortFieldParams(List<org.apache.http.NameValuePair> qparams, org.apache.lucene.search.SortField[] sortFields)
           
static org.apache.lucene.document.Document convertStoredFields(org.json.JSONArray jsonArray)
           
static org.json.JSONObject convertStreamToJSONObject(InputStream is)
           
static String convertStreamToString(InputStream is)
           
static org.apache.lucene.search.Explanation convertToExplanation(org.json.JSONObject jsonObj)
           
 SenseiResult doQuery(SenseiRequest req)
           
 SenseiSystemInfo getSystemInfo()
           
static String join(Collection<?> s, String delimiter)
           
static String join(String[] arr, String delimiter)
           
 InputStream makeRequest(URI uri)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRestSenseiServiceImpl

public HttpRestSenseiServiceImpl(String scheme,
                                 String host,
                                 int port,
                                 String path)

HttpRestSenseiServiceImpl

public HttpRestSenseiServiceImpl(String scheme,
                                 String host,
                                 int port,
                                 String path,
                                 int defaultKeepAliveDurationMS,
                                 int maxRetries)

HttpRestSenseiServiceImpl

public HttpRestSenseiServiceImpl(String scheme,
                                 String host,
                                 int port,
                                 String path,
                                 int defaultKeepAliveDurationMS,
                                 int maxRetries,
                                 org.apache.http.client.HttpRequestRetryHandler retryHandler)

HttpRestSenseiServiceImpl

public HttpRestSenseiServiceImpl(String urlString)
                          throws MalformedURLException
Throws:
MalformedURLException
Method Detail

doQuery

public SenseiResult doQuery(SenseiRequest req)
                     throws SenseiException
Specified by:
doQuery in interface SenseiService
Throws:
SenseiException

getSystemInfo

public SenseiSystemInfo getSystemInfo()
                               throws SenseiException
Specified by:
getSystemInfo in interface SenseiService
Throws:
SenseiException

convertRequestToQueryParams

public static List<org.apache.http.NameValuePair> convertRequestToQueryParams(SenseiRequest req)
                                                                       throws SenseiException,
                                                                              UnsupportedEncodingException
Throws:
SenseiException
UnsupportedEncodingException

convertSortFieldParams

public static void convertSortFieldParams(List<org.apache.http.NameValuePair> qparams,
                                          org.apache.lucene.search.SortField[] sortFields)

convertPartitionParams

public static void convertPartitionParams(List<org.apache.http.NameValuePair> qparams,
                                          Set<Integer> partitions)

convertScalarParams

public static void convertScalarParams(List<org.apache.http.NameValuePair> qparams,
                                       SenseiRequest req)

convertFacetInitParams

public static void convertFacetInitParams(List<org.apache.http.NameValuePair> qparams,
                                          Map<String,com.browseengine.bobo.facets.FacetHandlerInitializerParam> initParams)
                                   throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

convertFacetSpecs

public static void convertFacetSpecs(List<org.apache.http.NameValuePair> qparams,
                                     Map<String,com.browseengine.bobo.api.FacetSpec> facetSpecs)

convertFacetSortSpec

public static String convertFacetSortSpec(com.browseengine.bobo.api.FacetSpec.FacetSortSpec spec)

convertSortField

public static String convertSortField(org.apache.lucene.search.SortField field)

convertSelectionNames

public static void convertSelectionNames(List<org.apache.http.NameValuePair> qparams,
                                         SenseiRequest req)

convertSenseiQuery

public static void convertSenseiQuery(List<org.apache.http.NameValuePair> qparams,
                                      SenseiQuery query)
                               throws SenseiException
Throws:
SenseiException

buildSysInfoRequestURI

public URI buildSysInfoRequestURI()
                           throws URISyntaxException
Throws:
URISyntaxException

buildRequestURI

public URI buildRequestURI(List<org.apache.http.NameValuePair> qparams)
                    throws URISyntaxException
Throws:
URISyntaxException

makeRequest

public InputStream makeRequest(URI uri)
                        throws IOException
Throws:
IOException

join

public static String join(String[] arr,
                          String delimiter)

join

public static String join(Collection<?> s,
                          String delimiter)

convertStreamToString

public static String convertStreamToString(InputStream is)
                                    throws IOException
Throws:
IOException

convertStreamToJSONObject

public static org.json.JSONObject convertStreamToJSONObject(InputStream is)
                                                     throws IOException,
                                                            org.json.JSONException
Throws:
IOException
org.json.JSONException

buildSenseiResult

public static SenseiResult buildSenseiResult(org.json.JSONObject jsonObj)
                                      throws org.json.JSONException
Throws:
org.json.JSONException

buildSysInfo

public static SenseiSystemInfo buildSysInfo(org.json.JSONObject jsonObj)
                                     throws org.json.JSONException
Throws:
org.json.JSONException

convertStoredFields

public static org.apache.lucene.document.Document convertStoredFields(org.json.JSONArray jsonArray)
                                                               throws org.json.JSONException
Throws:
org.json.JSONException

convertToExplanation

public static org.apache.lucene.search.Explanation convertToExplanation(org.json.JSONObject jsonObj)
                                                                 throws org.json.JSONException
Throws:
org.json.JSONException

shutdown

public void shutdown()
Specified by:
shutdown in interface SenseiService


Copyright © 2010-2012. All Rights Reserved.