Package org.bedework.timezones.common
Class AbstractCachedData
java.lang.Object
org.bedework.timezones.common.AbstractCachedData
- All Implemented Interfaces:
Serializable,CachedData,org.bedework.util.logging.Logged
- Direct Known Subclasses:
AbstractDb,FileCachedData,ZipCachedData
public abstract class AbstractCachedData
extends Object
implements org.bedework.util.logging.Logged, CachedData
Abstract class to help simplify implementation
- Author:
- douglm
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractCachedData.AliasMapsprotected TzConfigprotected StringXML formatted UTC dtstamp (i.e.protected Map<ExpandedMapEntryKey,ExpandedMapEntry> protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected net.fortuna.ical4j.model.component.VTimeZoneprotected StringfindAliases(String tzid) Find tz identifiers or alias names that (partially) match the given valueList<org.bedework.util.timezones.model.TimezoneType>findTimezones(String name) Given an alias return the tzid for that aliasgetAliasedCachedVtz(String name) Get an aliased cached VTIMEZONE specificationsgetAliasedXTimeZone(String tzid) Get an aliased timezone object from the server given the id.Get all cached VTIMEZONE specificationsgetCachedVtz(String name) Get cached VTIMEZONE specificationsorg.bedework.util.logging.BwLoggergetStats()net.fortuna.ical4j.model.TimeZonegetTimeZone(String tzid) Get a timezone object from the server given the id.List<org.bedework.util.timezones.model.TimezoneType>getTimezones(String changedSince) List<org.bedework.util.timezones.model.TimezoneType>getTimezones(String[] tzids) getXTimeZone(String tzid) Get a timezone object from the server given the id.protected net.fortuna.ical4j.model.Calendarprotected voidprocessSpec(String id, String caldef, String etag, String storedDtstamp) protected voidprocessSpec(String id, net.fortuna.ical4j.model.Calendar cal, String etag, String storedDtstamp) protected voidresetTzs()voidsetExpanded(ExpandedMapEntryKey key, ExpandedMapEntry tzs) protected net.fortuna.ical4j.model.component.VTimeZonevtzFromCal(net.fortuna.ical4j.model.Calendar cal) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.timezones.common.CachedData
checkData, getSource, stop, updateDataMethods 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
-
msgPrefix
-
dtstamp
XML formatted UTC dtstamp (i.e. separators) for the data -
expansions
-
aliasMaps
-
cfg
-
-
Constructor Details
-
AbstractCachedData
- Parameters:
cfg- our configmsgPrefix- - for messages- Throws:
TzException- on fatal error
-
-
Method Details
-
getStats
- Specified by:
getStatsin interfaceCachedData- Returns:
- stats for the module
- Throws:
TzException- on fatal error
-
findIds
Find tz identifiers or alias names that (partially) match the given value- Parameters:
val- pattern to match- Returns:
- list of strings - never null
- Throws:
TzException- on fatal error
-
getDtstamp
- Specified by:
getDtstampin interfaceCachedData- Returns:
- XML formatted UTC dateTime
- Throws:
TzException- on fatal error
-
fromAlias
Description copied from interface:CachedDataGiven an alias return the tzid for that alias- Specified by:
fromAliasin interfaceCachedData- Parameters:
val- alias- Returns:
- aliased name or null
-
getAliasesStr
- Specified by:
getAliasesStrin interfaceCachedData- Returns:
- String value of aliases file.
-
findAliases
- Specified by:
findAliasesin interfaceCachedData- Parameters:
tzid- for which we want aliases- Returns:
- list of aliases or null
-
getNameList
- Specified by:
getNameListin interfaceCachedData- Returns:
- namelist or null
-
setExpanded
- Specified by:
setExpandedin interfaceCachedData- Parameters:
key- to expanded maptzs- entries from map
-
getExpanded
- Specified by:
getExpandedin interfaceCachedData- Parameters:
key- to expanded map- Returns:
- expanded or null
-
getCachedVtz
Description copied from interface:CachedDataGet cached VTIMEZONE specifications- Specified by:
getCachedVtzin interfaceCachedData- Parameters:
name- tzid- Returns:
- cached spec or null.
-
getAllCachedVtzs
Description copied from interface:CachedDataGet all cached VTIMEZONE specifications- Specified by:
getAllCachedVtzsin interfaceCachedData- Returns:
- cached specs or null.
-
getTimeZone
Description copied from interface:CachedDataGet a timezone object from the server given the id.- Specified by:
getTimeZonein interfaceCachedData- Parameters:
tzid- the id- Returns:
- TimeZone with id or null
-
getXTimeZone
Description copied from interface:CachedDataGet a timezone object from the server given the id.- Specified by:
getXTimeZonein interfaceCachedData- Parameters:
tzid- the id- Returns:
- IcalendarType with id or null
-
getAliasedXTimeZone
Description copied from interface:CachedDataGet an aliased timezone object from the server given the id.- Specified by:
getAliasedXTimeZonein interfaceCachedData- Parameters:
tzid- the id- Returns:
- IcalendarType with id or null
-
getAliasedCachedVtz
Description copied from interface:CachedDataGet an aliased cached VTIMEZONE specifications- Specified by:
getAliasedCachedVtzin interfaceCachedData- Parameters:
name- tzid- Returns:
- cached spec or null.
-
getTimezones
- Specified by:
getTimezonesin interfaceCachedData- Parameters:
tzids- - to fetch- Returns:
- list of summary info
-
getTimezones
- Specified by:
getTimezonesin interfaceCachedData- Parameters:
changedSince- - null or dtstamp value- Returns:
- list of summary info
-
findTimezones
public List<org.bedework.util.timezones.model.TimezoneType> findTimezones(String name) throws TzException - Specified by:
findTimezonesin interfaceCachedData- Parameters:
name- to be partially matched- Returns:
- list of matching summary info
- Throws:
TzException- on fatal error
-
processSpec
- Parameters:
id- of tzcaldef- a tz spec in the form of a String VCALENDAR representationetag- for entrystoredDtstamp- to set last mod
-
processSpec
protected void processSpec(String id, net.fortuna.ical4j.model.Calendar cal, String etag, String storedDtstamp) - Parameters:
id- of tzcal- a tz spec in the form of a CALENDAR componentetag- for entrystoredDtstamp- to set last mod
-
parseDef
-
vtzFromCal
protected net.fortuna.ical4j.model.component.VTimeZone vtzFromCal(net.fortuna.ical4j.model.Calendar cal) -
resetTzs
protected void resetTzs() -
addAlias
protected net.fortuna.ical4j.model.component.VTimeZone addAlias(String alias, net.fortuna.ical4j.model.component.VTimeZone vtz) -
escape
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-