Class StatisticsClient

  • All Implemented Interfaces:
    Statistics, java.io.Closeable, java.lang.AutoCloseable

    public class StatisticsClient
    extends java.lang.Object
    implements Statistics
    Statistics backend service asynchronous client. Require resource identifier by provided `trackingId` for sending statistics event.
    • Constructor Summary

      Constructors 
      Constructor Description
      StatisticsClient​(java.lang.String measurementId, java.lang.String apiSecret, ListenerParameters parameters)
      Create an instance of the client, construct own HTTP client by given parameters
      StatisticsClient​(java.lang.String measurementId, java.lang.String apiSecret, StatisticsApiClient statisticsApiClient)
      Create an instance of the client with given HTTP client
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      io.reactivex.Maybe<retrofit2.Response<okhttp3.ResponseBody>> send​(StatisticsItem item)
      Convert and send StatisticsItem to backend statistics service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StatisticsClient

        public StatisticsClient​(java.lang.String measurementId,
                                java.lang.String apiSecret,
                                ListenerParameters parameters)
        Create an instance of the client, construct own HTTP client by given parameters
        Parameters:
        measurementId - ID of the statistics resource
        apiSecret - API Secret Key
        parameters - ListenerParameters ReportPortal parameters
      • StatisticsClient

        public StatisticsClient​(java.lang.String measurementId,
                                java.lang.String apiSecret,
                                StatisticsApiClient statisticsApiClient)
        Create an instance of the client with given HTTP client
        Parameters:
        measurementId - ID of the statistics resource
        apiSecret - API Secret Key
        statisticsApiClient - StatisticsApiClient instance
    • Method Detail

      • send

        public io.reactivex.Maybe<retrofit2.Response<okhttp3.ResponseBody>> send​(StatisticsItem item)
        Convert and send StatisticsItem to backend statistics service. Quietly consumes exceptions to not affect reporting flow
        Specified by:
        send in interface Statistics
        Parameters:
        item - StatisticsItem
        Returns:
        true - if successfully send, otherwise - false wrapped in the Maybe
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable