Class LDReactorClient
- java.lang.Object
-
- com.launchdarkly.sdk.server.integrations.reactor.LDReactorClient
-
- All Implemented Interfaces:
LDReactorClientInterface
public final class LDReactorClient extends java.lang.Object implements LDReactorClientInterface
A thin wrapper of theLDClient
that aims to adapt it to reactive stream programming. Methods that are potentially long running or that use IO have been wrapped to returnMono
s and will be executed on the scheduler provided. Methods that do not have a risk of blocking have not been wrapped and are pass through.
-
-
Constructor Summary
Constructors Constructor Description LDReactorClient(java.lang.String sdkKey, LDConfig config, reactor.core.scheduler.Scheduler scheduler)
Creates a client that uses the provided scheduler to execute functionality in a non-blocking manner.LDReactorClient(java.lang.String sdkKey, reactor.core.scheduler.Scheduler scheduler)
Creates a client that uses the provided scheduler to execute functionality in a non-blocking manner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<FeatureFlagsState>
allFlagsState(LDContext context, FlagsStateOption... options)
reactor.core.publisher.Mono<java.lang.Boolean>
boolVariation(java.lang.String featureKey, LDContext context, boolean defaultValue)
reactor.core.publisher.Mono<EvaluationDetail<java.lang.Boolean>>
boolVariationDetail(java.lang.String featureKey, LDContext context, boolean defaultValue)
reactor.core.publisher.Mono<java.lang.Void>
close()
SeeLDClient.close()
.reactor.core.publisher.Mono<java.lang.Double>
doubleVariation(java.lang.String featureKey, LDContext context, double defaultValue)
reactor.core.publisher.Mono<EvaluationDetail<java.lang.Double>>
doubleVariationDetail(java.lang.String featureKey, LDContext context, double defaultValue)
void
flush()
SeeLDClient.flush()
.BigSegmentStoreStatusProvider
getBigSegmentStoreStatusProvider()
DataSourceStatusProvider
getDataSourceStatusProvider()
DataStoreStatusProvider
getDataStoreStatusProvider()
FlagTracker
getFlagTracker()
void
identify(LDContext context)
reactor.core.publisher.Mono<java.lang.Integer>
intVariation(java.lang.String featureKey, LDContext context, int defaultValue)
reactor.core.publisher.Mono<EvaluationDetail<java.lang.Integer>>
intVariationDetail(java.lang.String featureKey, LDContext context, int defaultValue)
boolean
isFlagKnown(java.lang.String featureKey)
boolean
isInitialized()
boolean
isOffline()
SeeLDClient.isOffline()
.reactor.core.publisher.Mono<LDValue>
jsonValueVariation(java.lang.String featureKey, LDContext context, LDValue defaultValue)
reactor.core.publisher.Mono<EvaluationDetail<LDValue>>
jsonValueVariationDetail(java.lang.String featureKey, LDContext context, LDValue defaultValue)
java.lang.String
secureModeHash(LDContext context)
reactor.core.publisher.Mono<java.lang.String>
stringVariation(java.lang.String featureKey, LDContext context, java.lang.String defaultValue)
reactor.core.publisher.Mono<EvaluationDetail<java.lang.String>>
stringVariationDetail(java.lang.String featureKey, LDContext context, java.lang.String defaultValue)
void
track(java.lang.String eventName, LDContext context)
void
trackData(java.lang.String eventName, LDContext context, LDValue data)
void
trackMetric(java.lang.String eventName, LDContext context, LDValue data, double metricValue)
java.lang.String
version()
SeeLDClient.version()
.
-
-
-
Constructor Detail
-
LDReactorClient
public LDReactorClient(java.lang.String sdkKey, reactor.core.scheduler.Scheduler scheduler)
Creates a client that uses the provided scheduler to execute functionality in a non-blocking manner.- Parameters:
sdkKey
- the SDK key for your LaunchDarkly environmentscheduler
- that will execute wrapped client methods
-
LDReactorClient
public LDReactorClient(java.lang.String sdkKey, LDConfig config, reactor.core.scheduler.Scheduler scheduler)
Creates a client that uses the provided scheduler to execute functionality in a non-blocking manner.- Parameters:
sdkKey
- the SDK key for your LaunchDarkly environmentconfig
- a client configuration objectscheduler
- that will execute wrapped client methods
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
Description copied from interface:LDReactorClientInterface
- Specified by:
isInitialized
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
track
public void track(java.lang.String eventName, LDContext context)
Description copied from interface:LDReactorClientInterface
- Specified by:
track
in interfaceLDReactorClientInterface
- Parameters:
eventName
- see linked reference.context
- see linked reference.
-
trackData
public void trackData(java.lang.String eventName, LDContext context, LDValue data)
Description copied from interface:LDReactorClientInterface
- Specified by:
trackData
in interfaceLDReactorClientInterface
- Parameters:
eventName
- see linked reference.context
- see linked reference.data
- see linked reference.
-
trackMetric
public void trackMetric(java.lang.String eventName, LDContext context, LDValue data, double metricValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
trackMetric
in interfaceLDReactorClientInterface
- Parameters:
eventName
- see linked reference.context
- see linked reference.data
- see linked reference.metricValue
- see linked reference.
-
identify
public void identify(LDContext context)
Description copied from interface:LDReactorClientInterface
- Specified by:
identify
in interfaceLDReactorClientInterface
- Parameters:
context
- see linked reference.
-
allFlagsState
public reactor.core.publisher.Mono<FeatureFlagsState> allFlagsState(LDContext context, FlagsStateOption... options)
Description copied from interface:LDReactorClientInterface
- Specified by:
allFlagsState
in interfaceLDReactorClientInterface
- Parameters:
context
- see linked reference.options
- see linked reference.- Returns:
- a
Mono
that will emit theFeatureFlagsState
.
-
boolVariation
public reactor.core.publisher.Mono<java.lang.Boolean> boolVariation(java.lang.String featureKey, LDContext context, boolean defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
boolVariation
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
intVariation
public reactor.core.publisher.Mono<java.lang.Integer> intVariation(java.lang.String featureKey, LDContext context, int defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
intVariation
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
doubleVariation
public reactor.core.publisher.Mono<java.lang.Double> doubleVariation(java.lang.String featureKey, LDContext context, double defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
doubleVariation
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
stringVariation
public reactor.core.publisher.Mono<java.lang.String> stringVariation(java.lang.String featureKey, LDContext context, java.lang.String defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
stringVariation
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
jsonValueVariation
public reactor.core.publisher.Mono<LDValue> jsonValueVariation(java.lang.String featureKey, LDContext context, LDValue defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
jsonValueVariation
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
boolVariationDetail
public reactor.core.publisher.Mono<EvaluationDetail<java.lang.Boolean>> boolVariationDetail(java.lang.String featureKey, LDContext context, boolean defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
boolVariationDetail
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
intVariationDetail
public reactor.core.publisher.Mono<EvaluationDetail<java.lang.Integer>> intVariationDetail(java.lang.String featureKey, LDContext context, int defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
intVariationDetail
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
doubleVariationDetail
public reactor.core.publisher.Mono<EvaluationDetail<java.lang.Double>> doubleVariationDetail(java.lang.String featureKey, LDContext context, double defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
doubleVariationDetail
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
stringVariationDetail
public reactor.core.publisher.Mono<EvaluationDetail<java.lang.String>> stringVariationDetail(java.lang.String featureKey, LDContext context, java.lang.String defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
stringVariationDetail
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
jsonValueVariationDetail
public reactor.core.publisher.Mono<EvaluationDetail<LDValue>> jsonValueVariationDetail(java.lang.String featureKey, LDContext context, LDValue defaultValue)
Description copied from interface:LDReactorClientInterface
- Specified by:
jsonValueVariationDetail
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.context
- see linked reference.defaultValue
- see linked reference.- Returns:
- a
Mono
that will emit the evaluation result.
-
isFlagKnown
public boolean isFlagKnown(java.lang.String featureKey)
Description copied from interface:LDReactorClientInterface
- Specified by:
isFlagKnown
in interfaceLDReactorClientInterface
- Parameters:
featureKey
- see linked reference.- Returns:
- see linked reference.
-
getFlagTracker
public FlagTracker getFlagTracker()
Description copied from interface:LDReactorClientInterface
- Specified by:
getFlagTracker
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
getBigSegmentStoreStatusProvider
public BigSegmentStoreStatusProvider getBigSegmentStoreStatusProvider()
Description copied from interface:LDReactorClientInterface
SeeLDClient.getBigSegmentStoreStatusProvider()
. Getting theBigSegmentStoreStatusProvider
is not a blocking operation, but function calls on theBigSegmentStoreStatusProvider
may be.- Specified by:
getBigSegmentStoreStatusProvider
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
getDataStoreStatusProvider
public DataStoreStatusProvider getDataStoreStatusProvider()
Description copied from interface:LDReactorClientInterface
SeeLDClient.getDataStoreStatusProvider()
. Getting theDataStoreStatusProvider
is not a blocking operation, but function calls on theDataStoreStatusProvider
may be.- Specified by:
getDataStoreStatusProvider
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
getDataSourceStatusProvider
public DataSourceStatusProvider getDataSourceStatusProvider()
Description copied from interface:LDReactorClientInterface
SeeLDClient.getDataSourceStatusProvider()
. Getting theDataSourceStatusProvider
is not a blocking operation, but function calls on theDataSourceStatusProvider
may be.- Specified by:
getDataSourceStatusProvider
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
close
public reactor.core.publisher.Mono<java.lang.Void> close()
Description copied from interface:LDReactorClientInterface
SeeLDClient.close()
.- Specified by:
close
in interfaceLDReactorClientInterface
- Returns:
- a Mono that completes when
LDClient.close()
completes.
-
flush
public void flush()
Description copied from interface:LDReactorClientInterface
SeeLDClient.flush()
.- Specified by:
flush
in interfaceLDReactorClientInterface
-
isOffline
public boolean isOffline()
Description copied from interface:LDReactorClientInterface
SeeLDClient.isOffline()
.- Specified by:
isOffline
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
secureModeHash
public java.lang.String secureModeHash(LDContext context)
Description copied from interface:LDReactorClientInterface
- Specified by:
secureModeHash
in interfaceLDReactorClientInterface
- Parameters:
context
- see linked reference.- Returns:
- see linked reference.
-
version
public java.lang.String version()
Description copied from interface:LDReactorClientInterface
SeeLDClient.version()
.- Specified by:
version
in interfaceLDReactorClientInterface
- Returns:
- see linked reference.
-
-