org.apache.solr.rest.schema
Class FieldTypeResource

java.lang.Object
  extended by org.restlet.resource.Resource
      extended by org.restlet.resource.UniformResource
          extended by org.restlet.resource.ServerResource
              extended by org.apache.solr.rest.schema.FieldTypeResource
All Implemented Interfaces:
GETable

public class FieldTypeResource
extends org.restlet.resource.ServerResource
implements GETable

This class responds to requests at /solr/(corename)/schema/fieldtype/(typename) where "typename" is the name of a field type in the schema. The GET method returns properties for the named field type.


Field Summary
protected static String SHOW_DEFAULTS
           
 
Constructor Summary
FieldTypeResource()
           
 
Method Summary
 void doInit()
          Pulls the SolrQueryRequest constructed in SolrDispatchFilter from the SolrRequestInfo thread local, then gets the SolrCore and IndexSchema and sets up the response.
 org.restlet.representation.Representation get()
           
protected  String getContentType()
           
protected  List<String> getDynamicFieldsWithFieldType(FieldType fieldType)
          Returns a dynamic field list using the given field type by iterating over all dynamic fields defined in the schema.
protected  List<String> getFieldsWithFieldType(FieldType fieldType)
          Returns a field list using the given field type by iterating over all fields defined in the schema.
protected  SimpleOrderedMap<Object> getFieldTypeProperties(FieldType fieldType)
          Used by subclasses to collect field type properties
protected  IndexSchema getSchema()
           
protected  SolrCore getSolrCore()
           
protected  SolrQueryRequest getSolrRequest()
           
protected  SolrQueryResponse getSolrResponse()
           
protected  void handleException(org.slf4j.Logger log)
          If there is an exception on the SolrResponse: error info is added to the SolrResponse; the response status code is set to the error code from the exception; and the exception message is added to the list of things to be logged.
protected  void handlePostExecution(org.slf4j.Logger log)
          Deal with an exception on the SolrResponse, fill in response header info, and log the accumulated messages on the SolrResponse.
protected static String urlDecode(String str)
          Decode URL-encoded strings as UTF-8, and avoid converting "+" to space
 
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
 
Methods inherited from class org.restlet.resource.Resource
doError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toObject, toRepresentation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHOW_DEFAULTS

protected static final String SHOW_DEFAULTS
See Also:
Constant Field Values
Constructor Detail

FieldTypeResource

public FieldTypeResource()
Method Detail

doInit

public void doInit()
            throws org.restlet.resource.ResourceException
Pulls the SolrQueryRequest constructed in SolrDispatchFilter from the SolrRequestInfo thread local, then gets the SolrCore and IndexSchema and sets up the response. writer.

If an error occurs during initialization, setExisting(false) is called and an error status code and message is set; in this case, Restlet will not continue servicing the request (by calling the method annotated to associate it with GET, etc., but rather will send an error response.

Throws:
org.restlet.resource.ResourceException

get

public org.restlet.representation.Representation get()
Specified by:
get in interface GETable
Overrides:
get in class org.restlet.resource.ServerResource

getFieldsWithFieldType

protected List<String> getFieldsWithFieldType(FieldType fieldType)
Returns a field list using the given field type by iterating over all fields defined in the schema.


getDynamicFieldsWithFieldType

protected List<String> getDynamicFieldsWithFieldType(FieldType fieldType)
Returns a dynamic field list using the given field type by iterating over all dynamic fields defined in the schema.


getFieldTypeProperties

protected SimpleOrderedMap<Object> getFieldTypeProperties(FieldType fieldType)
Used by subclasses to collect field type properties


getSolrCore

protected SolrCore getSolrCore()

getSchema

protected IndexSchema getSchema()

getSolrRequest

protected SolrQueryRequest getSolrRequest()

getSolrResponse

protected SolrQueryResponse getSolrResponse()

getContentType

protected String getContentType()

handlePostExecution

protected void handlePostExecution(org.slf4j.Logger log)
Deal with an exception on the SolrResponse, fill in response header info, and log the accumulated messages on the SolrResponse.


handleException

protected void handleException(org.slf4j.Logger log)
If there is an exception on the SolrResponse:


urlDecode

protected static String urlDecode(String str)
                           throws UnsupportedEncodingException
Decode URL-encoded strings as UTF-8, and avoid converting "+" to space

Throws:
UnsupportedEncodingException


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.