public class RemoteResourceHandler extends AbstractRemoteResourceHandler
It is used to implement atomic or incremental variant to periodically reload remote resources.
AbstractRemoteResourceHandler.AtomicTupleReferenceatomicTupleReference, builder, logger, requiredResource, resourceUuid| Constructor and Description |
|---|
RemoteResourceHandler(String resourceUuid,
String url,
IResourceBuilder builder,
String cron,
boolean requiredResource,
boolean silent,
org.thales.punch.libraries.metrics.api.IMetricContext mc)
Ctor
|
| Modifier and Type | Method and Description |
|---|---|
protected static InputStreamReader |
getFileStream(String path) |
protected static Tuple |
getResourceFromFile(String resourceUrl,
IResourceBuilder builder) |
protected static Tuple |
getResourceFromHttp(String resourceUrl,
IResourceBuilder builder) |
void |
reload() |
static Tuple |
testGetResourceFromFile(String resourceUrl,
IResourceBuilder builder)
Test method to fetch files.
|
clear, get, loadingFailures, loadingSuccess, run, start, startLoading, stop, stopLoadingpublic RemoteResourceHandler(String resourceUuid, String url, IResourceBuilder builder, String cron, boolean requiredResource, boolean silent, org.thales.punch.libraries.metrics.api.IMetricContext mc)
resourceUrl - the remote or local resource URLcron - the CRON expression. If null no thread is launched.builder - the resource builder in charge of transforming the loaded resourcesrequiredResource - true to make it mandatory to load the resource firstmc - the metrics contextprotected static Tuple getResourceFromHttp(String resourceUrl, IResourceBuilder builder) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolExceptionIOExceptionprotected static InputStreamReader getFileStream(String path) throws IOException
IOExceptionprotected static Tuple getResourceFromFile(String resourceUrl, IResourceBuilder builder) throws IOException
resourceUrl - the url of a resource file.builder - the resource builderIOExceptionpublic static Tuple testGetResourceFromFile(String resourceUrl, IResourceBuilder builder) throws IOException
resourceUrl - builder - IOExceptionpublic void reload()
throws IOException
reload in class AbstractRemoteResourceHandlerIOExceptionCopyright © 2022. All rights reserved.