Class IsModelBootstrap
java.lang.Object
org.gcube.informationsystem.resourceregistry.dbinitialization.IsModelBootstrap
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 TypeMethodDescriptionstatic voidbootstrap(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 externalRegistrationProvidercontribution whendiscoverAllRegistrationProvidersistrue).Returns the set of Type names thatinformation-system-modelregisters 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 externalRegistrationProvidercontributions, regardless of the running environment's owndiscoverAllRegistrationProviderssetting).Returns the version of every Typeinformation-system-modelinstalls from the classpath, keyed by name: the types ofdiscoverIntrinsicTypeNames(), exceptChildOf, an internal edge with no place in the Type catalog.static booleanisIntrinsicType(String typeName) Returns whethertypeNameis one of the typesinformation-system-modelregisters intrinsically, as opposed to one contributed by a domain model on the classpath (e.g.
-
Method Details
-
isIntrinsicType
Returns whethertypeNameis one of the typesinformation-system-modelregisters 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
lockedflag. It is deliberately not derived fromRegistryMetadata.runtimeTypes, which only distinguishes REST-created types from classpath-created ones and therefore cannot tellinformation-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:
trueif the name is is-model-intrinsic,falseotherwise- Throws:
Exception- if the discovery scan fails
-
bootstrap
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 externalRegistrationProvidercontribution whendiscoverAllRegistrationProvidersistrue).- 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
Returns the set of Type names thatinformation-system-modelregisters 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 externalRegistrationProvidercontributions, regardless of the running environment's owndiscoverAllRegistrationProviderssetting). 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
Returns the version of every Typeinformation-system-modelinstalls from the classpath, keyed by name: the types ofdiscoverIntrinsicTypeNames(), exceptChildOf, 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
-