org.apache.nutch.api.impl

## Class RAMConfManager

- java.lang.Object
- - org.apache.nutch.api.impl.RAMConfManager

- All Implemented Interfaces:
    ConfManager

      public class RAMConfManager
      extends java.lang.Object
      implements ConfManager

  Configuration manager which holds a map of `Configuration` type configurations and ids.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RAMConfManager()` Public constructor which creates a default configuration with id of `ConfigResource.DEFAULT`.
    `RAMConfManager(java.lang.String confId, Configuration configuration)` Public constructor which accepts a configuration id and `Configuration` type configuration.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `create(NutchConfig nutchConfig)` Creates hadoop configuration for given Nutch configuration.
    `void` | `delete(java.lang.String confId)` Deletes configuration for given configuration id.
    `Configuration` | `get(java.lang.String confId)` Returns configuration map for give configuration id.
    `java.util.Map<java.lang.String,java.lang.String>` | `getAsMap(java.lang.String confId)` Returns configuration map for give configuration id.
    `java.util.Set<java.lang.String>` | `list()` Lists configuration keys.
    `void` | `setProperty(java.lang.String confId, java.lang.String propName, java.lang.String propValue)` Sets a property for the configuration which has given configuration id.

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

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

- - ### Constructor Detail

    - #### RAMConfManager

          public RAMConfManager()

      Public constructor which creates a default configuration with id of `ConfigResource.DEFAULT`.

    - #### RAMConfManager

          public RAMConfManager(java.lang.String confId,
                                Configuration configuration)

      Public constructor which accepts a configuration id and `Configuration` type configuration.
      Parameters:
        `confId` - configuration id
        `configuration` - configuration

  - ### Method Detail

    - #### list

          public java.util.Set<java.lang.String> list()

      Lists configuration keys.
      Specified by:
        `list` in interface `ConfManager`
      Returns:
        Set of configuration keys

    - #### get

          public Configuration get(java.lang.String confId)

      Returns configuration map for give configuration id.
      Specified by:
        `get` in interface `ConfManager`
      Parameters:
        `confId` - Configuration id.
      Returns:
        Configuration for given configuration id. `ConfigResource.DEFAULT` is used if given configuration id is null.

    - #### getAsMap

          public java.util.Map<java.lang.String,java.lang.String> getAsMap(java.lang.String confId)

      Returns configuration map for give configuration id. An empty map is returned if a configuration could not be retrieved for given configuration id.
      Specified by:
        `getAsMap` in interface `ConfManager`
      Parameters:
        `confId` - Configuration id
      Returns:
        map of configurations

    - #### setProperty

          public void setProperty(java.lang.String confId,
                                  java.lang.String propName,
                                  java.lang.String propValue)

      Sets a property for the configuration which has given configuration id.
      Specified by:
        `setProperty` in interface `ConfManager`
      Parameters:
        `confId` - Configuration id
        `propName` - property name to set
        `propValue` - property value to set

    - #### delete

          public void delete(java.lang.String confId)

      Deletes configuration for given configuration id.
      Specified by:
        `delete` in interface `ConfManager`
      Parameters:
        `confId` - Configuration id

    - #### create

          public java.lang.String create(NutchConfig nutchConfig)

      Creates hadoop configuration for given Nutch configuration. Checks whether it can create a Nutch configuration or not before it creates. Throws `IllegalArgumentException` if can not pass {`canCreate(NutchConfig)`}.
      Specified by:
        `create` in interface `ConfManager`
      Parameters:
        `nutchConfig` - Nutch configuration
      Returns:
        created configuration id

Copyright © 2019 The Apache Software Foundation