Package io.testproject.sdk.internal.rest
Class ReportsQueue
- java.lang.Object
-
- io.testproject.sdk.internal.rest.ReportsQueue
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
ReportsQueueBatch
public class ReportsQueue extends java.lang.Object implements java.lang.RunnableA runnable class to manage reports queue.
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.google.gson.GsonGSONAn instance of the Google JSON serializer to serialize and deserialize objects.protected static intMAX_REPORT_FAILURE_ATTEMPTSMaximum attempts to try sending a report to the Agent.
-
Constructor Summary
Constructors Constructor Description ReportsQueue(org.apache.http.impl.client.CloseableHttpClient httpClient, java.lang.String sessionId)Initializes a new instance of the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.http.impl.client.CloseableHttpClientgetHttpClient()Getter method forhttpClient.protected java.util.concurrent.LinkedBlockingQueue<io.testproject.sdk.internal.rest.ReportsQueue.QueueItem>getQueue()Getter method forqueue.voidrun()Runnable flow that looks into the queue and waits for new items.voidstop()Stops the runnable and the queue processing.
-
-
-
Field Detail
-
GSON
protected static final com.google.gson.Gson GSON
An instance of the Google JSON serializer to serialize and deserialize objects.
-
MAX_REPORT_FAILURE_ATTEMPTS
protected static final int MAX_REPORT_FAILURE_ATTEMPTS
Maximum attempts to try sending a report to the Agent.- See Also:
- Constant Field Values
-
-
Method Detail
-
getQueue
protected java.util.concurrent.LinkedBlockingQueue<io.testproject.sdk.internal.rest.ReportsQueue.QueueItem> getQueue()
Getter method forqueue.- Returns:
- the reports queue.
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient()
Getter method forhttpClient.- Returns:
- the httpClient.
-
run
public void run()
Runnable flow that looks into the queue and waits for new items.- Specified by:
runin interfacejava.lang.Runnable
-
stop
public void stop()
Stops the runnable and the queue processing.
-
-