Package org.bedework.timezones.common.db
Class AbstractDb
java.lang.Object
org.bedework.timezones.common.AbstractCachedData
org.bedework.timezones.common.db.AbstractDb
- All Implemented Interfaces:
Serializable,CachedData,org.bedework.util.logging.Logged
- Direct Known Subclasses:
H2dbCachedData
User: mike Date: 6/22/21 Time: 23:07
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected static classprotected classNested classes/interfaces inherited from class org.bedework.timezones.common.AbstractCachedData
AbstractCachedData.AliasMaps -
Field Summary
FieldsFields inherited from class org.bedework.timezones.common.AbstractCachedData
aliasMaps, cfg, dtstamp, expansions, msgPrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddTzAlias(TzAlias val) abstract voidvoidUpdate from primary source if any.protected voidprotected abstract voidclearDb()protected abstract voidclose()protected voidfail()Find tz identifiers or alias names that (partially) match the given valuefindTzAliases(String val) protected abstract AbstractDb.DbIterator<TzAlias>protected abstract TzDbSpecgetStats()abstract TzAliasgetTzAlias(String val) protected abstract AbstractDb.DbIterator<TzDbSpec>protected voidinitData(boolean clear) protected booleanisOpen()protected booleanprotected abstract voidopen()abstract voidputTzAlias(TzAlias val) abstract voidabstract voidremoveTzAlias(TzAlias val) voidstop()Stop any running threads.voidupdateData(String dtstamp, List<Differ.DiffListEntry> dles) Update the stored data using the given update list.Methods inherited from class org.bedework.timezones.common.AbstractCachedData
addAlias, escape, findAliases, findTimezones, fromAlias, getAliasedCachedVtz, getAliasedXTimeZone, getAliasesStr, getAllCachedVtzs, getCachedVtz, getDtstamp, getExpanded, getLogger, getNameList, getTimeZone, getTimezones, getTimezones, getXTimeZone, parseDef, processSpec, processSpec, resetTzs, setExpanded, vtzFromCalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Field Details
-
dbLock
-
open
protected boolean open
-
-
Constructor Details
-
AbstractDb
- Parameters:
cfg- tz configurationmsgPrefix- - for messages- Throws:
TzException- on fatal error
-
-
Method Details
-
initData
- Parameters:
clear- remove all data from db first- Throws:
TzException- on fatal error
-
addTzSpec
- Parameters:
val- the spec- Throws:
TzException- on fatal error
-
putTzSpec
- Parameters:
val- the spec- Throws:
TzException- on fatal error
-
getSpec
- Throws:
TzException
-
addTzAlias
- Parameters:
val- the alias- Throws:
TzException- on fatal error
-
putTzAlias
- Parameters:
val- the alias- Throws:
TzException- on fatal error
-
removeTzAlias
- Parameters:
val- the alias- Throws:
TzException- on fatal error
-
getTzAlias
- Parameters:
val- the alias- Returns:
- alias entry
- Throws:
TzException- on fatal error
-
getAliasIterator
-
getTzSpecIterator
-
open
- Throws:
TzException
-
close
protected abstract void close() -
clearDb
- Throws:
TzException
-
checkData
public void checkData()Description copied from interface:CachedDataUpdate from primary source if any. -
updateData
Description copied from interface:CachedDataUpdate the stored data using the given update list. Note that the update may be transient if the data cache has no or an unchangable backing.- Parameters:
dtstamp- lastmod for changedles- diff list- Throws:
TzException- on fatal error
-
stop
Description copied from interface:CachedDataStop any running threads.- Throws:
TzException- on fatal error
-
getSource
- Returns:
- String source information for data.
- Throws:
TzException- on fatal error
-
getStats
- Specified by:
getStatsin interfaceCachedData- Overrides:
getStatsin classAbstractCachedData- Returns:
- stats for the module
- Throws:
TzException- on fatal error
-
findIds
Description copied from class:AbstractCachedDataFind tz identifiers or alias names that (partially) match the given value- Specified by:
findIdsin classAbstractCachedData- Parameters:
val- pattern to match- Returns:
- list of strings - never null
- Throws:
TzException- on fatal error
-
findTzs
- Parameters:
val- to match- Returns:
- matching tz entry names
- Throws:
TzException- on fatal error
-
findTzAliases
- Parameters:
val- the alias- Returns:
- matching alias entries
- Throws:
TzException- on fatal error
-
fail
protected void fail() -
isOpen
protected boolean isOpen() -
checkOpen
- Throws:
TzException
-
loadInitialData
- Throws:
TzException
-