org.apache.solr.rest.schema.analysis

## Class ManagedWordSetResource

- java.lang.Object
- - org.apache.solr.rest.ManagedResource
  - - org.apache.solr.rest.schema.analysis.ManagedWordSetResource

- All Implemented Interfaces:
    ManagedResource.ChildResourceSupport

      public class ManagedWordSetResource
      extends ManagedResource
      implements ManagedResource.ChildResourceSupport

  ManagedResource implementation for managing a set of words using the REST API; useful for managing stop words and/or protected words for analysis components like the KeywordMarkerFilter.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.solr.rest.ManagedResource

      `ManagedResource.ChildResourceSupport`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `IGNORE_CASE_INIT_ARG`
    `static String` | `WORD_SET_JSON_FIELD`

    - ### Fields inherited from class org.apache.solr.rest.ManagedResource

      `INIT_ARGS_JSON_FIELD, INITIALIZED_ON_JSON_FIELD, initializedOn, lastUpdateSinceInitialization, MANAGED_JSON_LIST_FIELD, MANAGED_JSON_MAP_FIELD, managedInitArgs, solrResourceLoader, storage, UPDATED_SINCE_INIT_JSON_FIELD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ManagedWordSetResource(String resourceId, SolrResourceLoader loader, ManagedResourceStorage.StorageIO storageIO)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `applyUpdatesToManagedData(Object updates)` Applies updates to the word set being managed by this resource.
    `void` | `doDeleteChild(BaseSolrResource endpoint, String childId)` Deletes words managed by this resource.
    `void` | `doGet(BaseSolrResource endpoint, String childId)` Implements the GET request to provide the list of words to the client.
    `boolean` | `getIgnoreCase()` Returns the boolean value of the `IGNORE_CASE_INIT_ARG` init arg, or the default value (false) if it has not been specified
    `boolean` | `getIgnoreCase(NamedList<?> initArgs)` Returns the boolean value of the `IGNORE_CASE_INIT_ARG` init arg, or the default value (false) if it has not been specified
    `Set<String>` | `getWordSet()` Returns the set of words in this managed word set.
    `protected void` | `onManagedDataLoadedFromStorage(NamedList<?> initArgs, Object data)` Invoked when loading data from storage to initialize the list of words managed by this instance.
    `protected boolean` | `updateInitArgs(NamedList<?> updatedArgs)` Called from `ManagedResource.doPut(BaseSolrResource,Representation,Object)` to update this resource's init args using the given updatedArgs

    - ### Methods inherited from class org.apache.solr.rest.ManagedResource

      `buildMapToStore, convertNamedListToMap, createStorage, doPost, doPut, getInitializedOn, getResourceId, getResourceLoader, getServerResourceClass, getUpdatedSinceInitialization, hasChangesSinceInitialization, loadManagedDataAndNotify, notifyObserversDuringInit, onResourceDeleted, processStoredData, reloadFromStorage, storeManagedData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### WORD_SET_JSON_FIELD

          public static final String WORD_SET_JSON_FIELD

      See Also:
        Constant Field Values

    - #### IGNORE_CASE_INIT_ARG

          public static final String IGNORE_CASE_INIT_ARG

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ManagedWordSetResource

          public ManagedWordSetResource(String resourceId,
                                        SolrResourceLoader loader,
                                        ManagedResourceStorage.StorageIO storageIO)
                                 throws SolrException

      Throws:
        `SolrException`

  - ### Method Detail

    - #### getWordSet

          public Set<String> getWordSet()

      Returns the set of words in this managed word set.

    - #### getIgnoreCase

          public boolean getIgnoreCase()

      Returns the boolean value of the `IGNORE_CASE_INIT_ARG` init arg, or the default value (false) if it has not been specified

    - #### getIgnoreCase

          public boolean getIgnoreCase(NamedList<?> initArgs)

      Returns the boolean value of the `IGNORE_CASE_INIT_ARG` init arg, or the default value (false) if it has not been specified

    - #### onManagedDataLoadedFromStorage

          protected void onManagedDataLoadedFromStorage(NamedList<?> initArgs,
                                                        Object data)
                                                 throws SolrException

      Invoked when loading data from storage to initialize the list of words managed by this instance. A load of the data can happen many times throughout the life cycle of this object.
      Specified by:
        `onManagedDataLoadedFromStorage` in class `ManagedResource`
      Throws:
        `SolrException`

    - #### doGet

          public void doGet(BaseSolrResource endpoint,
                            String childId)

      Implements the GET request to provide the list of words to the client. Alternatively, if a specific word is requested, then it is returned or a 404 is raised, indicating that the requested word does not exist.
      Specified by:
        `doGet` in class `ManagedResource`

    - #### doDeleteChild

          public void doDeleteChild(BaseSolrResource endpoint,
                                    String childId)

      Deletes words managed by this resource.
      Specified by:
        `doDeleteChild` in class `ManagedResource`

    - #### applyUpdatesToManagedData

          protected Object applyUpdatesToManagedData(Object updates)

      Applies updates to the word set being managed by this resource.
      Specified by:
        `applyUpdatesToManagedData` in class `ManagedResource`

    - #### updateInitArgs

          protected boolean updateInitArgs(NamedList<?> updatedArgs)

      Description copied from class: `ManagedResource`
      Called from `ManagedResource.doPut(BaseSolrResource,Representation,Object)` to update this resource's init args using the given updatedArgs
      Overrides:
        `updateInitArgs` in class `ManagedResource`

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