use of org.openkilda.model.BfdProperties in project open-kilda by telstra.
the class IslMapper method map.
/**
* Convert {@link Isl} to {@link IslInfoData}.
*/
public IslInfoData map(Isl isl) {
if (isl == null) {
return null;
}
PathNode src = new PathNode();
src.setSwitchId(isl.getSrcSwitchId());
src.setPortNo(isl.getSrcPort());
src.setSegLatency(isl.getLatency());
src.setSeqId(0);
PathNode dst = new PathNode();
dst.setSwitchId(isl.getDestSwitchId());
dst.setPortNo(isl.getDestPort());
dst.setSegLatency(isl.getLatency());
dst.setSeqId(1);
Long timeCreateMillis = Optional.ofNullable(isl.getTimeCreate()).map(Instant::toEpochMilli).orElse(null);
Long timeModifyMillis = Optional.ofNullable(isl.getTimeModify()).map(Instant::toEpochMilli).orElse(null);
BfdProperties bfdProperties = readBfdProperties(isl);
return new IslInfoData(isl.getLatency(), src, dst, isl.getSpeed(), isl.getAvailableBandwidth(), isl.getMaxBandwidth(), isl.getDefaultMaxBandwidth(), map(isl.getStatus()), map(isl.getActualStatus()), map(isl.getRoundTripStatus()), isl.getCost(), timeCreateMillis, timeModifyMillis, isl.isUnderMaintenance(), bfdProperties.isEnabled(), map(isl.getBfdSessionStatus()), null);
}
Aggregations