Class JsonUrlRemoteConfigProvider
java.lang.Object
com.codename1.cloud.JsonUrlRemoteConfigProvider
- All Implemented Interfaces:
RemoteConfigProvider
A RemoteConfigProvider that reads a flat JSON object from a URL, for
self-hosted configuration. Nested objects and arrays become JSON text.
{"welcome_text": "Hello", "new_checkout": true, "max_items": 20}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetch()Fetches the current values.getId()Returns
voidsetTransport(CloudHttpTransport transport) Replaces the HTTP transport.
-
Constructor Details
-
JsonUrlRemoteConfigProvider
Creates a provider.
Parameters
url: the URL of the JSON document
-
-
Method Details
-
setTransport
Replaces the HTTP transport.
Parameters
transport: the transport
-
getId
Description copied from interface:RemoteConfigProviderReturns
a short stable ID that keeps this provider's cache apart from others
- Specified by:
getIdin interfaceRemoteConfigProvider
-
fetch
Description copied from interface:RemoteConfigProviderFetches the current values.
Returns
a resource that completes with keys to string values
- Specified by:
fetchin interfaceRemoteConfigProvider
-