public abstract class AbstractRemoteResourceHandlerBuilder<T> extends Object
This abstract class provides most of the logic at play. Checkout out the S3 or the plain HTTP or file remote handlers that extends this common part.
Modifier and Type | Field and Description |
---|---|
protected IResourceBuilder |
builder |
protected String |
cron |
protected org.thales.punch.libraries.metrics.api.IMetricContext |
metricsContext |
protected boolean |
requiredResource |
protected boolean |
silent |
Constructor and Description |
---|
AbstractRemoteResourceHandlerBuilder()
Ctor
|
Modifier and Type | Method and Description |
---|---|
abstract Supplier<Tuple> |
getTupleSupplier() |
T |
setCronExpression(String cron)
The optional CRON expression to refresh your resource.
|
T |
setMetricContext(org.thales.punch.libraries.metrics.api.IMetricContext metricsContext) |
T |
setRequiredResource(boolean requiredResource)
Indicate if the resource is absolutely required for the processing
|
T |
setResourceTupleBuilder(IResourceBuilder builder)
Set the tuple builder.
|
T |
setSilent(boolean silent)
Indicate if the resource is absolutely required for the processing
|
protected IResourceBuilder builder
protected String cron
protected boolean requiredResource
protected boolean silent
protected org.thales.punch.libraries.metrics.api.IMetricContext metricsContext
public AbstractRemoteResourceHandlerBuilder()
public abstract Supplier<Tuple> getTupleSupplier()
public T setResourceTupleBuilder(IResourceBuilder builder)
builder
- your builderpublic T setCronExpression(String cron)
cron
- the CRON expressionpublic T setRequiredResource(boolean requiredResource)
requiredResource
- true means that failure during the initial resource load at startup time will not be
considered as a failure (and a PunchUncheckedException
will be thrown).public T setSilent(boolean silent)
requiredResource
- true means that failure during the initial resource load at startup time will not be
considered as a failure (and a PunchUncheckedException
will be thrown).public T setMetricContext(org.thales.punch.libraries.metrics.api.IMetricContext metricsContext)
metricsContext
- a metric context to publish useful loading metrics.Copyright © 2022. All rights reserved.