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 whichRegistryMetadata.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 Modifier and Type Field Description static StringREVISION_COUNT_PROPERTYName of the revision count field.static StringRUNTIME_PROPERTYName of the runtime field.static StringTYPES_PROPERTYName of the types field.static StringVERSION_PROPERTYName of the version field.
-
Constructor Summary
Constructors Constructor Description RegistryModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetRevisionCount()Returns the number of schema writes on the model's types since the last migration.Map<String,String>getTypes()Returns the model's types: as installed from the classpath, or, for the runtime model, as they currently are.StringgetVersion()Returns the model version, as found on the classpath.booleanisRuntime()Returns 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.voidsetTypes(Map<String,String> types)Sets the model's types.voidsetVersion(String version)Sets the model version.
-
-
-
Field Detail
-
VERSION_PROPERTY
public static final String VERSION_PROPERTY
Name of the version field.- See Also:
- Constant Field Values
-
RUNTIME_PROPERTY
public static final String RUNTIME_PROPERTY
Name of the runtime field.- See Also:
- Constant Field Values
-
TYPES_PROPERTY
public static final String TYPES_PROPERTY
Name of the types field.- See Also:
- Constant Field Values
-
REVISION_COUNT_PROPERTY
public static final String REVISION_COUNT_PROPERTY
Name of the revision count field.- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public String getVersion()
Returns the model version, as found on the classpath.- Returns:
- the model version,
nullfor 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:
truefor the runtime model
-
setRuntime
public void setRuntime(boolean runtime)
Sets whether this is the runtime model.- Parameters:
runtime-truefor 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
-
-