Class HttpServiceDownstreamResponseEvent

    • Constructor Detail

      • HttpServiceDownstreamResponseEvent

        public HttpServiceDownstreamResponseEvent​(java.lang.String origin,
                                                  java.lang.String service,
                                                  java.lang.String operation,
                                                  ServiceDownstreamRequestEvent requestEvent)
        Construct a new HttpServiceDownstreamResponseEvent
        Parameters:
        origin - the origin of the downstream call e.g. 'Web' or 'gRPC'
        service - the service name e.g. 'WeatherService'
        operation - the operation name e.g. 'getWeather'
        requestEvent - the associated request event
    • Method Detail

      • withStatusCode

        public HttpServiceDownstreamResponseEvent withStatusCode​(int statusCode)
        Add a status code to this Event
        Parameters:
        statusCode - the HTTP status code
        Returns:
        'this' for method chaining
      • withContentLength

        public HttpServiceDownstreamResponseEvent withContentLength​(long contentLength)
        Add a contentLength to this Event
        Parameters:
        contentLength - the HTTP content-length
        Returns:
        'this' for method chaining
      • getStatusCode

        public int getStatusCode()
        Get the status code stored in the Event
        Returns:
        the HTTP status code, or -1 if not available
      • getContentLength

        public long getContentLength()
        Get the content length stored in the Event
        Returns:
        the HTTP content length, or -1 if not available