class StopTelemetryHandler implements EventHandler<StopTelemetryRequest> {

    @Override
    public void accept(Event<StopTelemetryRequest> event) {
        StopTelemetryRequest request = event.getData();
        LOGGER.info("Stop telemetry agents gracefully (if needed)...");
        telemetryAgentService.stopTelemetryAgent(request.getResourceId(), request.getInstanceIds());
        StopTelemetryResponse response = new StopTelemetryResponse(request.getResourceId());
        eventBus.notify(EventSelectorUtil.selector(StopTelemetryResponse.class),
                new Event<>(event.getHeaders(), response));
    }

}