Package org.bedework.timezones.common
Class TzServerUtil
java.lang.Object
org.bedework.timezones.common.TzServerUtil
Common code for the timezone service.
- Author:
- Mike Douglass
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringUnable to retrieve the datastatic longTime we last fetched the data -
Method Summary
Modifier and TypeMethodDescriptioncompareData(String tzdataUrl) Compare data pointed to by tzdataUrl with the given data.convertDateTime(String dateTime, String fromTzid, String toTzid) Convert from local time in fromTzid to local time in toTzid.net.fortuna.ical4j.model.TimeZonefetchTimeZone(String tzid) Get a timezone object from the server given the id.findAliases(String tzid) List<org.bedework.util.timezones.model.TimezoneType>findTimezones(String name) static voidCause data to be checked against primarystatic voidfireRefresh(boolean clear) Cause a refresh of the datagetAliasedTz(String name) static Stringstatic Stringstatic Stringstatic CachedDatagetDataSource(TzConfig config) getEtag()getExpanded(String tzid, String start, String end, boolean oldForm) static TzServerUtilgetNames()getStats()List<org.bedework.util.timezones.model.TimezoneType>getTimezones(String changedSince) List<org.bedework.util.timezones.model.TimezoneType>getTimezones(String[] tzids) static TzConfigstatic StringprintableTime(long millis) static voidstatic voidstatic voidsetTzConfigHolder(org.bedework.util.jmx.ConfigHolder<TzConfigImpl> val) voidstop()Stop any running threads.updateData(String tzdataUrl) Compare data pointed to by tzdataUrl with the given data then update.
-
Field Details
-
errorNodata
Unable to retrieve the data- See Also:
-
lastDataFetch
public static long lastDataFetchTime we last fetched the data
-
-
Method Details
-
getInstance
- Returns:
- a singleton instance
-
getAppname
- Returns:
- appname
-
setTzConfigHolder
- Parameters:
val- config holder
-
getTzConfig
- Returns:
- current state of the configuration
-
saveConfig
public static void saveConfig() -
printableTime
- Parameters:
millis- long- Returns:
- String minutes:seconds
-
fireRefresh
Cause a refresh of the data- Throws:
TzException- on fatal error
-
setProdid
- Parameters:
val- prodid for generated calendar data
-
fireCheck
Cause data to be checked against primary- Throws:
TzException- on fatal error
-
updateData
Compare data pointed to by tzdataUrl with the given data then update.- Parameters:
tzdataUrl- - references source- Returns:
- info lines.
- Throws:
TzException- on fatal error
-
compareData
Compare data pointed to by tzdataUrl with the given data.- Parameters:
tzdataUrl- - reference to data- Returns:
- info lines.
- Throws:
TzException- on fatal error
-
getDataSource
- Throws:
TzException
-
getStats
- Returns:
- stats for the service
- Throws:
TzException- on fatal error
-
stop
Stop any running threads.- Throws:
TzException- on fatal error
-
getDtstamp
- Returns:
- the data dtstamp
- Throws:
TzException- on fatal error
-
getNames
- Returns:
- names from the zip file.
- Throws:
TzException- on fatal error
-
getTz
- Parameters:
name- of tz- Returns:
- spec
- Throws:
TzException- on fatal error
-
getAllTzs
- Returns:
- all specs
- Throws:
TzException- on fatal error
-
getAliasedTz
- Parameters:
name- alias- Returns:
- spec
- Throws:
TzException- on fatal error
-
getAliasesStr
- Returns:
- String value of aliases file.
- Throws:
TzException- on fatal error
-
findAliases
- Parameters:
tzid- timezone id- Returns:
- list of aliases or null
- Throws:
TzException- on fatal error
-
getUtc
- Parameters:
time- to convert to UTCtzid- timezone id- Returns:
- String utc date
- Throws:
Throwable- on date error
-
convertDateTime
Convert from local time in fromTzid to local time in toTzid. If dateTime is already an iso utc date time fromTzid may be null.- Parameters:
dateTime- local timefromTzid- tz converting fromtoTzid- tz converting to- Returns:
- String time in given timezone
- Throws:
Throwable- on date error
-
getTimezones
public List<org.bedework.util.timezones.model.TimezoneType> getTimezones(String[] tzids) throws TzException - Parameters:
tzids- - to fetch- Returns:
- list of summary info
- Throws:
TzException- on fatal error
-
getTimezones
public List<org.bedework.util.timezones.model.TimezoneType> getTimezones(String changedSince) throws TzException - Parameters:
changedSince- - null or dtstamp value- Returns:
- list of summary info
- Throws:
TzException- on fatal error
-
findTimezones
public List<org.bedework.util.timezones.model.TimezoneType> findTimezones(String name) throws TzException - Parameters:
name- - non null name for partial match- Returns:
- list of summary info
- Throws:
TzException- on fatal error
-
getExpanded
public ExpandedMapEntry getExpanded(String tzid, String start, String end, boolean oldForm) throws Throwable - Parameters:
tzid- for expansionstart- of rangeend- of range- Returns:
- expansion or null
- Throws:
TzException- on fatal errorThrowable
-
fetchTimeZone
Get a timezone object from the server given the id.- Parameters:
tzid- to fetch- Returns:
- TimeZone with id or null
- Throws:
TzException- on fatal error
-
getCalHdr
- Returns:
- an ical Calendar prefix
-
getCalTlr
- Returns:
- an ical Calendar trailer
-
getEtag
- Returns:
- an etag based on when we refreshed data
- Throws:
TzException- on fatal error
-