Class ReportsQueue

  • All Implemented Interfaces:
    java.lang.Runnable
    Direct Known Subclasses:
    ReportsQueueBatch

    public class ReportsQueue
    extends java.lang.Object
    implements java.lang.Runnable
    A runnable class to manage reports queue.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static com.google.gson.Gson GSON
      An instance of the Google JSON serializer to serialize and deserialize objects.
      protected static int MAX_REPORT_FAILURE_ATTEMPTS
      Maximum 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.CloseableHttpClient getHttpClient()
      Getter method for httpClient.
      protected java.util.concurrent.LinkedBlockingQueue<io.testproject.sdk.internal.rest.ReportsQueue.QueueItem> getQueue()
      Getter method for queue.
      void run()
      Runnable flow that looks into the queue and waits for new items.
      void stop()
      Stops the runnable and the queue processing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • ReportsQueue

        public ReportsQueue​(org.apache.http.impl.client.CloseableHttpClient httpClient,
                            java.lang.String sessionId)
        Initializes a new instance of the class.
        Parameters:
        httpClient - HTTP client ot use for communicating with the Agent.
        sessionId - Driver session ID.
    • Method Detail

      • getQueue

        protected java.util.concurrent.LinkedBlockingQueue<io.testproject.sdk.internal.rest.ReportsQueue.QueueItem> getQueue()
        Getter method for queue.
        Returns:
        the reports queue.
      • getHttpClient

        protected org.apache.http.impl.client.CloseableHttpClient getHttpClient()
        Getter method for httpClient.
        Returns:
        the httpClient.
      • run

        public void run()
        Runnable flow that looks into the queue and waits for new items.
        Specified by:
        run in interface java.lang.Runnable
      • stop

        public void stop()
        Stops the runnable and the queue processing.