1717import java .time .LocalDate ;
1818import java .util .Timer ;
1919import java .util .TimerTask ;
20- import java .util .concurrent .CompletableFuture ;
2120import java .util .concurrent .ExecutorService ;
2221import java .util .concurrent .Executors ;
2322
@@ -78,18 +77,10 @@ public static ExceptionlessClient from(String apiKey, String serverUrl) {
7877 .build ();
7978 }
8079
81- public CompletableFuture <Void > submitExceptionAsync (Exception exception ) {
82- return CompletableFuture .runAsync (() -> submitException (exception ), executorService );
83- }
84-
8580 public void submitException (Exception exception ) {
8681 submitException (null , exception );
8782 }
8883
89- public CompletableFuture <Void > submitExceptionAsync (String message , Exception exception ) {
90- return CompletableFuture .runAsync (() -> submitException (message , exception ), executorService );
91- }
92-
9384 public void submitException (String message , Exception exception ) {
9485 Event event ;
9586 if (message == null ) {
@@ -106,12 +97,6 @@ public Event.EventBuilder createError() {
10697 return createEvent ().type (EventType .ERROR .value ());
10798 }
10899
109- public CompletableFuture <Void > submitUnhandledExceptionAsync (
110- Exception exception , String submissionMethod ) {
111- return CompletableFuture .runAsync (
112- () -> submitUnhandledException (exception , submissionMethod ), executorService );
113- }
114-
115100 public void submitUnhandledException (Exception exception , String submissionMethod ) {
116101 Event event = createError ().build ();
117102 PluginContext pluginContext =
@@ -124,10 +109,6 @@ public void submitUnhandledException(Exception exception, String submissionMetho
124109 EventPluginContext .builder ().event (event ).context (pluginContext ).build ());
125110 }
126111
127- public CompletableFuture <Void > submitFeatureUsageAsync (String feature ) {
128- return CompletableFuture .runAsync (() -> submitFeatureUsage (feature ), executorService );
129- }
130-
131112 public void submitFeatureUsage (String feature ) {
132113 submitEvent (createFeatureUsage (feature ).build ());
133114 }
@@ -136,26 +117,14 @@ public Event.EventBuilder createFeatureUsage(String feature) {
136117 return createEvent ().type (EventType .USAGE .value ()).source (feature );
137118 }
138119
139- public CompletableFuture <Void > submitLogAsync (String message ) {
140- return CompletableFuture .runAsync (() -> submitLog (message ), executorService );
141- }
142-
143120 public void submitLog (String message ) {
144121 submitLog (message , null , null );
145122 }
146123
147- public CompletableFuture <Void > submitLogAsync (String message , String source ) {
148- return CompletableFuture .runAsync (() -> submitLog (message , source ), executorService );
149- }
150-
151124 public void submitLog (String message , String source ) {
152125 submitLog (message , source , null );
153126 }
154127
155- public CompletableFuture <Void > submitLogAsync (String message , String source , String level ) {
156- return CompletableFuture .runAsync (() -> submitLog (message , source , level ), executorService );
157- }
158-
159128 public void submitLog (String message , String source , String level ) {
160129 submitEvent (createLog (message , source , level ).build ());
161130 }
@@ -190,10 +159,6 @@ private String getCallingMethod() {
190159 return cameFromOverridenMethod ? traceElements [4 ].getMethodName () : source ;
191160 }
192161
193- public CompletableFuture <Void > submitNotFoundAsync (String resource ) {
194- return CompletableFuture .runAsync (() -> submitNotFound (resource ), executorService );
195- }
196-
197162 public void submitNotFound (String resource ) {
198163 submitEvent (createNotFound (resource ).build ());
199164 }
@@ -202,10 +167,6 @@ public Event.EventBuilder createNotFound(String resource) {
202167 return createEvent ().type (EventType .NOT_FOUND .value ()).source (resource );
203168 }
204169
205- public CompletableFuture <Void > submitSessionStartAsync () {
206- return CompletableFuture .runAsync (this ::submitSessionStart , executorService );
207- }
208-
209170 public void submitSessionStart () {
210171 submitEvent (createSessionStart ().build ());
211172 }
@@ -218,39 +179,19 @@ public Event.EventBuilder createEvent() {
218179 return Event .builder ().dataExclusions (configuration .getDataExclusions ()).date (LocalDate .now ());
219180 }
220181
221- public CompletableFuture <Void > submitEventAsync (Event event ) {
222- return CompletableFuture .runAsync (() -> submitEvent (event ), executorService );
223- }
224-
225182 public void submitEvent (Event event ) {
226183 eventPluginRunner .run (EventPluginContext .from (event ));
227184 }
228185
229- public CompletableFuture <Void > submitEventWithContextAsync (
230- EventPluginContext eventPluginContext ) {
231- return CompletableFuture .runAsync (
232- () -> submitEventWithContext (eventPluginContext ), executorService );
233- }
234-
235186 public void submitEventWithContext (EventPluginContext eventPluginContext ) {
236187 eventPluginRunner .run (eventPluginContext );
237188 }
238189
239- public CompletableFuture <Void > submitSessionEndAsync (String sessionOrUserId ) {
240- return CompletableFuture .runAsync (() -> submitSessionEnd (sessionOrUserId ), executorService );
241- }
242-
243190 public void submitSessionEnd (String sessionOrUserId ) {
244191 log .info (String .format ("Submitting session end: %s" , sessionOrUserId ));
245192 configuration .getSubmissionClient ().sendHeartBeat (sessionOrUserId , true );
246193 }
247194
248- public CompletableFuture <SubmissionResponse > updateEmailAndDescriptionAsync (
249- String referenceId , String email , String description ) {
250- return CompletableFuture .supplyAsync (
251- () -> updateEmailAndDescription (referenceId , email , description ), executorService );
252- }
253-
254195 public SubmissionResponse updateEmailAndDescription (
255196 String referenceId , String email , String description ) {
256197 SubmissionResponse response =
0 commit comments