Class RestManager

  • public class RestManager
    extends Object
    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.
    • Constructor Detail

      • RestManager

        public RestManager()
    • Method Detail

      • 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.
      • addManagedResource

        public ManagedResource addManagedResource​(String resourceId,
                                                  Class<? extends ManagedResource> clazz)
        If not already registered, registers the given ManagedResource subclass at the given resourceId, creates an instance. Returns the corresponding instance.
      • createManagedResource

        protected ManagedResource createManagedResource​( reg)
                                                 throws org.apache.solr.common.SolrException
        Creates a ManagedResource using registration information.
      • getManagedResource

        public ManagedResource getManagedResource​(String resourceId)
        Returns the ManagedResource subclass instance corresponding to the given resourceId from the registry.
        org.apache.solr.common.SolrException - if no managed resource is registered with the given resourceId.
      • getManagedResourceOrNull

        public 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.
      • deleteManagedResource

        public void deleteManagedResource​(ManagedResource res)
        Deletes a managed resource if it is not being used by any Solr components.