Interface EventProcessor
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
public interface EventProcessor extends java.io.Closeable
Interface for an object that can send or store analytics events.Application code normally does not need to interact with this interface. It is provided to allow a custom implementation or test fixture to be substituted for the SDK's normal analytics event logic.
- Since:
- 3.3.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
NO_VERSION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
blockingFlush()
Specifies that any buffered events should be sent immediately, blocking until done.void
flush()
Specifies that any buffered events should be sent as soon as possible, rather than waiting for the next flush interval.void
recordAliasEvent(LDUser user, LDUser previousUser)
Creates an alias event, as when the SDK'salias
method is called.void
recordCustomEvent(LDUser user, java.lang.String eventKey, LDValue data, java.lang.Double metricValue)
Creates a custom event, as when the SDK'strack
method is called.void
recordEvaluationEvent(LDUser user, java.lang.String flagKey, int flagVersion, int variation, LDValue value, EvaluationReason reason, LDValue defaultValue, boolean requireFullEvent, java.lang.Long debugEventsUntilDate)
Records the action of evaluating a feature flag.void
recordIdentifyEvent(LDUser user)
Registers an evaluation context, as when the SDK'sidentify
method is called.void
setOffline(boolean offline)
Puts the event processor into offline mode if appropriatevoid
start()
Starts any periodic tasks used by the event processor.void
stop()
Stops any periodic tasks used by the event processor.
-
-
-
Field Detail
-
NO_VERSION
static final int NO_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
recordEvaluationEvent
void recordEvaluationEvent(LDUser user, java.lang.String flagKey, int flagVersion, int variation, LDValue value, EvaluationReason reason, LDValue defaultValue, boolean requireFullEvent, java.lang.Long debugEventsUntilDate)
Records the action of evaluating a feature flag.Depending on the feature flag properties and event properties, this may be transmitted to the events service as an individual event, or may only be added into summary data.
- Parameters:
user
- the current userflagKey
- key of the feature flag that was evaluatedflagVersion
- the version of the flag, orNO_VERSION
if the flag was not foundvariation
- the result variation index, orEvaluationDetail.NO_VARIATION
if evaluation failedvalue
- the result valuereason
- the evaluation reason, or null if the reason was not requesteddefaultValue
- the default value parameter for the evaluationrequireFullEvent
- true if full-fidelity analytics events should be sent for this flagdebugEventsUntilDate
- if non-null, debug events are to be generated until this millisecond time
-
recordIdentifyEvent
void recordIdentifyEvent(LDUser user)
Registers an evaluation context, as when the SDK'sidentify
method is called.- Parameters:
user
- the current user
-
recordCustomEvent
void recordCustomEvent(LDUser user, java.lang.String eventKey, LDValue data, java.lang.Double metricValue)
Creates a custom event, as when the SDK'strack
method is called.- Parameters:
user
- the current usereventKey
- the event keydata
- optional custom data provided for the event, may be null orLDValue.ofNull()
if not usedmetricValue
- optional numeric metric value provided for the event, or null
-
recordAliasEvent
void recordAliasEvent(LDUser user, LDUser previousUser)
Creates an alias event, as when the SDK'salias
method is called.- Parameters:
user
- the current userpreviousUser
- the previous user
-
start
void start()
Starts any periodic tasks used by the event processor.
-
stop
void stop()
Stops any periodic tasks used by the event processor.
-
setOffline
void setOffline(boolean offline)
Puts the event processor into offline mode if appropriate- Parameters:
offline
- true if the SDK has been put offline
-
flush
void flush()
Specifies that any buffered events should be sent as soon as possible, rather than waiting for the next flush interval. This method is asynchronous, so events still may not be sent until a later time. However, callingCloseable.close()
will synchronously deliver any events that were not yet delivered prior to shutting down.
-
blockingFlush
void blockingFlush()
Specifies that any buffered events should be sent immediately, blocking until done.
-
-