net.corda.core.node

## Class CordaPluginRegistry

- net.corda.core.node.CordaPluginRegistry

- Direct Known Subclasses:
    DefaultWhitelist, DataVending.Plugin, NotaryChange.Plugin

      public class CordaPluginRegistry

  Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CordaPluginRegistry(java.util.List<? extends java.util.function.Function<net.corda.core.messaging.CordaRPCOps,? extends java.lang.Object>> webApis, java.util.Map<java.lang.String,java.lang.String> staticServeDirs, java.util.Map<java.lang.String,? extends java.util.Set<java.lang.String>> requiredFlows, java.util.List<? extends java.util.function.Function<net.corda.core.node.PluginServiceHub,? extends java.lang.Object>> servicePlugins)` Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.
    `CordaPluginRegistry()` Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `customizeSerialization(SerializationCustomization custom)` Optionally whitelist types for use in object serialization, as we lock down the types that can be serialized.
    `java.util.Map<java.lang.String,java.util.Set>` | `getRequiredFlows()` A Map with an entry for each consumed Flow used by the webAPIs.
    `java.util.List<java.util.function.Function>` | `getServicePlugins()` List of lambdas constructing additional long lived services to be hosted within the node.
    `java.util.Map<java.lang.String,java.lang.String>` | `getStaticServeDirs()` Map of static serving endpoints to the matching resource directory.
    `java.util.List<java.util.function.Function>` | `getWebApis()` List of lambdas returning JAX-RS objects.

- - ### Constructor Detail

    - #### CordaPluginRegistry

          public CordaPluginRegistry(java.util.List<? extends java.util.function.Function<net.corda.core.messaging.CordaRPCOps,? extends java.lang.Object>> webApis,
                                     java.util.Map<java.lang.String,java.lang.String> staticServeDirs,
                                     java.util.Map<java.lang.String,? extends java.util.Set<java.lang.String>> requiredFlows,
                                     java.util.List<? extends java.util.function.Function<net.corda.core.node.PluginServiceHub,? extends java.lang.Object>> servicePlugins)

      Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.

      Parameters:
        `webApis` - List of lambdas returning JAX-RS objects.They may only depend on the RPC interface,as the webserver shouldpotentially be able to live in a process separate from the node itself.
        `staticServeDirs` - Map of static serving endpoints to the matching resource directory.All endpoints will be prefixed with"/web"and postfixed with"\*.Resource directories can be either on disk directories(especially when debugging)in the form"a/b/c".Serving from a JAR canbe specified with:javaClass.getResource("").toExternalForm()
        `requiredFlows` - A Map with an entry for each consumed Flow used by the webAPIs.The key of each map entry should contain the FlowLogicclass name.The associated map values are the union of all concrete class names passed to the Flow constructor.Standard java.lang.*and kotlin.*types do not need to be included explicitly.This is used to extend the white listed Flows that can be initiated from the ServiceHub invokeFlowAsync method.
        `servicePlugins` - List of lambdas constructing additional long lived services to be hosted within the node.They expect a single`interface PluginServiceHub`parameter as input.The`interface PluginServiceHub`will be fully constructed before the plugin service is created and willallow access to the Flow factory and Flow initiation entry points there.

    - #### CordaPluginRegistry

          public CordaPluginRegistry()

      Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.

  - ### Method Detail

    - #### customizeSerialization

          public boolean customizeSerialization(SerializationCustomization custom)

      Optionally whitelist types for use in object serialization, as we lock down the types that can be serialized.

      For example, if you add a new ContractState it needs to be whitelisted. You can do that either by adding the @CordaSerializable annotation or via this method.

      Returns:
        true if you register types, otherwise you will be filtered out of the list of plugins considered in future.
      See Also:
        ContractState

    - #### getWebApis

          public java.util.List<java.util.function.Function> getWebApis()

      List of lambdas returning JAX-RS objects.

      They may only depend on the RPC interface,as the webserver shouldpotentially be able to live in a process separate from the node itself.

    - #### getStaticServeDirs

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

      Map of static serving endpoints to the matching resource directory.

      All endpoints will be prefixed with"/web"and postfixed with"\*.Resource directories can be either on disk directories(especially when debugging)in the form"a/b/c".Serving from a JAR canbe specified with:javaClass.getResource("").toExternalForm()

    - #### getRequiredFlows

          public java.util.Map<java.lang.String,java.util.Set> getRequiredFlows()

      A Map with an entry for each consumed Flow used by the webAPIs.

      The key of each map entry should contain the FlowLogicclass name.The associated map values are the union of all concrete class names passed to the Flow constructor.Standard java.lang.*and kotlin.*types do not need to be included explicitly.This is used to extend the white listed Flows that can be initiated from the ServiceHub invokeFlowAsync method.

    - #### getServicePlugins

          public java.util.List<java.util.function.Function> getServicePlugins()

      List of lambdas constructing additional long lived services to be hosted within the node.

      They expect a single`interface PluginServiceHub`parameter as input.The`interface PluginServiceHub`will be fully constructed before the plugin service is created and willallow access to the Flow factory and Flow initiation entry points there.

      See Also:
        `interface PluginServiceHub`, `interface PluginServiceHub`