Interface TraceObjectManager
- All Known Implementing Classes:
DBTraceObjectManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Delete the entire object model, including the schemacreateObject(KeyPath path) Create (or get) an object with the given canonical pathcreateRootObject(TraceObjectSchema schema) Creates the root object of the model, fixing its schemavoidFor maintenance, remove all disconnected objectsStream<? extends TraceObject> Get all the objects in the databaseStream<? extends TraceObjectValue> Get all the values (edges) in the databaseGet objects in the database having the given canonical pathgetObjectById(long key) Get the object with the given database key, if it existsintGet the number of objects in the databaseStream<? extends TraceObject> getObjectsByPath(Lifespan span, KeyPath path) Get objects in the database having the given path intersecting the given spanGet the root object, if it has been createdGet the schema of the root objectgetTrace()Get the trace to which the object manager belongsStream<? extends TraceObjectValPath> getValuePaths(Lifespan span, PathFilter predicates) Get value entries in the database matching the given predicates intersecting the given spandefault Collection<? extends TraceObjectValue> getValuesIntersecting(Lifespan span, AddressRange range) Get all address-ranged values intersecting the given span and address rangeCollection<? extends TraceObjectValue> getValuesIntersecting(Lifespan span, AddressRange range, String entryKey) Get all address-ranged values intersecting the given span and address range<I extends TraceObjectInterface>
Stream<I> queryAllInterface(Lifespan span, Class<I> iface) Get all interfaces of the given type in the databaseGet the schema of the root object, failing if no root object exists
-
Method Details
-
getTrace
Trace getTrace()Get the trace to which the object manager belongs- Returns:
- the trace
-
createRootObject
Creates the root object of the model, fixing its schemaNote the schema cannot be changed once the root object is created. The only means to "change" the schema is to delete the root object (and thus the entire tree) then re-create the root object with the new schema.
- Parameters:
schema- the schema- Returns:
- the new object
-
createObject
Create (or get) an object with the given canonical path- Parameters:
path- the object's canonical path- Returns:
- the new object
-
getRootSchema
TraceObjectSchema getRootSchema()Get the schema of the root object- Returns:
- the schema or null
-
requireRootSchema
TraceObjectSchema requireRootSchema()Get the schema of the root object, failing if no root object exists- Returns:
- the schema
-
getRootObject
TraceObject getRootObject()Get the root object, if it has been created- Returns:
- the root object, or null
-
getObjectById
Get the object with the given database key, if it exists- Parameters:
key- the desired object's key- Returns:
- the object, or null
-
getObjectByCanonicalPath
Get objects in the database having the given canonical path- Parameters:
path- the canonical path of the desired objects- Returns:
- the collection of objects
-
getObjectsByPath
Get objects in the database having the given path intersecting the given span- Parameters:
span- the span that desired objects' lifespans must intersectpath- the path of the desired objects- Returns:
- the iterable of objects
-
getValuePaths
Get value entries in the database matching the given predicates intersecting the given spanWhile the manager does not maintain integrity wrt. child lifespans and that of their parents, nor even the connectivity of objects to their canonical parents, this search depends on that consistency. An object may not be discovered unless it is properly connected to the root object. Furthermore, it will not be discovered unless it and its ancestors' lifespans all intersect the given span.
- Parameters:
span- the span that desired objects' lifespans must intersectpredicates- predicates to match the desired objects- Returns:
- an iterator over the matching objects
-
getAllObjects
Stream<? extends TraceObject> getAllObjects()Get all the objects in the database- Returns:
- the stream of all objects
-
getObjectCount
int getObjectCount()Get the number of objects in the database- Returns:
- the number of objects
-
getAllValues
Stream<? extends TraceObjectValue> getAllValues()Get all the values (edges) in the database- Returns:
- the stream of all values
-
getValuesIntersecting
Collection<? extends TraceObjectValue> getValuesIntersecting(Lifespan span, AddressRange range, String entryKey) Get all address-ranged values intersecting the given span and address range- Parameters:
span- the span that desired values lifespans must intersectrange- the range that desired address-ranged values must intersectentryKey- the entry key if a single one should be matched, or null for any- Returns:
- the collection of values
-
getValuesIntersecting
default Collection<? extends TraceObjectValue> getValuesIntersecting(Lifespan span, AddressRange range) Get all address-ranged values intersecting the given span and address range- Parameters:
span- the span that desired values lifespans must intersectrange- the range that desired address-ranged values must intersect- Returns:
- the collection of values
-
queryAllInterface
Get all interfaces of the given type in the database- Type Parameters:
I- the type of the desired interface- Parameters:
span- the span that desired objects must intersectiface- the class of the desired interface- Returns:
- the collection of all instances of the given interface
-
cullDisconnectedObjects
void cullDisconnectedObjects()For maintenance, remove all disconnected objectsAn object is disconnected if it is neither the child nor parent of any value for any span. In other words, it's unused.
-
clear
void clear()Delete the entire object model, including the schemaThis is the only mechanism to modify the schema. This should almost never be necessary, because a connector should provide its immutable schema immediately. Nevertheless, the database permits schema modification, but requires that the entire model be replaced.
-