use of org.openkilda.server42.control.messaging.flowrtt.Headers in project open-kilda by telstra.
the class FlowHandler method notifyDeactivateFlowMonitoring.
@Override
public void notifyDeactivateFlowMonitoring(SwitchId switchId, String flowId, boolean isForward) {
RemoveFlow removeFlow = RemoveFlow.builder().flowId(flowId).headers(buildHeader()).direction(isForward ? FlowDirection.FORWARD : FlowDirection.REVERSE).build();
emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), removeFlow));
}
use of org.openkilda.server42.control.messaging.flowrtt.Headers in project open-kilda by telstra.
the class IslHandler method notifyActivateIslMonitoring.
@Override
public void notifyActivateIslMonitoring(SwitchId switchId, int port) {
AddIsl addIsl = AddIsl.builder().headers(buildHeader()).switchId(switchId).port(port).build();
emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), addIsl));
}
use of org.openkilda.server42.control.messaging.flowrtt.Headers in project open-kilda by telstra.
the class KafkaController method getIslList.
@GetMapping(value = "/isl")
@ResponseBody
private DeferredResult<ResponseEntity<?>> getIslList(@RequestParam String switchId) throws InterruptedException, ExecutionException, TimeoutException {
Headers headers = buildHeader();
String correlationId = headers.getCorrelationId();
send(switchId, ListIslsRequest.builder().headers(headers).switchId(new SwitchId(switchId)).build());
DeferredResult<ResponseEntity<?>> deferredResult = new DeferredResult<>(500L);
deferredResult.onTimeout(() -> {
deferredResult.setErrorResult(ResponseEntity.status(HttpStatus.REQUEST_TIMEOUT).body("Request timeout occurred."));
deferredResultConcurrentHashMap.remove(correlationId);
});
deferredResult.onCompletion(() -> deferredResultConcurrentHashMap.remove(correlationId));
deferredResult.onError((Throwable throwable) -> {
deferredResult.setErrorResult(ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(throwable));
deferredResultConcurrentHashMap.remove(correlationId);
});
deferredResultConcurrentHashMap.put(correlationId, deferredResult);
return deferredResult;
}
use of org.openkilda.server42.control.messaging.flowrtt.Headers in project open-kilda by telstra.
the class IslHandler method sendListOfIslPortsBySwitchId.
@Override
public void sendListOfIslPortsBySwitchId(SwitchId switchId, Set<Integer> islPorts) {
ListIslPortsOnSwitch listIslPortsOnSwitch = ListIslPortsOnSwitch.builder().headers(buildHeader()).switchId(switchId).islPorts(islPorts).build();
emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), listIslPortsOnSwitch));
}
use of org.openkilda.server42.control.messaging.flowrtt.Headers in project open-kilda by telstra.
the class IslHandler method processDeactivateIslMonitoringOnSwitch.
/**
* Deactivate monitoring for ISLs on provided switch.
*
* @param switchId specify the ISL endpoint.
*/
public void processDeactivateIslMonitoringOnSwitch(SwitchId switchId) {
ClearIsls clearIsls = ClearIsls.builder().headers(buildHeader()).switchId(switchId).build();
emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), clearIsls));
}
Aggregations