public final class RemoteResourceHandlers extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addRemoteResource(String name,
org.thales.punch.settings.api.ISettingsMap configuration)
Create a resource handler for given configuration.
|
static void |
addTestRemoteResource(String name,
String url,
String cron,
boolean requiredResource,
String decoder,
org.thales.punch.settings.api.ISettingsMap decoderSettings)
Create a resource handler for given parameters.
|
static void |
clear()
Test method to repeat tests with a fresh starting point.
|
static Supplier<Tuple> |
computeIfAbsent(String url,
Function<? super String,? extends Supplier<Tuple>> mappingFunction)
This method will return the first
IRemoteResourceHandler initialised
in this JVM for the provided URL. |
static Tuple |
getRemoteResource(String resourceName)
Return the object corresponding to this resource name.
|
static String |
getRemoteResourceAsString(String resourceName)
Return the String corresponding to this resource name.
|
static Tuple |
getRemoteResourceAsTuple(String resourceName)
Return the Tuple corresponding to this resource name.
|
static void |
setRemoteResources(org.thales.punch.settings.api.ISettingsMap configuration)
Create a resource handler for every resource defined in the configuration.
|
public static Supplier<Tuple> computeIfAbsent(String url, Function<? super String,? extends Supplier<Tuple>> mappingFunction)
IRemoteResourceHandler initialised
in this JVM for the provided URL.
This API is thread safe.
url - the resource remote URL.mappingFunction - the mapping function to create the resource handler if not there.public static void setRemoteResources(org.thales.punch.settings.api.ISettingsMap configuration)
configuration - : Resources configurationpublic static void addRemoteResource(String name, org.thales.punch.settings.api.ISettingsMap configuration)
name - : Resource nameconfiguration - : Resources configurationpublic static void addTestRemoteResource(String name, String url, String cron, boolean requiredResource, String decoder, org.thales.punch.settings.api.ISettingsMap decoderSettings)
name - : Resource nameurl - : Resource URLcron - : Refresh frequencyrequiredResource - : Is this resource requireddecoder - : Tuple builderpublic static Tuple getRemoteResource(String resourceName)
resourceName - : Name of the requested resourcepublic static Tuple getRemoteResourceAsTuple(String resourceName)
resourceName - : Name of the requested resourcepublic static String getRemoteResourceAsString(String resourceName)
resourceName - : Name of the requested resourcepublic static void clear()
Copyright © 2023. All rights reserved.