Package org.apache.solr.handler.admin
Class SecurityConfHandler
- java.lang.Object
-
- org.apache.solr.handler.RequestHandlerBase
-
- org.apache.solr.handler.admin.SecurityConfHandler
-
- All Implemented Interfaces:
AutoCloseable
,ApiSupport
,SolrInfoBean
,NestedRequestHandler
,SolrMetricProducer
,SolrRequestHandler
,PermissionNameProvider
- Direct Known Subclasses:
SecurityConfHandlerLocal
,SecurityConfHandlerZk
public abstract class SecurityConfHandler extends RequestHandlerBase implements PermissionNameProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecurityConfHandler.SecurityConfig
Object to hold security.json as nestedMap<String,Object>
and optionally its version.-
Nested classes/interfaces inherited from class org.apache.solr.handler.RequestHandlerBase
RequestHandlerBase.HandlerMetrics
-
Nested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProvider
PermissionNameProvider.Name
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description protected CoreContainer
cores
-
Fields inherited from class org.apache.solr.handler.RequestHandlerBase
aggregateNodeLevelMetricsEnabled, appends, defaults, httpCaching, initArgs, invariants, metrics, solrMetricsContext
-
Fields inherited from interface org.apache.solr.security.PermissionNameProvider
ANY, NULL, values
-
Fields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE
-
-
Constructor Summary
Constructors Constructor Description SecurityConfHandler(CoreContainer coreContainer)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Collection<Api>
getApis()
Returns any (non-JAX-RS annotated) APIs associated with this request handler.SolrInfoBean.Category
getCategory()
Category of this componentprotected abstract void
getConf(SolrQueryResponse rsp, String key)
String
getDescription()
Simple one or two line descriptionstatic List
getListValue(Map<String,Object> lookupMap, String key)
static Map<String,Object>
getMapValue(Map<String,Object> lookupMap, String key)
PermissionNameProvider.Name
getPermissionName(AuthorizationContext ctx)
abstract SecurityConfHandler.SecurityConfig
getSecurityConfig(boolean getFresh)
Gets security.json from sourcevoid
handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
protected abstract boolean
persistConf(SecurityConfHandler.SecurityConfig securityConfig)
Persist security.json to the source, optionally with a versionBoolean
registerV2()
Whether this request handler must be made available at the /v2/ pathprotected void
securityConfEdited()
Hook where you can do stuff after a config has been edited.-
Methods inherited from class org.apache.solr.handler.RequestHandlerBase
getInitArgs, getMetricsForThisRequest, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, initializeMetrics, isInternalShardRequest, normalizeReceivedException, processErrorMetricsOnException, setPluginInfo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.api.ApiSupport
getJerseyResources, registerV1
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
cores
protected CoreContainer cores
-
-
Constructor Detail
-
SecurityConfHandler
public SecurityConfHandler(CoreContainer coreContainer)
-
-
Method Detail
-
getPermissionName
public PermissionNameProvider.Name getPermissionName(AuthorizationContext ctx)
- Specified by:
getPermissionName
in interfacePermissionNameProvider
-
handleRequestBody
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
- Specified by:
handleRequestBody
in classRequestHandlerBase
- Throws:
Exception
-
securityConfEdited
protected void securityConfEdited()
Hook where you can do stuff after a config has been edited. Defaults to NOP
-
getConf
protected abstract void getConf(SolrQueryResponse rsp, String key)
-
getMapValue
public static Map<String,Object> getMapValue(Map<String,Object> lookupMap, String key)
-
getDescription
public String getDescription()
Description copied from interface:SolrInfoBean
Simple one or two line description- Specified by:
getDescription
in interfaceSolrInfoBean
- Specified by:
getDescription
in classRequestHandlerBase
-
getCategory
public SolrInfoBean.Category getCategory()
Description copied from interface:SolrInfoBean
Category of this component- Specified by:
getCategory
in interfaceSolrInfoBean
- Overrides:
getCategory
in classRequestHandlerBase
-
getSecurityConfig
public abstract SecurityConfHandler.SecurityConfig getSecurityConfig(boolean getFresh)
Gets security.json from source
-
persistConf
protected abstract boolean persistConf(SecurityConfHandler.SecurityConfig securityConfig) throws IOException
Persist security.json to the source, optionally with a version- Throws:
IOException
-
getApis
public Collection<Api> getApis()
Description copied from interface:ApiSupport
Returns any (non-JAX-RS annotated) APIs associated with this request handler.- Specified by:
getApis
in interfaceApiSupport
- Overrides:
getApis
in classRequestHandlerBase
- See Also:
ApiSupport.getJerseyResources()
-
registerV2
public Boolean registerV2()
Description copied from interface:ApiSupport
Whether this request handler must be made available at the /v2/ path- Specified by:
registerV2
in interfaceApiSupport
-
-