org.apache.solr.rest

## Class ManagedResourceStorage.JsonStorage

- java.lang.Object
- - org.apache.solr.rest.ManagedResourceStorage
  - - org.apache.solr.rest.ManagedResourceStorage.JsonStorage

- Enclosing class:
    ManagedResourceStorage

      public static class ManagedResourceStorage.JsonStorage
      extends ManagedResourceStorage

  Default storage implementation that uses JSON as the storage format for managed data.

- - ### Nested Class Summary

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

      `ManagedResourceStorage.FileStorageIO, ManagedResourceStorage.InMemoryStorageIO, ManagedResourceStorage.JsonStorage, ManagedResourceStorage.StorageIO, ManagedResourceStorage.ZooKeeperStorageIO`

  - ### Field Summary

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

      `loader, STORAGE_DIR_INIT_ARG, STORAGE_IO_CLASS_INIT_ARG, storageIO, UTF_8`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsonStorage(ManagedResourceStorage.StorageIO storageIO, SolrResourceLoader loader)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getStoredResourceId(String resourceId)` Determines the relative path (from the storage root) for the given resource.
    `protected Object` | `parseText(Reader reader, String resourceId)` Called by `ManagedResourceStorage.load(String)` to convert the serialized resource into its in-memory representation.
    `void` | `store(String resourceId, Object toStore)` Persists the given toStore object with the given resourceId.

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

      `delete, getResourceLoader, getStorageIO, load, newStorageIO`

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

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

- - ### Constructor Detail

    - #### JsonStorage

          public JsonStorage(ManagedResourceStorage.StorageIO storageIO,
                             SolrResourceLoader loader)

  - ### Method Detail

    - #### getStoredResourceId

          public String getStoredResourceId(String resourceId)

      Determines the relative path (from the storage root) for the given resource. In this case, it returns a file named with the .json extension.
      Specified by:
        `getStoredResourceId` in class `ManagedResourceStorage`

    - #### parseText

          protected Object parseText(Reader reader,
                                     String resourceId)
                              throws IOException

      Description copied from class: `ManagedResourceStorage`
      Called by `ManagedResourceStorage.load(String)` to convert the serialized resource into its in-memory representation.
      Overrides:
        `parseText` in class `ManagedResourceStorage`
      Throws:
        `IOException`

    - #### store

          public void store(String resourceId,
                            Object toStore)
                     throws IOException

      Description copied from class: `ManagedResourceStorage`
      Persists the given toStore object with the given resourceId.
      Specified by:
        `store` in class `ManagedResourceStorage`
      Throws:
        `IOException`

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