Class HttpServiceDownstreamResponseEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- software.amazon.disco.agent.event.AbstractServiceEvent
-
- software.amazon.disco.agent.event.AbstractServiceResponseEvent
-
- software.amazon.disco.agent.event.ServiceDownstreamResponseEvent
-
- software.amazon.disco.agent.event.HttpServiceDownstreamResponseEvent
-
- All Implemented Interfaces:
Event,ServiceEvent,ServiceResponseEvent
public class HttpServiceDownstreamResponseEvent extends ServiceDownstreamResponseEvent
Specialization of a ServiceDownstreamResponseEvent, to encapsulate data specific to HTTP-like downstream call responses.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.disco.agent.event.ServiceEvent
ServiceEvent.Type
-
-
Field Summary
-
Fields inherited from class software.amazon.disco.agent.event.AbstractEvent
data, origin
-
-
Constructor Summary
Constructors Constructor Description HttpServiceDownstreamResponseEvent(java.lang.String origin, java.lang.String service, java.lang.String operation, ServiceDownstreamRequestEvent requestEvent)Construct a new HttpServiceDownstreamResponseEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetContentLength()Get the content length stored in the EventintgetStatusCode()Get the status code stored in the EventHttpServiceDownstreamResponseEventwithContentLength(long contentLength)Add a contentLength to this EventHttpServiceDownstreamResponseEventwithStatusCode(int statusCode)Add a status code to this Event-
Methods inherited from class software.amazon.disco.agent.event.ServiceDownstreamResponseEvent
getType
-
Methods inherited from class software.amazon.disco.agent.event.AbstractServiceResponseEvent
getRequest, getResponse, getThrown, withResponse, withThrown
-
Methods inherited from class software.amazon.disco.agent.event.AbstractServiceEvent
getOperation, getService
-
Methods inherited from class software.amazon.disco.agent.event.AbstractEvent
getData, getOrigin, withData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.disco.agent.event.ServiceEvent
getOperation, getService
-
-
-
-
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
-
-