Search in sources :

Example 66 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.
 *
 * @deprecated by {@link ActivateNotificationListener#handle(ActivateNotification)}
 */
@Override
@Deprecated
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];
    Map<String, ?> attributes = null;
    if (args[2] != null) {
        assert (args[2] instanceof java.util.Map);
        attributes = (Map<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)

Aggregations

LogEvent (com.optimizely.ab.event.LogEvent)66 Test (org.junit.Test)58 Experiment (com.optimizely.ab.config.Experiment)37 Variation (com.optimizely.ab.config.Variation)34 EventBatch (com.optimizely.ab.event.internal.payload.EventBatch)32 HashMap (java.util.HashMap)25 EventType (com.optimizely.ab.config.EventType)23 EventBuilder (com.optimizely.ab.event.internal.EventBuilder)21 Matchers.anyString (org.mockito.Matchers.anyString)21 ControlAttribute (com.optimizely.ab.internal.ControlAttribute)17 Map (java.util.Map)14 ImmutableMap (com.google.common.collect.ImmutableMap)11 Bucketer (com.optimizely.ab.bucketing.Bucketer)11 EventBuilderTest.createExperimentVariationMap (com.optimizely.ab.event.internal.EventBuilderTest.createExperimentVariationMap)11 ProjectConfig (com.optimizely.ab.config.ProjectConfig)10 Attribute (com.optimizely.ab.config.Attribute)9 Decision (com.optimizely.ab.event.internal.payload.Decision)9 DecisionService (com.optimizely.ab.bucketing.DecisionService)8 UserProfileService (com.optimizely.ab.bucketing.UserProfileService)6 NoOpErrorHandler (com.optimizely.ab.error.NoOpErrorHandler)6