Class/Object

org.threeten.bp.zone

ZoneRulesProvider

Related Docs: object ZoneRulesProvider | package zone

Permalink

abstract class ZoneRulesProvider extends AnyRef

Provider of time-zone rules to the system.

This class manages the configuration of time-zone rules. The static methods provide the public API that can be used to manage the providers. The abstract methods provide the SPI that allows rules to be provided.

Rules are looked up primarily by zone ID, as used by ZoneId. Only zone region IDs may be used, zone offset IDs are not used here.

Time-zone rules are political, thus the data can change at any time. Each provider will provide the latest rules for each zone ID, but they may also provide the history of how the rules changed.

Specification for implementors

This interface is a service provider that can be called by multiple threads. Implementations must be immutable and thread-safe.

Providers must ensure that once a rule has been seen by the application, the rule must continue to be available.

Many systems would like to update time-zone rules dynamically without stopping the JVM. When examined in detail, this is a complex problem. Providers may choose to handle dynamic updates, however the default provider does not.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZoneRulesProvider
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ZoneRulesProvider()

    Permalink
    Attributes
    protected

Abstract Value Members

  1. abstract def provideRules(regionId: String, forCaching: Boolean): ZoneRules

    Permalink

    SPI method to get the rules for the zone ID.

    SPI method to get the rules for the zone ID.

    This loads the rules for the region and version specified. The version may be null to indicate the "latest" version.

    regionId

    the time-zone region ID, not null

    returns

    the rules, not null

    Attributes
    protected
    Exceptions thrown

    DateTimeException if rules cannot be obtained

  2. abstract def provideVersions(zoneId: String): NavigableMap[String, ZoneRules]

    Permalink

    SPI method to get the history of rules for the zone ID.

    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 always contain 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.

    zoneId

    the zone region ID as used by { @code ZoneId}, not null

    returns

    a modifiable copy of the history of the rules for the ID, sorted from oldest to newest, not null

    Attributes
    protected
    Exceptions thrown

    ZoneRulesException if history cannot be obtained for the zone ID

  3. abstract def provideZoneIds: Set[String]

    Permalink

    SPI method to get the available zone IDs.

    SPI method to get the available zone IDs.

    This obtains the IDs that this ZoneRulesProvider provides. A provider should provide data for at least one region.

    The returned regions remain available and valid for the lifetime of the application. A dynamic provider may increase the set of regions as more data becomes available.

    returns

    the unmodifiable set of region IDs being provided, not null

    Attributes
    protected
    Exceptions thrown

    ZoneRulesException if a problem occurs while providing the IDs

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def provideRefresh: Boolean

    Permalink

    SPI method to refresh the rules from the underlying data provider.

    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.

    returns

    true if the rules were updated

    Attributes
    protected
    Exceptions thrown

    DateTimeException if an error occurs during the refresh

  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped