Class ReloadableValueSet


  • public class ReloadableValueSet
    extends ValueSet
    Since value sets may change over time and we really don't want to have to re-compile our programs everytime a value set changes, the ReloadableValueSet class can be useful. The class extends ValueSet but relies on a Supplier to get the value set data.

    This supplier typically reads the value set from a JSON configuration file holding the data, or from a resource accessed over HTTP(S).

    The implementation of the Supplier decides how often the value set data is reloaded, and the implementation is responsible of caching the current set of data.

    Note:The Supplier.get() method MUST NEVER return null. If a download fails it should return data from its cache, and if the cache is empty (download has never succeeded) a RuntimeException must be thrown.

    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)