Class RegistryModel

java.lang.Object
org.gcube.informationsystem.registry.RegistryModel

public class RegistryModel extends Object
A model of a registry: information-system-model, the domain model installed from the classpath, or the runtime model holding the types created through REST. Its name is the key under which RegistryMetadata.getModels() holds it.

Unknown fields are ignored, so that a reader built on an older version still reads what a newer one writes.

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

  • Constructor Details

    • RegistryModel

      public RegistryModel()
  • Method Details

    • getVersion

      public String getVersion()
      Returns the model version, as found on the classpath.
      Returns:
      the model version, null for the runtime model
    • setVersion

      public void setVersion(String version)
      Sets the model version.
      Parameters:
      version - the model version
    • isRuntime

      public boolean isRuntime()
      Returns whether this is the runtime model, holding the types created through REST.
      Returns:
      true for the runtime model
    • setRuntime

      public void setRuntime(boolean runtime)
      Sets whether this is the runtime model.
      Parameters:
      runtime - true for the runtime model
    • getTypes

      public Map<String,String> getTypes()
      Returns the model's types: as installed from the classpath, or, for the runtime model, as they currently are.
      Returns:
      the type versions keyed by type name
    • setTypes

      public void setTypes(Map<String,String> types)
      Sets the model's types.
      Parameters:
      types - the type versions keyed by type name
    • getRevisionCount

      public long getRevisionCount()
      Returns the number of schema writes on the model's types since the last migration.
      Returns:
      the revision count
    • setRevisionCount

      public void setRevisionCount(long revisionCount)
      Sets the number of schema writes on the model's types since the last migration.
      Parameters:
      revisionCount - the revision count