Class RouteImporter


  • public class RouteImporter
    extends Object
    A RouteImporter is responsible for creating a RouteInstance from a given JsonValue that represents an IG route.

    It's not its responsibility to start the route (and all of its components), it only creates the underlying model and build up its ComponentInstance with references in between them.

    The route still needs to be "valid": missing references will trigger importing errors, mandatory fields will be checked.

    • Constructor Detail

      • RouteImporter

        public RouteImporter​(org.forgerock.openig.model.type.TypeDefinitionRegistry definitionRegistry,
                             org.forgerock.openig.model.resolver.ComponentInstanceFactoryRegistry factoryRegistry)
        Constructs a RouteImporter with the given definitionRegistry and factoryRegistry.

        All routes imported with this importer will use these registries. That means that if a route use a type that is unknown to these registries, the action will fail.

        Parameters:
        definitionRegistry - registry for known/supported types (never null)
        factoryRegistry - registry for known/supported component factories (never null)
    • Method Detail

      • doImport

        public RouteInstance doImport​(JsonValue routeJson,
                                      org.forgerock.openig.model.component.Model parent,
                                      String routeId)
        Import the given routeJson into a fully loaded component instance model.
        Parameters:
        routeJson - route JSON to import (never null)
        parent - parent model (never null)
        routeId - route identifier (never null)
        Returns:
        the built route model
        Throws:
        IllegalStateException - in case the route is invalid and cannot be imported into a component model (missing properties, missing references, ...)