Interface CommunicationProblemListener


  • public interface CommunicationProblemListener
    Interface definition for a callback to be invoked when the agent was not able to successfully communicate with the beacon endpoint.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onError​(Throwable throwable)
      called when the agent was not able to receive an http response.
      void onFailure​(int responseCode, String responseMessage, String body)
      called when the agent successfully received an http response, but the response is invalid.
    • Method Detail

      • onFailure

        void onFailure​(int responseCode,
                       String responseMessage,
                       String body)
        called when the agent successfully received an http response, but the response is invalid. In this case the agent does not automatically reconnect to the beacon endpoint. Adjust the agent configuration with Dynatrace.setBeaconHeaders(Map) and the agent will send a new http request (with the specified headers) to the beacon endpoint.
        Parameters:
        responseCode - status code from the received http response
        responseMessage - message from the received http response
        body - the body from the received http response
        See Also:
        Dynatrace.setBeaconHeaders(Map)
      • onError

        void onError​(Throwable throwable)
        called when the agent was not able to receive an http response. In this case the agent will wait a certain amount of time and then tries to reconnect to the beacon endpoint.
        Parameters:
        throwable - the reason why the agent was not able receive an http response
        See Also:
        HttpURLConnection