public interface DatabaseBackend extends Database, PermissionChecker
Database with methods used only in the implementation.
Unless commented otherwise objects needing to be accessed must exist and be accessible
to the user, objects to be created may not already exist, and objects to be
deleted may not have important dependencies.| Modifier and Type | Field and Description |
|---|---|
static String |
BUILTIN_PROP_SPARSITY |
static String |
BUILTIN_PROP_SYMBOL |
static String |
BUILTIN_PROP_TIME_DOMAIN |
static String |
BUILTIN_PROP_TYPE |
static String |
DB_PARAM_Boolean_STRICT_NAME_SPACE
The name of the external parameter specifying whether to prefix full names with the database name.
|
static boolean |
DB_PARAM_Boolean_STRICT_NAME_SPACE_DEFAULT
By default, the database name does not need to be prefixed to full names.
|
static String |
DB_PARAM_Class_ChronicleUpdatePolicyExtension
The name of the external parameter naming the class implementing ChronicleUpdatePolicyExtension.
|
static String |
DB_PARAM_Class_PermissionChecker
The name of the external parameter naming the class implementing PermissionChecker.
|
static String |
DB_PARAM_Float_CACHE_LOAD_FACTOR
The name of the external parameter specifying the cache load factor.
|
static float |
DB_PARAM_Float_CACHE_LOAD_FACTOR_DEFAULT
The default cache load factor.
|
static String |
DB_PARAM_Int_CACHE_SIZE
The name of the external parameter specifying the cache size.
|
static int |
DB_PARAM_Int_CACHE_SIZE_DEFAULT
The default cache size.
|
static int |
MAGIC_NAME_NR
The number for the NAME built-in attribute.
|
static int |
MAGIC_SPARSITY_NR
The number for the SPARSITY boolean built-in attribute.
|
static int |
MAGIC_TIMEDOMAIN_NR
The number for the TIMEDOMAIN built-in attribute.
|
static int |
MAGIC_TYPE_NR
The number for the TYPE built-in attribute.
|
static int |
MAX_MAGIC_NR
The largest reserved number for built-in attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create(UpdatableChronicle chronicle)
Create a chronicle in the database.
|
void |
create(UpdatableProperty<?> property)
Create a property in the database.
|
void |
create(UpdatableSchema schema)
Create a schema in the database.
|
<T> void |
create(UpdatableSeries<T> series)
Create a series in the database.
|
<T> void |
create(UpdatableValueType<T> valueType)
Create a value type in the database.
|
void |
deleteAttributeValue(UpdatableChronicle chronicle,
AttributeDefinition<?> def)
Remove the value and description for an attribute of a chronicle.
|
void |
deleteChronicle(UpdatableChronicle chronicle)
Delete a chronicle from the database.
|
void |
deleteProperty(UpdatableProperty<?> property)
Delete a property from the database.
|
void |
deleteSchema(UpdatableSchema schema)
Delete a schema from the database.
|
<T> void |
deleteSeries(UpdatableSeries<T> series)
Delete a series from the database.
|
<T> boolean |
deleteValue(UpdatableSeries<T> series,
ch.agent.t2.time.TimeIndex t)
Delete a value from a series in the database.
|
void |
deleteValueType(UpdatableValueType<?> valueType)
Delete a value type from the database.
|
Surrogate |
findChronicle(Property<?> property,
Schema schema)
Return a chronicle with an attribute value for the given property and
schema.
|
Surrogate |
findChronicle(Schema schema)
Return a chronicle referencing a given schema.
|
Surrogate |
findChronicle(SeriesDefinition ss,
Schema schema)
Return a chronicle with a series corresponding to the series definition
and with a schema dependent on the given schema.
|
<T> ValueAccessMethods<T> |
getAccessMethods(ValueType<T> valueType)
Return the series access methods object for the given value type.
|
boolean |
getAttributeValue(List<Chronicle> chronicles,
Attribute<?> attribute)
Return true if a value can be found for the attribute in one of
chronicles listed.
|
DatabaseCache |
getCache()
Return the database cache.
|
Chronicle |
getChronicle(Chronicle chronicle)
Get a chronicle from the database.
|
Chronicle |
getChronicleOrNull(Chronicle parent,
String simpleName)
Get the chronicle with the given parent and simple name from the database.
|
<T> List<Chronicle> |
getChroniclesByAttributeValue(Property<T> property,
T value,
int maxSize)
Get a number of chronicles with a given property value from the database.
|
Collection<Chronicle> |
getChroniclesByParent(Chronicle parent)
Get all chronicles with a given parent.
|
ChronicleUpdatePolicy |
getChronicleUpdatePolicy()
Return the chronicle update policy object.
|
<T> ch.agent.t2.timeseries.Observation<T> |
getFirstObservation(Series<T> series,
ch.agent.t2.time.TimeIndex time)
Return the observation at a given time index or the first following
observation.
|
<T> ch.agent.t2.timeseries.Observation<T> |
getLastObservation(Series<T> serie,
ch.agent.t2.time.TimeIndex time)
Return the observation at a given time index or the last preceding
observation.
|
Property<?> |
getProperty(String name)
Get the property with the given name from the database.
|
<T> ch.agent.t2.time.Range |
getRange(Series<T> series)
Return the range of the series.
|
Collection<Surrogate> |
getSchemaSurrogates(String pattern)
Return a collection of schema surrogates with names matching a pattern.
|
SchemaUpdatePolicy |
getSchemaUpdatePolicy()
Return the schema update policy.
|
<T> Series<T>[] |
getSeries(Chronicle chronicle,
String[] names,
int[] numbers)
Get an array of series in a chronicle from the database.
|
UpdatableSchema |
getUpdatableSchema(Schema schema)
Return the updatable schema corresponding to a schema.
|
UpdatableSchema |
getUpdatableSchema(Surrogate surrogate)
Get a schema from the database.
|
<T> long |
getValues(Series<T> series,
ch.agent.t2.time.Range range,
ch.agent.t2.timeseries.TimeAddressable<T> ts)
Load values into the time series in the range specified.
|
boolean |
isBuiltIn(AttributeDefinition<?> def)
Test whether an attribute definition is built-in.
|
boolean |
isStrictNameSpaceMode()
Test if strict name space mode has been configured.
|
DBObjectId |
makeDBObjectId(Object object)
Return a
DBObjectId corresponding to an object. |
<T> void |
setAccessMethods(String valueTypeExternalRepresentation,
ValueAccessMethods<T> accessMethods)
Set the series access methods object for the given value type.
|
void |
setStrictNameSpaceMode(boolean strictNameSpaceMode)
Set strict name space mode.
|
void |
update(UpdatableChronicle chronicle)
Update the name and description of a chronicle.
|
void |
update(UpdatableChronicle chronicle,
AttributeDefinition<?> def,
String value,
String description)
Set the value and description of an attribute of a chronicle.
|
void |
update(UpdatableProperty<?> property)
Modify a property in the database.
|
void |
update(UpdatableSchema schema)
Update a schema in the database.
|
<T> boolean |
update(UpdatableSeries<T> series,
ch.agent.t2.time.Range range)
Reduce the range of a series in the database.
|
<T> long |
update(UpdatableSeries<T> series,
ch.agent.t2.timeseries.TimeAddressable<T> values)
Update a series in the database with values from a time series.
|
void |
update(UpdatableValueType<?> valueType)
Update a value type.
|
clear, close, commit, configure, createProperty, createSchema, createValueType, getChronicle, getChronicle, getMessageListener, getNamingPolicy, getProperties, getProperty, getProperty, getSchema, getSchemas, getSeries, getSeries, getSparsityBuiltInProperty, getSymbolBuiltInProperty, getTimeDomainBuiltInProperty, getTimeDomainCatalog, getTopChronicle, getTypeBuiltInProperty, getUpdatableSchemas, getUpdatableSeries, getUpdateEventPublisher, getValueType, getValueType, getValueTypes, makeSurrogate, open, rollback, setMessageListenercheck, check, check, checkstatic final String BUILTIN_PROP_SYMBOL
static final String BUILTIN_PROP_TIME_DOMAIN
static final String BUILTIN_PROP_TYPE
static final String BUILTIN_PROP_SPARSITY
static final int MAGIC_NAME_NR
static final int MAGIC_TYPE_NR
static final int MAGIC_TIMEDOMAIN_NR
static final int MAGIC_SPARSITY_NR
static final int MAX_MAGIC_NR
static final String DB_PARAM_Int_CACHE_SIZE
static final String DB_PARAM_Float_CACHE_LOAD_FACTOR
static final String DB_PARAM_Boolean_STRICT_NAME_SPACE
isStrictNameSpaceMode(),
Constant Field Valuesstatic final String DB_PARAM_Class_ChronicleUpdatePolicyExtension
static final String DB_PARAM_Class_PermissionChecker
static final int DB_PARAM_Int_CACHE_SIZE_DEFAULT
static final float DB_PARAM_Float_CACHE_LOAD_FACTOR_DEFAULT
static final boolean DB_PARAM_Boolean_STRICT_NAME_SPACE_DEFAULT
boolean isStrictNameSpaceMode()
void setStrictNameSpaceMode(boolean strictNameSpaceMode)
strictNameSpaceMode - if true set strict name space mode<T> ValueAccessMethods<T> getAccessMethods(ValueType<T> valueType)
valueType - a value type<T> void setAccessMethods(String valueTypeExternalRepresentation, ValueAccessMethods<T> accessMethods)
Value types are identified using ValueType.getExternalRepresentation().
valueTypeExternalRepresentation - a string used as external representation of value typeaccessMethods - an access methods objectboolean isBuiltIn(AttributeDefinition<?> def)
def - an attribute definitionDatabaseCache getCache()
ChronicleUpdatePolicy getChronicleUpdatePolicy()
SchemaUpdatePolicy getSchemaUpdatePolicy()
DBObjectId makeDBObjectId(Object object) throws T2DBException
DBObjectId corresponding to an object. The actual form
of the input depends on the current database driver.object - an objectT2DBExceptionProperty<?> getProperty(String name) throws T2DBException
name - a stringT2DBExceptionvoid create(UpdatableProperty<?> property) throws T2DBException
property - a propertyT2DBExceptionvoid deleteProperty(UpdatableProperty<?> property) throws T2DBException
property - a propertyT2DBExceptionvoid update(UpdatableProperty<?> property) throws T2DBException
property - a propertyT2DBException<T> void create(UpdatableValueType<T> valueType) throws T2DBException
valueType - a value typeT2DBExceptionvoid deleteValueType(UpdatableValueType<?> valueType) throws T2DBException
valueType - a value typeT2DBExceptionvoid update(UpdatableValueType<?> valueType) throws T2DBException
valueType - a value typeT2DBExceptionvoid create(UpdatableChronicle chronicle) throws T2DBException
chronicle - a chronicleT2DBExceptionvoid deleteAttributeValue(UpdatableChronicle chronicle, AttributeDefinition<?> def) throws T2DBException
chronicle - a chronicledef - an attribute definitionT2DBExceptionvoid update(UpdatableChronicle chronicle, AttributeDefinition<?> def, String value, String description) throws T2DBException
ValueType.toString(Object).chronicle - a chronicledef - an attribute definitionvalue - a stringdescription - a stringT2DBExceptionvoid update(UpdatableChronicle chronicle) throws T2DBException
chronicle - a chronicleT2DBExceptionvoid deleteChronicle(UpdatableChronicle chronicle) throws T2DBException
chronicle - T2DBExceptionChronicle getChronicle(Chronicle chronicle) throws T2DBException
chronicle - a chronicleT2DBExceptionChronicle getChronicleOrNull(Chronicle parent, String simpleName) throws T2DBException
parent - a chroniclesimpleName - a simple nameT2DBExceptionCollection<Chronicle> getChroniclesByParent(Chronicle parent) throws T2DBException
parent - a chronicleT2DBException<T> List<Chronicle> getChroniclesByAttributeValue(Property<T> property, T value, int maxSize) throws T2DBException
property - a propertyvalue - a valuemaxSize - the maximum size of the resultT2DBException<T> Series<T>[] getSeries(Chronicle chronicle, String[] names, int[] numbers) throws T2DBException
chronicle - a chroniclenames - an array of namesnumbers - an array of numbersT2DBExceptionboolean getAttributeValue(List<Chronicle> chronicles, Attribute<?> attribute) throws T2DBException
chronicles - a list of chroniclesattribute - an attributeT2DBException<T> long getValues(Series<T> series, ch.agent.t2.time.Range range, ch.agent.t2.timeseries.TimeAddressable<T> ts) throws T2DBException
series - a seriesrange - a range or nullts - a time seriesT2DBException<T> ch.agent.t2.timeseries.Observation<T> getFirstObservation(Series<T> series, ch.agent.t2.time.TimeIndex time) throws T2DBException
time - a time indexT2DBException<T> ch.agent.t2.timeseries.Observation<T> getLastObservation(Series<T> serie, ch.agent.t2.time.TimeIndex time) throws T2DBException
time - a time indexT2DBException<T> ch.agent.t2.time.Range getRange(Series<T> series) throws T2DBException
series - a seriesT2DBException<T> void create(UpdatableSeries<T> series) throws T2DBException
series - a seriesT2DBException<T> long update(UpdatableSeries<T> series, ch.agent.t2.timeseries.TimeAddressable<T> values) throws T2DBException
series - a seriesvalues - a time series of valuesT2DBException<T> boolean update(UpdatableSeries<T> series, ch.agent.t2.time.Range range) throws T2DBException
series - a seriesrange - a rangeT2DBException<T> boolean deleteValue(UpdatableSeries<T> series, ch.agent.t2.time.TimeIndex t) throws T2DBException
series - a seriest - a time indexT2DBException<T> void deleteSeries(UpdatableSeries<T> series) throws T2DBException
series - a seriesT2DBExceptionvoid create(UpdatableSchema schema) throws T2DBException
schema - a schemaT2DBExceptionvoid update(UpdatableSchema schema) throws T2DBException
schema - a schemaT2DBExceptionvoid deleteSchema(UpdatableSchema schema) throws T2DBException
schema - a schemaT2DBExceptionUpdatableSchema getUpdatableSchema(Surrogate surrogate) throws T2DBException
surrogate - a schema's surrogateT2DBExceptionCollection<Surrogate> getSchemaSurrogates(String pattern) throws T2DBException
pattern - a simple pattern where "*" stands for zero or more charactersT2DBExceptionUpdatableSchema getUpdatableSchema(Schema schema) throws T2DBException
schema - a schemaT2DBExceptionSurrogate findChronicle(Schema schema) throws T2DBException
This is technical method used in schema management.
schema - a schemaT2DBExceptionSurrogate findChronicle(Property<?> property, Schema schema) throws T2DBException
This is technical method used in schema management.
property - a propertyschema - a schemaT2DBExceptionSurrogate findChronicle(SeriesDefinition ss, Schema schema) throws T2DBException
This is technical method used in schema management.
ss - a series definitionschema - a schemaT2DBExceptionCopyright © 2017. All rights reserved.