java.lang.Object
org.gcube.informationsystem.resourceregistry.dbinitialization.IsModelBootstrap

public class IsModelBootstrap extends Object
Owns the explicit, order-dependent bootstrap sequence for the small set of information-system-model-intrinsic types that must exist before the general classpath Discovery pass can run — because later infrastructure types embed them as a nested property type or declare them as a superclass before their own schema can be registered — plus the shared logic to determine which Type names are is-model-intrinsic at all.

Used both by DatabaseEnvironment's bootstrap (to actually create these types) and by System Dump/Restore (to recognize types that belong to whichever information-system-model version a target is running, never to a dump produced by a possibly different source version).

Author:
Luca Frosini (ISTI - CNR)
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    bootstrap(boolean discoverAllRegistrationProviders)
    Creates the explicit, order-dependent schema classes and type-definition documents for information-system-model's own intrinsic types, then runs the general classpath Discovery pass (registering every remaining is-model type, plus any external RegistrationProvider contribution when discoverAllRegistrationProviders is true).
    static Set<String>
    Returns the set of Type names that information-system-model registers intrinsically: the explicit bootstrap sequence above, plus every type found by the same classpath Discovery pass restricted to is-model's own intrinsic packages (never external RegistrationProvider contributions, regardless of the running environment's own discoverAllRegistrationProviders setting).
    static Map<String,String>
    Returns the version of every Type information-system-model installs from the classpath, keyed by name: the types of discoverIntrinsicTypeNames(), except ChildOf, an internal edge with no place in the Type catalog.
    static boolean
    Returns whether typeName is one of the types information-system-model registers intrinsically, as opposed to one contributed by a domain model on the classpath (e.g.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isIntrinsicType

      public static boolean isIntrinsicType(String typeName) throws Exception
      Returns whether typeName is one of the types information-system-model registers intrinsically, as opposed to one contributed by a domain model on the classpath (e.g. gcube-model) or registered dynamically through the REST API.

      This is the authoritative signal behind a Type's locked flag. It is deliberately not derived from RegistryMetadata.runtimeTypes, which only distinguishes REST-created types from classpath-created ones and therefore cannot tell information-system-model's own types apart from a domain model's — see this track's decision log.

      Parameters:
      typeName - the Type name to classify
      Returns:
      true if the name is is-model-intrinsic, false otherwise
      Throws:
      Exception - if the discovery scan fails
    • bootstrap

      public static void bootstrap(boolean discoverAllRegistrationProviders) throws Exception
      Creates the explicit, order-dependent schema classes and type-definition documents for information-system-model's own intrinsic types, then runs the general classpath Discovery pass (registering every remaining is-model type, plus any external RegistrationProvider contribution when discoverAllRegistrationProviders is true).
      Parameters:
      discoverAllRegistrationProviders - whether to also scan external RegistrationProvider SPI contributions (e.g. gcube-model), in addition to is-model's own intrinsic packages
      Throws:
      Exception - if the model identity cannot be resolved, or any explicit schema/definition creation or the Discovery pass fails
    • discoverIntrinsicTypeNames

      public static Set<String> discoverIntrinsicTypeNames() throws Exception
      Returns the set of Type names that information-system-model registers intrinsically: the explicit bootstrap sequence above, plus every type found by the same classpath Discovery pass restricted to is-model's own intrinsic packages (never external RegistrationProvider contributions, regardless of the running environment's own discoverAllRegistrationProviders setting). Used by System Dump/Restore to recognize types that belong to whichever information-system-model version a target is running, never to a dump produced by a possibly different source version.
      Returns:
      the set of is-model-intrinsic Type names
      Throws:
      Exception - if the discovery scan fails
    • discoverIntrinsicTypeVersions

      public static Map<String,String> discoverIntrinsicTypeVersions() throws Exception
      Returns the version of every Type information-system-model installs from the classpath, keyed by name: the types of discoverIntrinsicTypeNames(), except ChildOf, an internal edge with no place in the Type catalog.
      Returns:
      the type versions keyed by type name
      Throws:
      Exception - if the discovery scan fails