org.apache.solr.rest.schema.analysis

## Class BaseManagedTokenFilterFactory

- java.lang.Object
- - org.apache.lucene.analysis.util.AbstractAnalysisFactory
  - - org.apache.lucene.analysis.util.TokenFilterFactory
    - - org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory

- All Implemented Interfaces:
    ResourceLoaderAware, ManagedResourceObserver
  Direct Known Subclasses:
    ManagedStopFilterFactory, ManagedSynonymFilterFactory

      public abstract class BaseManagedTokenFilterFactory
      extends TokenFilterFactory
      implements ResourceLoaderAware, ManagedResourceObserver

  Abstract based class for implementing TokenFilterFactory objects that are managed by the REST API. Specifically, this base class is useful for token filters that have configuration and data that needs to be updated programmatically, such as to support a UI for adding synonyms.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `handle`

    - ### Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

      `LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseManagedTokenFilterFactory(Map<String,String> args)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract Class<? extends ManagedResource>` | `getManagedResourceImplClass()` Let the concrete analysis component determine the ManagedResource implementation.
    `protected abstract String` | `getResourceId()` Let the concrete analysis component decide the path it wishes to be managed at.
    `void` | `inform(ResourceLoader loader)` Registers an endpoint with the RestManager so that this component can be managed using the REST API.

    - ### Methods inherited from class org.apache.lucene.analysis.util.TokenFilterFactory

      `availableTokenFilters, create, forName, lookupClass, reloadTokenFilters`

    - ### Methods inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

      `get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitFileNames`

    - ### 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.rest.ManagedResourceObserver

      `onManagedResourceInitialized`

- - ### Field Detail

    - #### handle

          protected String handle

  - ### Constructor Detail

    - #### BaseManagedTokenFilterFactory

          protected BaseManagedTokenFilterFactory(Map<String,String> args)

  - ### Method Detail

    - #### inform

          public void inform(ResourceLoader loader)
                      throws IOException

      Registers an endpoint with the RestManager so that this component can be managed using the REST API. This method can be invoked before all the resources the `RestManager` needs to initialize a `ManagedResource` are available, so this simply registers the need to be managed at a specific endpoint and lets the RestManager deal with initialization when ready.
      Specified by:
        `inform` in interface `ResourceLoaderAware`
      Throws:
        `IOException`

    - #### getResourceId

          protected abstract String getResourceId()

      Let the concrete analysis component decide the path it wishes to be managed at.

    - #### getManagedResourceImplClass

          protected abstract Class<? extends ManagedResource> getManagedResourceImplClass()

      Let the concrete analysis component determine the ManagedResource implementation. As there can be many instances of the same analysis component in a schema, this class should not presume to create ManagedResource. For instance, there may be 10 instances of the ManagedStopFilterFactory that use the same set of English stop words and we don't want 10 copies of the ManagedWordSetResource in the same core.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.