public static class RemoteBaggageRestrictionManager.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(java.lang.String serviceName) |
Modifier and Type | Method and Description |
---|---|
RemoteBaggageRestrictionManager |
build()
Creates a RemoteBaggageRestrictionManager that fetches
BaggageRestrictionResponse from a remote
agent and keeps track of Restriction for a service. |
RemoteBaggageRestrictionManager.Builder |
withDenyBaggageInitializationFailure(boolean denyBaggageOnInitializationFailure)
If
denyBaggageOnInitializationFailure is true,
RemoteBaggageRestrictionManager will not allow any baggage to be written until
baggage restrictions have been retrieved from agent. |
RemoteBaggageRestrictionManager.Builder |
withInitialDelayMs(int initialDelayMs)
initialDelayMs is only exposed for testing purposes so users can determine when
the first call to remote agent is made. |
RemoteBaggageRestrictionManager.Builder |
withMetrics(Metrics metrics) |
RemoteBaggageRestrictionManager.Builder |
withProxy(BaggageRestrictionManagerProxy proxy) |
RemoteBaggageRestrictionManager.Builder |
withRefreshIntervalMs(int refreshIntervalMs) |
public Builder(java.lang.String serviceName)
serviceName
- restrictions for this service are kept track of.public RemoteBaggageRestrictionManager.Builder withProxy(BaggageRestrictionManagerProxy proxy)
proxy
- proxy to remote agent.public RemoteBaggageRestrictionManager.Builder withMetrics(Metrics metrics)
public RemoteBaggageRestrictionManager.Builder withDenyBaggageInitializationFailure(boolean denyBaggageOnInitializationFailure)
denyBaggageOnInitializationFailure
is true,
RemoteBaggageRestrictionManager
will not allow any baggage to be written until
baggage restrictions have been retrieved from agent. If denyBaggageOnInitializationFailure
is
false, RemoteBaggageRestrictionManager
will allow any baggage to be written until
baggage restrictions have been retrieved from agent.denyBaggageOnInitializationFailure
- determines the startup failure mode of
RemoteBaggageRestrictionManager
public RemoteBaggageRestrictionManager.Builder withRefreshIntervalMs(int refreshIntervalMs)
refreshIntervalMs
- how often restriction are fetched from remote agent.public RemoteBaggageRestrictionManager.Builder withInitialDelayMs(int initialDelayMs)
initialDelayMs
is only exposed for testing purposes so users can determine when
the first call to remote agent is made. Under normal operations,
this RemoteBaggageRestrictionManager
will start up and asynchronously fetch restrictions.
If the user wants to know if restrictions are ready, they can check via
RemoteBaggageRestrictionManager.isReady()
.initialDelayMs
- delay before first fetch of restrictions.public RemoteBaggageRestrictionManager build()
BaggageRestrictionResponse
from a remote
agent and keeps track of Restriction
for a service.