ZoneRulesProvider implementation for included timezone definitions. To avoid conflicting with
the standard Java zone rules this provider maintains an internal map of local zone ids to globally unique ids.
Note
Globally unique zone identifiers are transient and will be regenerated for each instance of this class. They are only used to support registration and use of alternative definitions in the scope of this library.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final Logger | |
| private final TimeZoneLoader | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | provideRefresh()
Overrides java. SPI method to refresh the rules from the underlying data provider. |
| protected ZoneRules | provideRules(String
the zone ID as defined by zoneId, boolean ZoneId, not nullwhether the rules are being queried for caching,
true if the returned rules will be cached by forCaching)ZoneId,
false if they will be returned to the user without being cached in ZoneIdImplements abstract java. SPI method to get the rules for the zone ID.
This loads the rules for the specified zone ID.
The provider implementation must validate that the zone ID is valid and
available, throwing a |
| protected NavigableMap | provideVersions(String
the zone ID as defined by zoneId)ZoneId, not nullImplements abstract java. SPI method to get the history of rules for the zone ID. This returns a map of historical rules keyed by a version string. |
| protected Set | provideZoneIds()
Implements abstract java. SPI method to get the available zone IDs. |
| DEFAULT_RESOURCE_PREFIX | back to summary |
|---|---|
| private static final String DEFAULT_RESOURCE_PREFIX | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| zoneLoader | back to summary |
|---|---|
| private final TimeZoneLoader zoneLoader | |
| zoneRulesMap | back to summary |
|---|---|
| private final Map<String, ZoneRules> zoneRulesMap | |
| DefaultZoneRulesProvider | back to summary |
|---|---|
| public DefaultZoneRulesProvider() | |
| DefaultZoneRulesProvider | back to summary |
|---|---|
| public DefaultZoneRulesProvider(TimeZoneLoader timeZoneLoader, Map<String, String> zoneIdMap) | |
| provideRefresh | back to summary |
|---|---|
| protected boolean provideRefresh() Overrides java. Doc from java. SPI method to refresh the rules from the underlying data provider. This method provides the opportunity for a provider to dynamically recheck the underlying data provider to find the latest rules. This could be used to load new rules without stopping the JVM. Dynamic behavior is entirely optional and most providers do not support it. This implementation returns false.
| |
| provideRules | back to summary |
|---|---|
| protected ZoneRules provideRules(String zoneId, boolean forCaching) Implements abstract java. Doc from java. SPI method to get the rules for the zone ID.
This loads the rules for the specified zone ID.
The provider implementation must validate that the zone ID is valid and
available, throwing a If the provider implementation is not dynamic, then the result of the method must be the non-null set of rules selected by the ID.
If the provider implementation is dynamic, then the flag gives the option
of preventing the returned rules from being cached in
| |
| provideVersions | back to summary |
|---|---|
| protected NavigableMap Implements abstract java. Doc from java. SPI method to get the history of rules for the zone ID. This returns a map of historical rules keyed by a version string. The exact meaning and format of the version is provider specific. The version must follow lexicographical order, thus the returned map will be order from the oldest known rules to the newest available rules. The default 'TZDB' group uses version numbering consisting of the year followed by a letter, such as '2009e' or '2012f'. Implementations must provide a result for each valid zone ID, however they do not have to provide a history of rules. Thus the map will contain at least one element, and will only contain more than one element if historical rule information is available. The returned versions remain available and valid for the lifetime of the application. A dynamic provider may increase the set of versions as more data becomes available.
| |
| provideZoneIds | back to summary |
|---|---|
| protected Set Implements abstract java. Doc from java. SPI method to get the available zone IDs.
This obtains the IDs that this The returned zone IDs remain available and valid for the lifetime of the application. A dynamic provider may increase the set of IDs as more data becomes available. | |