net.corda.node.services.schema

## Class NodeSchemaService

- SingletonSerializeAsToken
- - net.corda.node.services.schema.NodeSchemaService

- All Implemented Interfaces:
    SchemaService, SerializeAsToken

      public class NodeSchemaService
      extends SingletonSerializeAsToken
      implements SchemaService

  Most basic implementation of `interface SchemaService`.

  TODO: support loading schema options from node configuration. TODO: support configuring what schemas are to be selected for persistence. TODO: support plugins for schema version upgrading or custom mapping not supported by original `interface QueryableState`.

  See Also:
    `interface SchemaService`, `interface QueryableState`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.corda.node.services.api.SchemaService

      `SchemaService.SchemaOptions`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeSchemaService()` Most basic implementation of `interface SchemaService`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PersistentState` | `generateMappedObject(QueryableState state, MappedSchema schema)` Map a state to a `class PersistentState` for the given schema, either via direct support from the state or via custom logic in this service.
    `java.util.Map<net.corda.core.schemas.MappedSchema,net.corda.node.services.api.SchemaService.SchemaOptions>` | `getSchemaOptions()` Options configured for this node's schemas. A missing entry for a schema implies all properties are null.
    `java.lang.Iterable<net.corda.core.schemas.MappedSchema>` | `selectSchemas(QueryableState state)` Given a state, select schemas to map it to that are supported by generateMappedObject and that are configured for this node.

    - ### Methods inherited from class net.corda.core.serialization.SingletonSerializeAsToken

      `toToken`

    - ### Methods inherited from interface net.corda.node.services.api.SchemaService

      `generateMappedObject, getSchemaOptions, selectSchemas`

    - ### Methods inherited from interface net.corda.core.serialization.SerializeAsToken

      `toToken`

- - ### Constructor Detail

    - #### NodeSchemaService

          public NodeSchemaService()

      Most basic implementation of `interface SchemaService`.

      TODO: support loading schema options from node configuration. TODO: support configuring what schemas are to be selected for persistence. TODO: support plugins for schema version upgrading or custom mapping not supported by original `interface QueryableState`.

      See Also:
        `interface SchemaService`, `interface QueryableState`

  - ### Method Detail

    - #### getSchemaOptions

          public java.util.Map<net.corda.core.schemas.MappedSchema,net.corda.node.services.api.SchemaService.SchemaOptions> getSchemaOptions()

      Options configured for this node's schemas. A missing entry for a schema implies all properties are null.

    - #### selectSchemas

          public java.lang.Iterable<net.corda.core.schemas.MappedSchema> selectSchemas(QueryableState state)

      Given a state, select schemas to map it to that are supported by generateMappedObject and that are configured for this node.

    - #### generateMappedObject

          public PersistentState generateMappedObject(QueryableState state,
                                                      MappedSchema schema)

      Map a state to a `class PersistentState` for the given schema, either via direct support from the state or via custom logic in this service.

      See Also:
        `class PersistentState`