35
35
import com .optimizely .ab .event .EventHandler ;
36
36
import com .optimizely .ab .event .LogEvent ;
37
37
import com .optimizely .ab .event .internal .BuildVersionInfo ;
38
- import com .optimizely .ab .event .internal .EventBuilder ;
38
+ import com .optimizely .ab .event .internal .EventFactory ;
39
39
import com .optimizely .ab .event .internal .payload .EventBatch .ClientEngine ;
40
- import com .optimizely .ab .internal .ControlAttribute ;
41
40
import com .optimizely .ab .notification .NotificationCenter ;
42
41
import org .slf4j .Logger ;
43
42
import org .slf4j .LoggerFactory ;
@@ -82,7 +81,7 @@ public class Optimizely {
82
81
private static final Logger logger = LoggerFactory .getLogger (Optimizely .class );
83
82
84
83
@ VisibleForTesting final DecisionService decisionService ;
85
- @ VisibleForTesting final EventBuilder eventBuilder ;
84
+ @ VisibleForTesting final EventFactory eventFactory ;
86
85
@ VisibleForTesting final ProjectConfig projectConfig ;
87
86
@ VisibleForTesting final EventHandler eventHandler ;
88
87
@ VisibleForTesting final ErrorHandler errorHandler ;
@@ -93,13 +92,13 @@ public class Optimizely {
93
92
private Optimizely (@ Nonnull ProjectConfig projectConfig ,
94
93
@ Nonnull DecisionService decisionService ,
95
94
@ Nonnull EventHandler eventHandler ,
96
- @ Nonnull EventBuilder eventBuilder ,
95
+ @ Nonnull EventFactory eventFactory ,
97
96
@ Nonnull ErrorHandler errorHandler ,
98
97
@ Nullable UserProfileService userProfileService ) {
99
98
this .projectConfig = projectConfig ;
100
99
this .decisionService = decisionService ;
101
100
this .eventHandler = eventHandler ;
102
- this .eventBuilder = eventBuilder ;
101
+ this .eventFactory = eventFactory ;
103
102
this .errorHandler = errorHandler ;
104
103
this .userProfileService = userProfileService ;
105
104
}
@@ -193,7 +192,7 @@ private void sendImpression(@Nonnull ProjectConfig projectConfig,
193
192
@ Nonnull Map <String , String > filteredAttributes ,
194
193
@ Nonnull Variation variation ) {
195
194
if (experiment .isRunning ()) {
196
- LogEvent impressionEvent = eventBuilder .createImpressionEvent (
195
+ LogEvent impressionEvent = eventFactory .createImpressionEvent (
197
196
projectConfig ,
198
197
experiment ,
199
198
variation ,
@@ -279,7 +278,7 @@ public void track(@Nonnull String eventName,
279
278
}
280
279
281
280
// create the conversion event request parameters, then dispatch
282
- LogEvent conversionEvent = eventBuilder .createConversionEvent (
281
+ LogEvent conversionEvent = eventFactory .createConversionEvent (
283
282
projectConfig ,
284
283
experimentVariationMap ,
285
284
userId ,
@@ -829,7 +828,7 @@ public static class Builder {
829
828
private DecisionService decisionService ;
830
829
private ErrorHandler errorHandler ;
831
830
private EventHandler eventHandler ;
832
- private EventBuilder eventBuilder ;
831
+ private EventFactory eventFactory ;
833
832
private ClientEngine clientEngine ;
834
833
private String clientVersion ;
835
834
private ProjectConfig projectConfig ;
@@ -871,8 +870,8 @@ public Builder withClientVersion(String clientVersion) {
871
870
return this ;
872
871
}
873
872
874
- protected Builder withEventBuilder (EventBuilder eventBuilder ) {
875
- this .eventBuilder = eventBuilder ;
873
+ protected Builder withEventBuilder (EventFactory eventFactory ) {
874
+ this .eventFactory = eventFactory ;
876
875
return this ;
877
876
}
878
877
@@ -900,8 +899,8 @@ public Optimizely build() throws ConfigParseException {
900
899
}
901
900
902
901
903
- if (eventBuilder == null ) {
904
- eventBuilder = new EventBuilder (clientEngine , clientVersion );
902
+ if (eventFactory == null ) {
903
+ eventFactory = new EventFactory (clientEngine , clientVersion );
905
904
}
906
905
907
906
if (errorHandler == null ) {
@@ -912,7 +911,7 @@ public Optimizely build() throws ConfigParseException {
912
911
decisionService = new DecisionService (bucketer , errorHandler , projectConfig , userProfileService );
913
912
}
914
913
915
- Optimizely optimizely = new Optimizely (projectConfig , decisionService , eventHandler , eventBuilder , errorHandler , userProfileService );
914
+ Optimizely optimizely = new Optimizely (projectConfig , decisionService , eventHandler , eventFactory , errorHandler , userProfileService );
916
915
optimizely .initialize ();
917
916
return optimizely ;
918
917
}
0 commit comments