Class DefaultScriptFactoryManager

java.lang.Object
org.forgerock.openig.script.DefaultScriptFactoryManager
All Implemented Interfaces:
ScriptFactoryManager

public class DefaultScriptFactoryManager extends Object implements ScriptFactoryManager
Default implementation of ScriptFactoryManager supporting dynamic registration and un-registration of ScriptFactory.
  • Constructor Details

    • DefaultScriptFactoryManager

      public DefaultScriptFactoryManager()
  • Method Details

    • registerFactory

      public ScriptFactory registerFactory(String mimeType, ScriptFactory factory)
      Registers a given mimeType for the given ScriptFactory.
      Parameters:
      mimeType - registered MIME type
      factory - factory to use for the given type
      Returns:
      the previous registered factory (if any)
    • unregisterFactory

      public ScriptFactory unregisterFactory(String mimeType)
      Un-registers the factory for the given mimeType.
      Parameters:
      mimeType - MIME type to un-register
      Returns:
      the removed factory (if any)
    • findScriptFactory

      public Optional<ScriptFactory> findScriptFactory(String mimeType)
      Description copied from interface: ScriptFactoryManager
      Finds a factory for the given MIME type.
      Specified by:
      findScriptFactory in interface ScriptFactoryManager
      Parameters:
      mimeType - type value
      Returns:
      an empty Optional if not factory can be found, otherwise a valued Optional wrapping the factory