Class AbstractServiceResponseEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- software.amazon.disco.agent.event.AbstractServiceEvent
-
- software.amazon.disco.agent.event.AbstractServiceResponseEvent
-
- All Implemented Interfaces:
Event,ServiceEvent,ServiceResponseEvent
- Direct Known Subclasses:
ServiceActivityResponseEvent,ServiceDownstreamResponseEvent
public abstract class AbstractServiceResponseEvent extends AbstractServiceEvent implements ServiceResponseEvent
Base class for service responses, whether from an activity or a downstream
-
-
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 AbstractServiceResponseEvent(java.lang.String origin, java.lang.String service, java.lang.String operation, ServiceRequestEvent requestEvent)Construct a new AbstractServiceResponseEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceRequestEventgetRequest()Get the associated request eventjava.lang.ObjectgetResponse()Get the response objectjava.lang.ThrowablegetThrown()Get the thrown exceptionAbstractServiceResponseEventwithResponse(java.lang.Object response)Add a response object to this eventAbstractServiceResponseEventwithThrown(java.lang.Throwable thrown)Add a thrown exception to this event-
Methods inherited from class software.amazon.disco.agent.event.AbstractServiceEvent
getOperation, getService, getType
-
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, getType
-
-
-
-
Constructor Detail
-
AbstractServiceResponseEvent
public AbstractServiceResponseEvent(java.lang.String origin, java.lang.String service, java.lang.String operation, ServiceRequestEvent requestEvent)Construct a new AbstractServiceResponseEvent- Parameters:
origin- the origin of the eventservice- the service name e.g. 'WeatherService'operation- the operation name e.g. 'getWeather'requestEvent- the associated request event
-
-
Method Detail
-
withResponse
public AbstractServiceResponseEvent withResponse(java.lang.Object response)
Add a response object to this event- Parameters:
response- the response object- Returns:
- the 'this' for method chaining
-
withThrown
public AbstractServiceResponseEvent withThrown(java.lang.Throwable thrown)
Add a thrown exception to this event- Parameters:
thrown- the thrown exception- Returns:
- the 'this' for method chaining
-
getRequest
public ServiceRequestEvent getRequest()
Get the associated request event- Specified by:
getRequestin interfaceServiceResponseEvent- Returns:
- the request object
-
getResponse
public java.lang.Object getResponse()
Get the response object- Specified by:
getResponsein interfaceServiceResponseEvent- Returns:
- the response object
-
getThrown
public java.lang.Throwable getThrown()
Get the thrown exception- Specified by:
getThrownin interfaceServiceResponseEvent- Returns:
- the thrown exception
-
-