Package org.apache.solr.rest
Class RestManager.ManagedEndpoint
- java.lang.Object
-
- org.restlet.resource.Resource
-
- org.restlet.resource.ServerResource
-
- org.apache.solr.rest.BaseSolrResource
-
- org.apache.solr.rest.RestManager.ManagedEndpoint
-
- All Implemented Interfaces:
DELETEable
,GETable
,POSTable
,PUTable
- Enclosing class:
- RestManager
public static class RestManager.ManagedEndpoint extends BaseSolrResource implements GETable, PUTable, POSTable, DELETEable
The Restlet router needs a lightweight extension of ServerResource to delegate a request to. ManagedResource implementations are heavy-weight objects that live for the duration of a SolrCore, so this class acts as the proxy between Restlet and a ManagedResource when doing request processing.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.rest.BaseSolrResource
BaseSolrResource.SolrOutputRepresentation
-
-
Field Summary
Fields Modifier and Type Field Description protected String
childId
protected ManagedResource
managedResource
-
Fields inherited from class org.apache.solr.rest.BaseSolrResource
SHOW_DEFAULTS, UPDATE_TIMEOUT_SECS
-
-
Constructor Summary
Constructors Constructor Description ManagedEndpoint()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDeprecatedWarning()
org.restlet.representation.Representation
delete()
void
doInit()
Initialize objects needed to handle a request to the REST API.org.restlet.representation.Representation
get()
protected Object
parseJsonFromRequestBody(org.restlet.representation.Representation entity)
Parses and validates the JSON passed from the to the ManagedResource.org.restlet.representation.Representation
post(org.restlet.representation.Representation entity)
org.restlet.representation.Representation
put(org.restlet.representation.Representation entity)
static String
resolveResourceId(org.restlet.Request restletReq)
Determines the ManagedResource resourceId from the Restlet request.-
Methods inherited from class org.apache.solr.rest.BaseSolrResource
getContentType, getSchema, getSolrCore, getSolrRequest, getSolrResponse, getUpdateTimeoutSecs, handleException, handlePostExecution, urlDecode
-
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, 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, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
-
-
-
-
Field Detail
-
managedResource
protected ManagedResource managedResource
-
childId
protected String childId
-
-
Method Detail
-
resolveResourceId
public static String resolveResourceId(org.restlet.Request restletReq)
Determines the ManagedResource resourceId from the Restlet request.
-
doInit
public void doInit() throws org.restlet.resource.ResourceException
Initialize objects needed to handle a request to the REST API. Specifically, we lookup the RestManager using the ThreadLocal SolrRequestInfo and then dynamically locate the ManagedResource associated with the request URI.- Overrides:
doInit
in classBaseSolrResource
- Throws:
org.restlet.resource.ResourceException
-
put
public org.restlet.representation.Representation put(org.restlet.representation.Representation entity)
-
post
public org.restlet.representation.Representation post(org.restlet.representation.Representation entity)
-
delete
public org.restlet.representation.Representation delete()
- Specified by:
delete
in interfaceDELETEable
- Overrides:
delete
in classorg.restlet.resource.ServerResource
-
get
public org.restlet.representation.Representation get()
-
parseJsonFromRequestBody
protected Object parseJsonFromRequestBody(org.restlet.representation.Representation entity)
Parses and validates the JSON passed from the to the ManagedResource.
-
addDeprecatedWarning
protected void addDeprecatedWarning()
- Overrides:
addDeprecatedWarning
in classBaseSolrResource
-
-