Package org.apache.solr.rest
Class RestManager
java.lang.Object
org.apache.solr.rest.RestManager
Supports runtime mapping of REST API endpoints to ManagedResource implementations; endpoints can
be registered at either the /schema or /config base paths, depending on which base path is more
appropriate for the type of managed resource.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRequest handling needs a lightweight object to delegate a request to.static classPer-core registry of ManagedResources found during core initialization. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.rest.RestManager.RestManagerManagedResourceprotected SolrResourceLoaderprotected Map<String, ManagedResource> static final Stringprotected RestManager.Registrystatic final Stringprotected ManagedResourceStorage.StorageIO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddManagedResource(String resourceId, Class<? extends ManagedResource> clazz) If not already registered, registers the givenManagedResourcesubclass at the given resourceId, creates an instance.protected ManagedResourcecreateManagedResource(org.apache.solr.rest.RestManager.ManagedResourceRegistration reg) Creates a ManagedResource using registration information.voidDeletes a managed resource if it is not being used by any Solr components.getManagedResource(String resourceId) Returns theManagedResourcesubclass instance corresponding to the given resourceId from the registry.getManagedResourceOrNull(String resourceId) Returns theManagedResourcesubclass instance corresponding to the given resourceId from the registry, or null if no resource has been registered with the given resourceId.voidinit(SolrResourceLoader loader, org.apache.solr.common.util.NamedList<String> initArgs, ManagedResourceStorage.StorageIO storageIO) Initializes the RestManager with the storageIO being optionally created outside of this implementation such as to use ZooKeeper instead of the local FS.
-
Field Details
-
SCHEMA_BASE_PATH
- See Also:
-
MANAGED_ENDPOINT
- See Also:
-
storageIO
-
registry
-
managed
-
endpoint
protected org.apache.solr.rest.RestManager.RestManagerManagedResource endpoint -
loader
-
-
Constructor Details
-
RestManager
public RestManager()
-
-
Method Details
-
init
public void init(SolrResourceLoader loader, org.apache.solr.common.util.NamedList<String> initArgs, ManagedResourceStorage.StorageIO storageIO) throws org.apache.solr.common.SolrException Initializes the RestManager with the storageIO being optionally created outside of this implementation such as to use ZooKeeper instead of the local FS.- Throws:
org.apache.solr.common.SolrException
-
addManagedResource
public ManagedResource addManagedResource(String resourceId, Class<? extends ManagedResource> clazz) If not already registered, registers the givenManagedResourcesubclass at the given resourceId, creates an instance. Returns the corresponding instance. -
createManagedResource
protected ManagedResource createManagedResource(org.apache.solr.rest.RestManager.ManagedResourceRegistration reg) throws org.apache.solr.common.SolrException Creates a ManagedResource using registration information.- Throws:
org.apache.solr.common.SolrException
-
getManagedResource
Returns theManagedResourcesubclass instance corresponding to the given resourceId from the registry.- Throws:
org.apache.solr.common.SolrException- if no managed resource is registered with the given resourceId.
-
getManagedResourceOrNull
Returns theManagedResourcesubclass instance corresponding to the given resourceId from the registry, or null if no resource has been registered with the given resourceId. -
deleteManagedResource
Deletes a managed resource if it is not being used by any Solr components.
-