Class AbstractServiceEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- software.amazon.disco.agent.event.AbstractServiceEvent
-
- All Implemented Interfaces:
Event,ServiceEvent
- Direct Known Subclasses:
AbstractServiceCancellationEvent,AbstractServiceRequestEvent,AbstractServiceResponseEvent
public abstract class AbstractServiceEvent extends AbstractEvent implements ServiceEvent
Base class for service events both Activities (my service is handling a request) and Downstream (I am calling another Service) A 'Service' in the downstream sense may not necessarily be a remote endpoint in the sense of a REST service etc. It could be an in-process client for e.g. a Cache. It means a service in the sense of anything with an API, whether that is remote or local.
-
-
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 AbstractServiceEvent(java.lang.String origin, java.lang.String service, java.lang.String operation)Constructor for a ServiceEvent
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetOperation()Get the operation namejava.lang.StringgetService()Get the service nameabstract ServiceEvent.TypegetType()Get the type of this ServiceEvent-
Methods inherited from class software.amazon.disco.agent.event.AbstractEvent
getData, getOrigin, withData
-
-
-
-
Constructor Detail
-
AbstractServiceEvent
public AbstractServiceEvent(java.lang.String origin, java.lang.String service, java.lang.String operation)Constructor for a ServiceEvent- Parameters:
origin- the origin of this event e.g. 'Web' or 'gRPC'service- the service name e.g. WeatherServiceoperation- the operation name e.g getWeather
-
-
Method Detail
-
getService
public java.lang.String getService()
Get the service name- Specified by:
getServicein interfaceServiceEvent- Returns:
- the service name e.g. 'WeatherService'
-
getOperation
public java.lang.String getOperation()
Get the operation name- Specified by:
getOperationin interfaceServiceEvent- Returns:
- the operation name e.g. 'getWeather'
-
getType
public abstract ServiceEvent.Type getType()
Get the type of this ServiceEvent- Specified by:
getTypein interfaceServiceEvent- Returns:
- either ACTIVITY or DOWNSTREAM
-
-