Package org.apache.storm.common

## Class AbstractHadoopNimbusPluginAutoCreds

- java.lang.Object
- - org.apache.storm.common.AbstractHadoopNimbusPluginAutoCreds

- All Implemented Interfaces:
    `CredentialKeyProvider`, `Shutdownable`, `ICredentialsRenewer`, `INimbusCredentialPlugin`
  Direct Known Subclasses:
    `AutoHBaseNimbus`, `AutoHDFSNimbus`, `AutoHiveNimbus`

      public abstract class AbstractHadoopNimbusPluginAutoCreds
      extends Object
      implements INimbusCredentialPlugin, ICredentialsRenewer, CredentialKeyProvider

  The base class that for auto credential plugins that abstracts out some of the common functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `CONFIG_KEY_RESOURCES` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractHadoopNimbusPluginAutoCreds()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract void` | `doPrepare​(Map<String,​Object> conf)` | Prepare the plugin.
    `protected abstract void` | `doRenew​(Map<String,​String> credentials, Map<String,​Object> topologyConf, String topologyOwnerPrincipal)` |
    `protected void` | `fillHadoopConfiguration​(Map topologyConf, String configKey, org.apache.hadoop.conf.Configuration configuration)` |
    `protected List<String>` | `getConfigKeys​(Map<String,​Object> conf)` |
    `protected abstract String` | `getConfigKeyString()` | The lookup key for the config key string.
    `protected Set<org.apache.commons.math3.util.Pair<String,​org.apache.hadoop.security.Credentials>>` | `getCredentials​(Map<String,​String> credentials, List<String> configKeys)` |
    `protected abstract byte[]` | `getHadoopCredentials​(Map<String,​Object> topologyConf, String topologyOwnerPrincipal)` |
    `protected abstract byte[]` | `getHadoopCredentials​(Map<String,​Object> topologyConf, String configKey, String topologyOwnerPrincipal)` |
    `void` | `populateCredentials​(Map<String,​String> credentials, Map<String,​Object> topologyConf, String topologyOwnerPrincipal)` | Method that will be called on nimbus as part of submit topology.
    `void` | `prepare​(Map<String,​Object> conf)` | This method will be called when nimbus initializes.
    `void` | `renew​(Map<String,​String> credentials, Map<String,​Object> topologyConf, String topologyOwnerPrincipal)` | Renew any credentials that need to be renewed.

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

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

    - ### Methods inherited from interface org.apache.storm.common.CredentialKeyProvider

      `getCredentialKey`

    - ### Methods inherited from interface org.apache.storm.security.INimbusCredentialPlugin

      `populateCredentials`

    - ### Methods inherited from interface org.apache.storm.daemon.Shutdownable

      `shutdown`

- - ### Field Detail

    - #### CONFIG_KEY_RESOURCES

          public static final String CONFIG_KEY_RESOURCES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractHadoopNimbusPluginAutoCreds

          public AbstractHadoopNimbusPluginAutoCreds()

  - ### Method Detail

    - #### prepare

          public void prepare​(Map<String,​Object> conf)

      Description copied from interface: `INimbusCredentialPlugin`
      This method will be called when nimbus initializes.
      Specified by:
        `prepare` in interface `ICredentialsRenewer`
      Specified by:
        `prepare` in interface `INimbusCredentialPlugin`
      Parameters:
        `conf` - the cluster config

    - #### populateCredentials

          public void populateCredentials​(Map<String,​String> credentials,
                                          Map<String,​Object> topologyConf,
                                          String topologyOwnerPrincipal)

      Description copied from interface: `INimbusCredentialPlugin`
      Method that will be called on nimbus as part of submit topology. This plugin will be called at least once during the submit Topology action. It will be not be called during activate instead the credentials return by this method will be merged with the other credentials in the topology and stored in zookeeper.
      Specified by:
        `populateCredentials` in interface `INimbusCredentialPlugin`
      Parameters:
        `credentials` - credentials map where more credentials will be added.
        `topologyConf` - topology configuration
        `topologyOwnerPrincipal` - the full principal name of the owner of the topology

    - #### renew

          public void renew​(Map<String,​String> credentials,
                            Map<String,​Object> topologyConf,
                            String topologyOwnerPrincipal)

      Description copied from interface: `ICredentialsRenewer`
      Renew any credentials that need to be renewed. (Update the credentials if needed)
      Specified by:
        `renew` in interface `ICredentialsRenewer`
      Parameters:
        `credentials` - the credentials that may have something to renew.
        `topologyConf` - topology configuration.
        `topologyOwnerPrincipal` - the full principal name of the owner of the topology

    - #### getCredentials

          protected Set<org.apache.commons.math3.util.Pair<String,​org.apache.hadoop.security.Credentials>> getCredentials​(Map<String,​String> credentials,
                                                                                                                                List<String> configKeys)

    - #### fillHadoopConfiguration

          protected void fillHadoopConfiguration​(Map topologyConf,
                                                 String configKey,
                                                 org.apache.hadoop.conf.Configuration configuration)

    - #### doPrepare

          protected abstract void doPrepare​(Map<String,​Object> conf)

      Prepare the plugin.
      Parameters:
        `conf` - the storm cluster conf set via storm.yaml

    - #### getConfigKeyString

          protected abstract String getConfigKeyString()

      The lookup key for the config key string.
      Returns:
        the config key string

    - #### getHadoopCredentials

          protected abstract byte[] getHadoopCredentials​(Map<String,​Object> topologyConf,
                                                         String configKey,
                                                         String topologyOwnerPrincipal)

    - #### getHadoopCredentials

          protected abstract byte[] getHadoopCredentials​(Map<String,​Object> topologyConf,
                                                         String topologyOwnerPrincipal)

    - #### doRenew

          protected abstract void doRenew​(Map<String,​String> credentials,
                                          Map<String,​Object> topologyConf,
                                          String topologyOwnerPrincipal)

    - #### getConfigKeys

          protected List<String> getConfigKeys​(Map<String,​Object> conf)