Class HttpServiceDownstreamRequestEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- software.amazon.disco.agent.event.AbstractServiceEvent
-
- software.amazon.disco.agent.event.AbstractServiceRequestEvent
-
- software.amazon.disco.agent.event.ServiceDownstreamRequestEvent
-
- software.amazon.disco.agent.event.HttpServiceDownstreamRequestEvent
-
- All Implemented Interfaces:
Event,ServiceEvent,ServiceRequestEvent
public class HttpServiceDownstreamRequestEvent extends ServiceDownstreamRequestEvent
Specialization of a ServiceDownstreamRequestEvent, to encapsulate data specific to HTTP-like downstream call requests.
-
-
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 HttpServiceDownstreamRequestEvent(java.lang.String origin, java.lang.String service, java.lang.String operation)Construct a new HttpServiceDownstreamRequestEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetMethod()Get the HTTP method from the eventjava.lang.StringgetUri()Get the URI from the eventbooleanreplaceHeader(java.lang.String name, java.lang.String value)This method is deprecated.HttpServiceDownstreamRequestEventwithMethod(java.lang.String method)Set the HTTP method in this eventHttpServiceDownstreamRequestEventwithUri(java.lang.String uri)Set the URI in this event-
Methods inherited from class software.amazon.disco.agent.event.ServiceDownstreamRequestEvent
getType
-
Methods inherited from class software.amazon.disco.agent.event.AbstractServiceRequestEvent
getRequest, withRequest
-
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
-
HttpServiceDownstreamRequestEvent
public HttpServiceDownstreamRequestEvent(java.lang.String origin, java.lang.String service, java.lang.String operation)Construct a new HttpServiceDownstreamRequestEvent- 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'
-
-
Method Detail
-
withMethod
public HttpServiceDownstreamRequestEvent withMethod(java.lang.String method)
Set the HTTP method in this event- Parameters:
method- the method e.g. GET, POST etc- Returns:
- 'this' for method chaining
-
withUri
public HttpServiceDownstreamRequestEvent withUri(java.lang.String uri)
Set the URI in this event- Parameters:
uri- the URI- Returns:
- 'this' for method chaining
-
getMethod
public java.lang.String getMethod()
Get the HTTP method from the event- Returns:
- the HTTP method
-
getUri
public java.lang.String getUri()
Get the URI from the event- Returns:
- the URI
-
replaceHeader
public boolean replaceHeader(java.lang.String name, java.lang.String value)This method is deprecated. If you are authoring a Disco Event and would like to override this method, implementHeaderReplaceableinstead. If you are invoking replaceHeader, you should invoke it from its implementing event class or by casting toHeaderReplaceableinstead of invoking it from this class.- Parameters:
name- the header namevalue- the header value- Returns:
- true if successful
-
-