Search in sources :

Example 46 with LogEvent

use of com.optimizely.ab.event.LogEvent in project java-sdk by optimizely.

the class ActivateNotificationListener method notify.

/**
 * Base notify called with var args.  This method parses the parameters and calls the abstract method.
 * @param args - variable argument list based on the type of notification.
 */
@Override
public final void notify(Object... args) {
    assert (args[0] instanceof Experiment);
    Experiment experiment = (Experiment) args[0];
    assert (args[1] instanceof String);
    String userId = (String) args[1];
    assert (args[2] instanceof java.util.Map);
    Map<String, String> attributes = (Map<String, String>) args[2];
    assert (args[3] instanceof Variation);
    Variation variation = (Variation) args[3];
    assert (args[4] instanceof LogEvent);
    LogEvent logEvent = (LogEvent) args[4];
    onActivate(experiment, userId, attributes, variation, logEvent);
}
Also used : LogEvent(com.optimizely.ab.event.LogEvent) Experiment(com.optimizely.ab.config.Experiment) Map(java.util.Map) Variation(com.optimizely.ab.config.Variation) Map(java.util.Map)

Aggregations

LogEvent (com.optimizely.ab.event.LogEvent)46 Experiment (com.optimizely.ab.config.Experiment)41 Test (org.junit.Test)40 Variation (com.optimizely.ab.config.Variation)38 HashMap (java.util.HashMap)29 EventType (com.optimizely.ab.config.EventType)25 EventBuilder (com.optimizely.ab.event.internal.EventBuilder)25 Matchers.anyString (org.mockito.Matchers.anyString)25 Map (java.util.Map)18 ImmutableMap (com.google.common.collect.ImmutableMap)15 EventBuilderTest.createExperimentVariationMap (com.optimizely.ab.event.internal.EventBuilderTest.createExperimentVariationMap)15 Attribute (com.optimizely.ab.config.Attribute)13 EventBatch (com.optimizely.ab.event.internal.payload.EventBatch)13 ProjectConfig (com.optimizely.ab.config.ProjectConfig)9 Bucketer (com.optimizely.ab.bucketing.Bucketer)8 DecisionService (com.optimizely.ab.bucketing.DecisionService)8 UserProfileService (com.optimizely.ab.bucketing.UserProfileService)6 NoOpErrorHandler (com.optimizely.ab.error.NoOpErrorHandler)6 Decision (com.optimizely.ab.event.internal.payload.Decision)6 ErrorHandler (com.optimizely.ab.error.ErrorHandler)5