Interface PluginTools


@SupportedAll public interface PluginTools
A collection of simple tools for interacting with the SMS (Service Management Service). For more advanced usage you will need to use the SMS API directly. See com.sun.identity.sm.ServiceSchemaManager
  • Field Details

  • Method Details

    • addSmsService

      void addSmsService(InputStream inputStream) throws PluginException
      Add a new SMS service.
      Parameters:
      inputStream - A stream from which the service schema XML can be read.
      Throws:
      PluginException - If the service cannot be registered.
    • addAuthModule

      void addAuthModule(Class<?> moduleClass, InputStream inputStream) throws PluginException
      Add a new Auth Module - also registers the SMS service.
      Parameters:
      moduleClass - The com.sun.identity.authentication.spi.AMLoginModule class.
      inputStream - A stream from which the service schema XML can be read.
      Throws:
      PluginException - If either the auth module or the underlying service cannot be registered.
    • registerAuthNode

      @Deprecated void registerAuthNode(Class<?> nodeClass) throws PluginException
      Deprecated.
      Installs and registers an authentication node for execution by trees.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      nodeClass - The org.forgerock.openam.auth.node.api.Node class.
      Throws:
      PluginException - If the auth node does not implement the Node interface, or cannot be registered for some other reason.
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • installSecretsStoreType

      void installSecretsStoreType(Class<?> secretsStoreClass) throws PluginException
      Installs and registers a secrets store type for use in obtaining secrets for services.

      This method should be called only plugin installation.

      Parameters:
      secretsStoreClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
    • startSecretsStoreType

      void startSecretsStoreType(Class<?> secretsStoreClass) throws PluginException
      Installs and registers a secrets store type for use in obtaining secrets for services.

      This method should be called only on plugin startup.

      Parameters:
      secretsStoreClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
    • uninstallAuthNode

      void uninstallAuthNode(Class<?> nodeClass) throws PluginException
      Uninstalls and de-registers an authentication node for execution by trees.
      Parameters:
      nodeClass - The org.forgerock.openam.auth.node.api.Node class.
      Throws:
      PluginException - If the auth node does not implement the Node interface, or cannot be de-registered for some other reason.
    • registerService

      @Deprecated void registerService(Class<?> serviceClass) throws PluginException
      Deprecated.
      Register an annotated service class.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      serviceClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
    • installService

      void installService(Class<?> serviceClass) throws PluginException
      Installs an annotated service class.

      This method should be called only on plugin installation.

      Parameters:
      serviceClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be installed for some reason.
    • startService

      void startService(Class<?> serviceClass) throws PluginException
      Installs an annotated service class.

      This method should be called on plugin startup.

      Parameters:
      serviceClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be started for some reason.
    • upgradeAuthNode

      void upgradeAuthNode(Class<?> nodeClass) throws PluginException
      Upgrades an existing authentication node.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      nodeClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • installAuthNode

      void installAuthNode(Class<?> nodeClass) throws PluginException
      Installs a new authentication node.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      nodeClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • installAuthNodeDynamically

      void installAuthNodeDynamically(Class<?> nodeClass) throws PluginException
      Installs a new authentication node that is generated at runtime.

      This method can be called any time, even after the plugins have finished installation and startup.

      Parameters:
      nodeClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • addNodeToRegistry

      void addNodeToRegistry(Class<?> nodeClass)
      Adds the node to the registry of nodes.
      Parameters:
      nodeClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • startAuthNode

      void startAuthNode(Class<?> nodeClass) throws PluginException
      Starts an existing authentication node.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      nodeClass - The org.forgerock.openam.annotations.sm.Config-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the nodeClass is not annotated correctly.
    • installIdRepo

      void installIdRepo(Class<?> idRepoConfig) throws PluginException
      Installs a new identity repository.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      idRepoConfig - The org.forgerock.openam.annotations.sm.IdRepoConfig-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the idRepoConfig is not annotated correctly.
    • upgradeIdRepo

      void upgradeIdRepo(Class<?> idRepoConfig) throws PluginException
      Upgrades an existing identity repository.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      idRepoConfig - The org.forgerock.openam.annotations.sm.IdRepoConfig-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the idRepoConfig is not annotated correctly.
    • startIdRepo

      void startIdRepo(Class<?> idRepoConfig) throws PluginException
      Starts an existing identity repository.

      This method should be called both on plugin installation and on plugin startup.

      Parameters:
      idRepoConfig - The org.forgerock.openam.annotations.sm.IdRepoConfig-annotated class.
      Throws:
      PluginException - If the class cannot be registered for some reason.
      IllegalArgumentException - If the idRepoConfig is not annotated correctly.
    • uninstallIdRepo

      void uninstallIdRepo(Class<?> idRepoConfig) throws PluginException
      Uninstalls and de-registers an identity repository.
      Parameters:
      idRepoConfig - The org.forgerock.openam.annotations.sm.IdRepoConfig-annotated class.
      Throws:
      PluginException - If the class cannot be unregistered for some reason.
      IllegalArgumentException - If the idRepoConfig is not annotated correctly.
    • resolveInstallationPath

      Path resolveInstallationPath(String path)
      Resolves a file path relative to the AM installation location. For example, if AM is installed into /home/forgerock/am and the path foo/bar is passed then this will return the path object for /home/forgerock/am/foo/bar. No attempt is made to check if the path actually exists.

      Non-ForgeRock authored plugins should avoid relying on particular paths existing in the installation directory as these may change during version upgrades.

      Parameters:
      path - the path to resolve relative to the AM installation directory.
      Returns:
      the resolved path.