Class StatisticsConfigurationStore
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.statistics.StatisticsConfigurationStore
The configuration of the public statistics, one record of the class
"StatisticsConfiguration" in the database of the registry, read at every computation so that
a change shows at the next one, with no restart: today the label of each depth of the Context
tree, in a long form ("depthLabels", depth → label) and a short one
("depthShortLabels"). The database migration creates the class and the record
with the default labels (
ensure(ODatabaseDocument)); an operator changes them with
UPDATE StatisticsConfiguration SET depthLabels = {"1": "...", ...}, depthShortLabels = {"1": "...", ...} WHERE id = "statistics".- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe class of the record.static final StringThe id of the one record.The long labels the migration writes, the levels of a D4Science infrastructure.The short labels the migration writes.static final StringThe property holding the long label of each depth.static final StringThe property holding the short label of each depth.static final StringThe property identifying the record. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReads the long label of each depth.Reads the short label of each depth.voidensure(com.orientechnologies.orient.core.db.document.ODatabaseDocument session) Creates the class and the record when they are missing, and gives the record the default labels of each property it does not have.
-
Field Details
-
CONFIGURATION_CLASS
The class of the record.- See Also:
-
ID_PROPERTY
The property identifying the record.- See Also:
-
CONFIGURATION_ID
The id of the one record.- See Also:
-
DEPTH_LABELS_PROPERTY
The property holding the long label of each depth.- See Also:
-
DEPTH_SHORT_LABELS_PROPERTY
The property holding the short label of each depth.- See Also:
-
DEFAULT_DEPTH_LABELS
The long labels the migration writes, the levels of a D4Science infrastructure. -
DEFAULT_DEPTH_SHORT_LABELS
The short labels the migration writes.
-
-
Constructor Details
-
StatisticsConfigurationStore
public StatisticsConfigurationStore()
-
-
Method Details
-
ensure
public void ensure(com.orientechnologies.orient.core.db.document.ODatabaseDocument session) Creates the class and the record when they are missing, and gives the record the default labels of each property it does not have. Labels already in the record are kept, so running it again changes nothing.- Parameters:
session- an administrative session able to change the schema
-
depthLabels
public Map<String,String> depthLabels() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReads the long label of each depth.- Returns:
- the labels, depth (as text) → label; empty when the record or the property is missing
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the database cannot be read
-
depthShortLabels
public Map<String,String> depthShortLabels() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReads the short label of each depth.- Returns:
- the labels, depth (as text) → label; empty when the record or the property is missing
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the database cannot be read
-