1616import com .fasterxml .jackson .databind .JsonNode ;
1717import com .snowplowanalytics .snowplow .tracker .emitter .BufferOption ;
1818import com .snowplowanalytics .snowplow .tracker .emitter .HttpMethod ;
19- import com .snowplowanalytics .snowplow .tracker .emitter .RequestOption ;
19+ import com .snowplowanalytics .snowplow .tracker .emitter .RequestMethod ;
2020
2121import org .apache .http .HttpResponse ;
2222import org .apache .http .client .methods .HttpGet ;
@@ -43,7 +43,7 @@ public class Emitter {
4343 private URIBuilder uri ;
4444 private BufferOption option = BufferOption .Default ;
4545 private HttpMethod httpMethod = HttpMethod .GET ;
46- private RequestOption requestOption = RequestOption .Synchronous ;
46+ private RequestMethod requestMethod = RequestMethod .Synchronous ;
4747 private CloseableHttpClient httpClient ;
4848 private CloseableHttpAsyncClient httpAsyncClient ;
4949 private final ArrayList <Payload > buffer = new ArrayList <Payload >();
@@ -63,8 +63,8 @@ public void setBufferOption(BufferOption option) {
6363 this .option = option ;
6464 }
6565
66- public void setRequestOption ( RequestOption option ) {
67- this .requestOption = option ;
66+ public void setRequestMethod ( RequestMethod option ) {
67+ this .requestMethod = option ;
6868 this .httpAsyncClient = HttpAsyncClients .createDefault ();
6969 this .httpAsyncClient .start ();
7070 }
@@ -98,7 +98,7 @@ private void sendPostData(Payload payload) {
9898 StringEntity params = new StringEntity (payload .toString ());
9999 HttpResponse httpResponse ;
100100 httpPost .setEntity (params );
101- if (requestOption == RequestOption .Asynchronous ) {
101+ if (requestMethod == RequestMethod .Asynchronous ) {
102102 Future <HttpResponse > future = httpAsyncClient .execute (httpPost , null );
103103 httpResponse = future .get ();
104104 } else {
@@ -138,7 +138,7 @@ private void sendGetData(Payload payload) {
138138 try {
139139 HttpGet httpGet = new HttpGet (requestUri .build ());
140140 HttpResponse httpResponse ;
141- if (requestOption == RequestOption .Asynchronous ) {
141+ if (requestMethod == RequestMethod .Asynchronous ) {
142142 Future <HttpResponse > future = httpAsyncClient .execute (httpGet , null );
143143 httpResponse = future .get ();
144144 } else {
0 commit comments