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

public class ModelIdentityResolver extends Object
Resolves the models of the registry besides information-system-model: the single place where they are decided, wherever RegistryMetadata is (re)computed.

The domain model is the domain RegistrationProvider (any provider other than is-model's), considered only when discoverAllRegistrationProviders is true, i.e. when its types are installed from the classpath. The runtime model, holding the types created through REST, is named by config.ini's runtimeModelName, "Runtime Types" when absent.

Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • DEFAULT_RUNTIME_MODEL_NAME

      public static final String DEFAULT_RUNTIME_MODEL_NAME
      Name of the runtime model when config.ini does not set one.
      See Also:
  • Constructor Details

    • ModelIdentityResolver

      public ModelIdentityResolver()
      Creates a resolver reading config.ini and the classpath RegistrationProviders.
  • Method Details

    • resolveDomainProvider

      public org.gcube.informationsystem.discovery.RegistrationProvider resolveDomainProvider()
      Returns the domain RegistrationProvider, if any.
      Returns:
      the domain provider, or null when none is considered
      Throws:
      IllegalStateException - if more than one domain RegistrationProvider is considered, since a registry holds at most one domain model
    • resolveRuntimeModelName

      public String resolveRuntimeModelName()
      Returns the name of the runtime model.
      Returns:
      the configured name, or "Runtime Types"
      Throws:
      IllegalStateException - if the name is is-model's or the domain model's, or more than one domain model is on the classpath