use of org.openkilda.messaging.info.event.DeactivateIslInfoData in project open-kilda by telstra.
the class LinkOperationsBolt method deleteLink.
private List<IslInfoData> deleteLink(DeleteLinkRequest request) {
try {
Collection<Isl> operationsResult = linkOperationsService.deleteIsl(request.getSrcSwitch(), request.getSrcPort(), request.getDstSwitch(), request.getDstPort(), request.isForce());
List<IslInfoData> responseResult = operationsResult.stream().map(IslMapper.INSTANCE::map).collect(Collectors.toList());
for (IslInfoData isl : responseResult) {
DeactivateIslInfoData data = new DeactivateIslInfoData(isl.getSource(), isl.getDestination());
getOutput().emit(StreamType.DISCO.toString(), getCurrentTuple(), new Values(data, getCorrelationId()));
}
return responseResult;
} catch (IslNotFoundException e) {
throw new MessageException(ErrorType.NOT_FOUND, e.getMessage(), "ISL was not found.");
} catch (IllegalIslStateException e) {
throw new MessageException(ErrorType.REQUEST_INVALID, e.getMessage(), "ISL is in illegal state.");
}
}
Aggregations