public class RemoteResourceHandlerBuilder extends AbstractRemoteResourceHandlerBuilder<RemoteResourceHandlerBuilder>
IRemoteResourceHandler resourceHandler = new RemoteResourceBuilder()
.setResourceUrl(resource_file_url)
.setCronExpression(refresh_cron)
.setResourceTupleBuilder(builder)
.build();
Then all you have to do is to periodically call
resourceHandler.tick();
so that the resource are remotely refreshed whenever needed.
To retrieve the resource itself use
resourceHandler.getResource();
builder, cron, metricsContext, requiredResource, silent
Constructor and Description |
---|
RemoteResourceHandlerBuilder()
RemoteResourceHandlerBuilder constructor.
|
Modifier and Type | Method and Description |
---|---|
Supplier<Tuple> |
getTupleSupplier() |
RemoteResourceHandlerBuilder |
setResourceUrl(String url)
Set the resource remote url.
|
setCronExpression, setMetricContext, setRequiredResource, setResourceTupleBuilder, setSilent
public RemoteResourceHandlerBuilder()
public RemoteResourceHandlerBuilder setResourceUrl(String url)
url
- the resource urlpublic Supplier<Tuple> getTupleSupplier()
getTupleSupplier
in class AbstractRemoteResourceHandlerBuilder<RemoteResourceHandlerBuilder>
Copyright © 2022. All rights reserved.