public class UpdatableChronicleImpl extends ChronicleImpl implements UpdatableChronicle
UpdatableChronicle
.ChronicleImpl.RawData
Constructor and Description |
---|
UpdatableChronicleImpl(Surrogate surrogate)
Construct an
UpdatableChronicle . |
Modifier and Type | Method and Description |
---|---|
void |
applyUpdates()
Apply pending updates.
|
UpdatableChronicle |
createChronicle(String orig,
boolean tweakable,
String description,
Collection<Attribute<?>> attributes,
Schema schema)
Return a new chronicle to be created in this chronicle.
|
<T> UpdatableSeries<T> |
createSeries(String seriesName)
Create an empty series with the given name.
|
void |
destroy()
Destroy the chronicle.
|
UpdatableChronicle |
edit()
Return an
UpdatableChronicle corresponding to this chronicle. |
Attribute<?> |
getAttribute(String attrName,
boolean mustExist)
Return the attribute with the given name.
|
Chronicle |
getCollection()
Return the chronicle to which this chronicle belongs.
|
String |
getDescription(boolean full)
Return the description of the chronicle.
|
String |
getName(boolean full)
Return the name of the chronicle.
|
Schema |
getSchema(boolean effective)
Return the chronicle's schema.
|
<T> Series<T> |
getSeries(String seriesName)
Return the series with the given simple name.
|
void |
setAttribute(Attribute<?> value)
Set an attribute.
|
void |
setCollection(Chronicle collection)
Set the collection of the chronicle.
|
void |
setDescription(String description)
Set the description of the chronicle.
|
void |
setName(String name)
Set the name of the chronicle.
|
void |
setSchema(Schema schema)
Set the schema of the chronicle.
|
protected void |
update()
Force refresh of state on next access.
|
void |
updateAttributes(Collection<Attribute<?>> attributes)
Update attribute values.
|
<T> UpdatableSeries<T> |
updateSeries(String seriesName)
Return the updatable series with the given name if it exists.
|
findChronicle, getAttributes, getChronicle, getDescriptions, getMembers, getNames, getSeries, getSeries, isMemberOf, isTopChronicle, toString
equals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findChronicle, getAttributes, getChronicle, getDescriptions, getMembers, getNames, getSeries, getSeries, isMemberOf, isTopChronicle
getDatabase, getId, getSurrogate, inConstruction, isValid
public UpdatableChronicleImpl(Surrogate surrogate)
UpdatableChronicle
.surrogate
- a surrogatepublic UpdatableChronicle edit()
Chronicle
UpdatableChronicle
corresponding to this chronicle.
Successfully getting an Updatable
object does not imply
that updates can be successfully applied.edit
in interface Chronicle
edit
in class ChronicleImpl
public String getName(boolean full) throws T2DBException
Chronicle
getName
in interface Chronicle
getName
in class ChronicleImpl
full
- if true return the full name, else the simple nameT2DBException
public String getDescription(boolean full) throws T2DBException
Chronicle
getDescription
in interface Chronicle
getDescription
in class ChronicleImpl
full
- if true return the full description, else the simple
descriptionT2DBException
public Attribute<?> getAttribute(String attrName, boolean mustExist) throws T2DBException
Chronicle
getAttribute
in interface Chronicle
getAttribute
in class ChronicleImpl
attrName
- a stringmustExist
- if true throw an exception instead of returning nullT2DBException
public Chronicle getCollection() throws T2DBException
Chronicle
getCollection
in interface Chronicle
getCollection
in class ChronicleImpl
T2DBException
public Schema getSchema(boolean effective) throws T2DBException
Chronicle
effective
parameter is true, the schema
returned is the first non-null schema encountered along the chronicle chain.
Also in this case the result can be null.getSchema
in interface Chronicle
getSchema
in class ChronicleImpl
effective
- if true return the first non-null schema along the chronicle chainT2DBException
public void setName(String name) throws T2DBException
UpdatableChronicle
setName
in interface UpdatableChronicle
name
- a stringT2DBException
public void setDescription(String description) throws T2DBException
UpdatableChronicle
setDescription
in interface UpdatableChronicle
description
- a stringT2DBException
public void setAttribute(Attribute<?> value) throws T2DBException
UpdatableChronicle
setAttribute
in interface UpdatableChronicle
value
- an attributeT2DBException
public void setCollection(Chronicle collection) throws T2DBException
UpdatableChronicle
setCollection
in interface UpdatableChronicle
collection
- a chronicleT2DBException
public void setSchema(Schema schema) throws T2DBException
UpdatableChronicle
setSchema
in interface UpdatableChronicle
schema
- a schemaT2DBException
public <T> Series<T> getSeries(String seriesName) throws T2DBException
Chronicle
getSeries
in interface Chronicle
getSeries
in class ChronicleImpl
T
- the data type of the underlying time seriesseriesName
- the simple name if the seriesT2DBException
public <T> UpdatableSeries<T> createSeries(String seriesName) throws T2DBException
UpdatableChronicle
createSeries
in interface UpdatableChronicle
seriesName
- a series name defined in the schemaT2DBException
public <T> UpdatableSeries<T> updateSeries(String seriesName) throws T2DBException
UpdatableChronicle
updateSeries
in interface UpdatableChronicle
seriesName
- a series name defined in the schemaT2DBException
public UpdatableChronicle createChronicle(String orig, boolean tweakable, String description, Collection<Attribute<?>> attributes, Schema schema) throws T2DBException
UpdatableChronicle
Database.getTopChronicle()
.
The name of the chronicle must not be in use within this chronicle. It
may optionally be tweaked to satisfy this requirement (and to obey rules
of the prevailing name syntax). The attributes must be defined in the
schema. If no schema is specified, the schema of this chronicle will
apply. If this chronicle has no schema, then the first schema along the
chronicle chain will apply. On the other hand, if a schema is specified,
it completely overrides any current schema. The schema may not be an
UpdatableSchema
.
The client must execute Updatable.applyUpdates()
on the result.
createChronicle
in interface UpdatableChronicle
orig
- a nametweakable
- if true, the name can be tweaked if requireddescription
- a descriptionattributes
- a collection of attributesschema
- a schema or nullT2DBException
public void destroy() throws T2DBException
UpdatableChronicle
DBObject.isValid()
will return false.destroy
in interface UpdatableChronicle
T2DBException
public void applyUpdates() throws T2DBException
Updatable
Database.commit()
and
Database.rollback()
is the client's responsibility.applyUpdates
in interface Updatable
T2DBException
protected void update()
ChronicleImpl
update
in class ChronicleImpl
public void updateAttributes(Collection<Attribute<?>> attributes) throws T2DBException
attributes
- a collection of attributesT2DBException
Copyright © 2017. All rights reserved.