public class RestManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RestManager.ManagedEndpoint
The Restlet router needs a lightweight extension of ServerResource to delegate a request
to.
|
static class |
RestManager.Registry
Per-core registry of ManagedResources found during core initialization.
|
Modifier and Type | Field and Description |
---|---|
protected org.restlet.routing.Router |
configRouter |
protected org.apache.solr.rest.RestManager.RestManagerManagedResource |
endpoint |
protected SolrResourceLoader |
loader |
static org.slf4j.Logger |
log |
protected Map<String,ManagedResource> |
managed |
static String |
MANAGED_ENDPOINT |
protected RestManager.Registry |
registry |
static String |
SCHEMA_BASE_PATH |
protected org.restlet.routing.Router |
schemaRouter |
protected ManagedResourceStorage.StorageIO |
storageIO |
Constructor and Description |
---|
RestManager() |
Modifier and Type | Method and Description |
---|---|
ManagedResource |
addManagedResource(String resourceId,
Class<? extends ManagedResource> clazz)
If not already registered, registers the given
ManagedResource subclass
at the given resourceId, creates an instance, and attaches it to the appropriate
Restlet router. |
protected void |
attachManagedResource(ManagedResource res,
String path,
org.restlet.routing.Router router)
Attaches a ManagedResource and optionally a path for child resources
to the given Restlet Router.
|
void |
attachManagedResources(String routerPath,
org.restlet.routing.Router router)
Attach managed resource paths to the given Restlet Router.
|
protected ManagedResource |
createManagedResource(org.apache.solr.rest.RestManager.ManagedResourceRegistration reg)
Creates a ManagedResource using registration information.
|
void |
deleteManagedResource(ManagedResource res)
Deletes a managed resource if it is not being used by any Solr components.
|
ManagedResource |
getManagedResource(String resourceId)
Returns the
ManagedResource subclass instance corresponding
to the given resourceId from the registry. |
ManagedResource |
getManagedResourceOrNull(String resourceId)
Returns the
ManagedResource subclass instance corresponding
to the given resourceId from the registry, or null if no resource
has been registered with the given resourceId. |
static RestManager |
getRestManager(SolrRequestInfo solrRequestInfo)
Locates the RestManager using ThreadLocal SolrRequestInfo.
|
void |
init(SolrResourceLoader loader,
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.
|
public static final org.slf4j.Logger log
public static final String SCHEMA_BASE_PATH
public static final String MANAGED_ENDPOINT
protected ManagedResourceStorage.StorageIO storageIO
protected RestManager.Registry registry
protected Map<String,ManagedResource> managed
protected org.apache.solr.rest.RestManager.RestManagerManagedResource endpoint
protected SolrResourceLoader loader
protected org.restlet.routing.Router schemaRouter
protected org.restlet.routing.Router configRouter
public static RestManager getRestManager(SolrRequestInfo solrRequestInfo)
public void init(SolrResourceLoader loader, NamedList<String> initArgs, ManagedResourceStorage.StorageIO storageIO) throws SolrException
SolrException
public ManagedResource addManagedResource(String resourceId, Class<? extends ManagedResource> clazz)
ManagedResource
subclass
at the given resourceId, creates an instance, and attaches it to the appropriate
Restlet router. Returns the corresponding instance.protected ManagedResource createManagedResource(org.apache.solr.rest.RestManager.ManagedResourceRegistration reg) throws SolrException
SolrException
public ManagedResource getManagedResource(String resourceId)
ManagedResource
subclass instance corresponding
to the given resourceId from the registry.org.restlet.resource.ResourceException
- if no managed resource is registered with
the given resourceId.public ManagedResource getManagedResourceOrNull(String resourceId)
ManagedResource
subclass instance corresponding
to the given resourceId from the registry, or null if no resource
has been registered with the given resourceId.public void deleteManagedResource(ManagedResource res)
public void attachManagedResources(String routerPath, org.restlet.routing.Router router)
router
- - Restlet Routerprotected void attachManagedResource(ManagedResource res, String path, org.restlet.routing.Router router)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.