Class RegistryModel
java.lang.Object
org.gcube.informationsystem.registry.RegistryModel
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of schema writes on the model's types since the last migration.getTypes()Returns the model's types: as installed from the classpath, or, for the runtime model, as they currently are.Returns the model version, as found on the classpath.booleanReturns whether this is the runtime model, holding the types created through REST.voidsetRevisionCount(long revisionCount) Sets the number of schema writes on the model's types since the last migration.voidsetRuntime(boolean runtime) Sets whether this is the runtime model.voidSets the model's types.voidsetVersion(String version) Sets the model version.
-
Field Details
-
VERSION_PROPERTY
Name of the version field.- See Also:
-
RUNTIME_PROPERTY
Name of the runtime field.- See Also:
-
TYPES_PROPERTY
Name of the types field.- See Also:
-
REVISION_COUNT_PROPERTY
Name of the revision count field.- See Also:
-
-
Constructor Details
-
RegistryModel
public RegistryModel()
-
-
Method Details
-
getVersion
Returns the model version, as found on the classpath.- Returns:
- the model version,
nullfor the runtime model
-
setVersion
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:
truefor the runtime model
-
setRuntime
public void setRuntime(boolean runtime) Sets whether this is the runtime model.- Parameters:
runtime-truefor the runtime model
-
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
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
-