Esri Geoportal Server
1.0

com.esri.gpt.catalog.lucene.stats
Class StatsRequest

java.lang.Object
  extended by com.esri.gpt.catalog.lucene.stats.StatsRequest

public class StatsRequest
extends Object

Request to obtain Lucene index statistics.


Constructor Summary
StatsRequest(RequestContext requestContext)
          Constructs with an associated request context.
 
Method Summary
 String getBaseQueryUrl()
          Gets the base URL used to construct a REST query.
 String getBaseStatsUrl()
          Gets the base URL used to construct a stats request.
 String[] getCollectableFieldNames(IndexReader reader)
          Gets the field names for which statistics can be collected.
 OpenBitSet getDocumentFilterBitSet()
          Gets the filter bitset representing the set of documents for which statistics will be collected.
 RequestContext getRequestContext()
          Gets the underlying request context.
 String getResponseFormat()
          Gets the response format (html|json)
 PrintWriter getResponseWriter()
          Gets the writer to be used wjen generating the response.
 String getSortBy()
          Gets the sort by parameter.
 Storeable getStoreable(String fieldName)
          Gets the storable associated with a field name.
 boolean isFieldCollectable(String fieldName)
          Determines if statistics can be collected for a field.
 void prepare(IndexReader reader)
          Prepares the request prior to statistics collection.
 void setResponseFormat(String format)
          Sets the response format (html|json)
 void setResponseWriter(PrintWriter writer)
          Sets the writer to be used wjen generating the response.
 void setSortBy(String sortBy)
          Sets the sort by parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatsRequest

public StatsRequest(RequestContext requestContext)
Constructs with an associated request context.

Parameters:
requestContext - the active request context
Method Detail

getBaseQueryUrl

public String getBaseQueryUrl()
Gets the base URL used to construct a REST query.
e.g. /geoportal/rest/find/document

Returns:
the base query url

getBaseStatsUrl

public String getBaseStatsUrl()
Gets the base URL used to construct a stats request.
e.g. /geoportal/rest/index/stats

Returns:
the base stats url

getDocumentFilterBitSet

public OpenBitSet getDocumentFilterBitSet()
Gets the filter bitset representing the set of documents for which statistics will be collected.

Returns:
the document filter bitset (can be null)

getRequestContext

public RequestContext getRequestContext()
Gets the underlying request context.

Returns:
the request context

getResponseFormat

public String getResponseFormat()
Gets the response format (html|json)

Returns:
the response format

setResponseFormat

public void setResponseFormat(String format)
Sets the response format (html|json)

Parameters:
format - the response format

getResponseWriter

public PrintWriter getResponseWriter()
Gets the writer to be used wjen generating the response.

Returns:
the response writer

setResponseWriter

public void setResponseWriter(PrintWriter writer)
Sets the writer to be used wjen generating the response.

Parameters:
writer - the response writer

getSortBy

public String getSortBy()
Gets the sort by parameter.

Returns:
the sort by parameter

setSortBy

public void setSortBy(String sortBy)
Sets the sort by parameter.

Parameters:
sortBy - the sort by parameter

getCollectableFieldNames

public String[] getCollectableFieldNames(IndexReader reader)
Gets the field names for which statistics can be collected.

Parameters:
reader - the Lucene index reader
Returns:
the array of field names

getStoreable

public Storeable getStoreable(String fieldName)
Gets the storable associated with a field name.

Parameters:
fieldName - the subject field name
Returns:
the associated storable (can be null)

isFieldCollectable

public boolean isFieldCollectable(String fieldName)
Determines if statistics can be collected for a field.

Parameters:
fieldName - the field name
Returns:
true if statistics can be collected for the field

prepare

public void prepare(IndexReader reader)
             throws IOException
Prepares the request prior to statistics collection.
A document filter bitset will be created associated with only those documents that are visible to the active user.

Parameters:
reader - the Lucene index reader
Throws:
IOException - if an index i/o exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.