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, toStringequals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindChronicle, getAttributes, getChronicle, getDescriptions, getMembers, getNames, getSeries, getSeries, isMemberOf, isTopChroniclegetDatabase, getId, getSurrogate, inConstruction, isValidpublic UpdatableChronicleImpl(Surrogate surrogate)
UpdatableChronicle.surrogate - a surrogatepublic UpdatableChronicle edit()
ChronicleUpdatableChronicle corresponding to this chronicle.
Successfully getting an Updatable object does not imply
that updates can be successfully applied.edit in interface Chronicleedit in class ChronicleImplpublic String getName(boolean full) throws T2DBException
ChroniclegetName in interface ChroniclegetName in class ChronicleImplfull - if true return the full name, else the simple nameT2DBExceptionpublic String getDescription(boolean full) throws T2DBException
ChroniclegetDescription in interface ChroniclegetDescription in class ChronicleImplfull - if true return the full description, else the simple
descriptionT2DBExceptionpublic Attribute<?> getAttribute(String attrName, boolean mustExist) throws T2DBException
ChroniclegetAttribute in interface ChroniclegetAttribute in class ChronicleImplattrName - a stringmustExist - if true throw an exception instead of returning nullT2DBExceptionpublic Chronicle getCollection() throws T2DBException
ChroniclegetCollection in interface ChroniclegetCollection in class ChronicleImplT2DBExceptionpublic Schema getSchema(boolean effective) throws T2DBException
Chronicleeffective 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 ChroniclegetSchema in class ChronicleImpleffective - if true return the first non-null schema along the chronicle chainT2DBExceptionpublic void setName(String name) throws T2DBException
UpdatableChroniclesetName in interface UpdatableChroniclename - a stringT2DBExceptionpublic void setDescription(String description) throws T2DBException
UpdatableChroniclesetDescription in interface UpdatableChronicledescription - a stringT2DBExceptionpublic void setAttribute(Attribute<?> value) throws T2DBException
UpdatableChroniclesetAttribute in interface UpdatableChroniclevalue - an attributeT2DBExceptionpublic void setCollection(Chronicle collection) throws T2DBException
UpdatableChroniclesetCollection in interface UpdatableChroniclecollection - a chronicleT2DBExceptionpublic void setSchema(Schema schema) throws T2DBException
UpdatableChroniclesetSchema in interface UpdatableChronicleschema - a schemaT2DBExceptionpublic <T> Series<T> getSeries(String seriesName) throws T2DBException
ChroniclegetSeries in interface ChroniclegetSeries in class ChronicleImplT - the data type of the underlying time seriesseriesName - the simple name if the seriesT2DBExceptionpublic <T> UpdatableSeries<T> createSeries(String seriesName) throws T2DBException
UpdatableChroniclecreateSeries in interface UpdatableChronicleseriesName - a series name defined in the schemaT2DBExceptionpublic <T> UpdatableSeries<T> updateSeries(String seriesName) throws T2DBException
UpdatableChronicleupdateSeries in interface UpdatableChronicleseriesName - a series name defined in the schemaT2DBExceptionpublic UpdatableChronicle createChronicle(String orig, boolean tweakable, String description, Collection<Attribute<?>> attributes, Schema schema) throws T2DBException
UpdatableChronicleDatabase.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 UpdatableChronicleorig - a nametweakable - if true, the name can be tweaked if requireddescription - a descriptionattributes - a collection of attributesschema - a schema or nullT2DBExceptionpublic void destroy()
throws T2DBException
UpdatableChronicleDBObject.isValid()
will return false.destroy in interface UpdatableChronicleT2DBExceptionpublic void applyUpdates()
throws T2DBException
UpdatableDatabase.commit() and
Database.rollback() is the client's responsibility.applyUpdates in interface UpdatableT2DBExceptionprotected void update()
ChronicleImplupdate in class ChronicleImplpublic void updateAttributes(Collection<Attribute<?>> attributes) throws T2DBException
attributes - a collection of attributesT2DBExceptionCopyright © 2017. All rights reserved.