Class RegistryMetadata
- java.lang.Object
-
- org.gcube.informationsystem.registry.RegistryMetadata
-
public class RegistryMetadata extends Object
A registry's record of the models it holds. Every type belongs to exactly one of them:information-system-model, the domain model installed from the classpath, or the runtime model holding the types created through REST. Each counts the schema writes on its types since the last migration, next to a global count of every schema write. It is not a modelElement: it describes a registry, not the information it holds. A System Dump carries it, so that the dump can be read with this model alone.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 StringMODELS_PROPERTYName of the models field.static StringNAMEThe name of the record, as stored.static StringREVISION_COUNT_PROPERTYName of the revision count field.
-
Constructor Summary
Constructors Constructor Description RegistryMetadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,RegistryModel>getModels()Returns the models of the registry, keyed by model name.longgetRevisionCount()Returns the number of schema writes since the last migration, whatever the model: the schema version the type caches are keyed on.voidsetModels(Map<String,RegistryModel> models)Sets the models of the registry.voidsetRevisionCount(long revisionCount)Sets the number of schema writes since the last migration.
-
-
-
Field Detail
-
NAME
public static final String NAME
The name of the record, as stored.- See Also:
- Constant Field Values
-
MODELS_PROPERTY
public static final String MODELS_PROPERTY
Name of the models 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
-
getModels
public Map<String,RegistryModel> getModels()
Returns the models of the registry, keyed by model name.- Returns:
- the models keyed by name
-
setModels
public void setModels(Map<String,RegistryModel> models)
Sets the models of the registry.- Parameters:
models- the models keyed by name
-
getRevisionCount
public long getRevisionCount()
Returns the number of schema writes since the last migration, whatever the model: the schema version the type caches are keyed on.- Returns:
- the revision count
-
setRevisionCount
public void setRevisionCount(long revisionCount)
Sets the number of schema writes since the last migration.- Parameters:
revisionCount- the revision count
-
-