-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
weiqiangliu
committed
Jan 9, 2023
1 parent
f33b124
commit 70e82dc
Showing
11 changed files
with
325 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ticsSDK/src/main/java/com/sensorsdata/analytics/javasdk/consumer/InstantHttpConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.sensorsdata.analytics.javasdk.consumer; | ||
|
||
import org.apache.http.NameValuePair; | ||
import org.apache.http.client.entity.UrlEncodedFormEntity; | ||
import org.apache.http.impl.client.HttpClientBuilder; | ||
import org.apache.http.message.BasicNameValuePair; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class InstantHttpConsumer extends HttpConsumer{ | ||
|
||
public InstantHttpConsumer(String serverUrl, int timeoutSec) { | ||
super(serverUrl, timeoutSec); | ||
} | ||
|
||
public InstantHttpConsumer(String serverUrl, Map<String, String> httpHeaders) { | ||
super(serverUrl, httpHeaders); | ||
} | ||
|
||
InstantHttpConsumer(String serverUrl, Map<String, String> httpHeaders, int timeoutSec) { | ||
super(serverUrl, httpHeaders, timeoutSec); | ||
} | ||
|
||
public InstantHttpConsumer(HttpClientBuilder httpClientBuilder, String serverUrl, | ||
Map<String, String> httpHeaders) { | ||
super(httpClientBuilder, serverUrl, httpHeaders); | ||
} | ||
|
||
public InstantHttpConsumer(HttpClientBuilder httpClientBuilder, String serverUrl, int timeoutSec) { | ||
super(httpClientBuilder, serverUrl, timeoutSec); | ||
} | ||
|
||
InstantHttpConsumer(HttpClientBuilder httpClientBuilder, String serverUrl, Map<String, String> httpHeaders, | ||
int timeoutSec) { | ||
super(httpClientBuilder, serverUrl, httpHeaders, timeoutSec); | ||
} | ||
|
||
@Override | ||
UrlEncodedFormEntity getHttpEntry(final String data) throws IOException { | ||
List<NameValuePair> nameValuePairs = getNameValuePairs(data); | ||
nameValuePairs.add(new BasicNameValuePair("instant_event", "true")); | ||
return new UrlEncodedFormEntity(nameValuePairs); | ||
} | ||
} |
Oops, something went wrong.