use of org.openkilda.messaging.payload.flow.DetectConnectedDevicesPayload in project open-kilda by telstra.
the class FlowMapper method toFlowCreateRequest.
/**
* Map FlowCreatePayload.
*
* @param source {@link FlowCreatePayload} instance.
* @return {@link FlowRequest} instance.
*/
public FlowRequest toFlowCreateRequest(FlowCreatePayload source) {
FlowRequest target = toFlowRequest(source).toBuilder().diverseFlowId(source.getDiverseFlowId()).type(Type.CREATE).build();
if (source.getSource().getDetectConnectedDevices() != null) {
DetectConnectedDevicesPayload srcDevs = source.getSource().getDetectConnectedDevices();
target.getDetectConnectedDevices().setSrcArp(srcDevs.isArp());
target.getDetectConnectedDevices().setSrcLldp(srcDevs.isLldp());
}
if (source.getDestination().getDetectConnectedDevices() != null) {
DetectConnectedDevicesPayload dstDevs = source.getDestination().getDetectConnectedDevices();
target.getDetectConnectedDevices().setDstArp(dstDevs.isArp());
target.getDetectConnectedDevices().setDstLldp(dstDevs.isLldp());
}
return target;
}
use of org.openkilda.messaging.payload.flow.DetectConnectedDevicesPayload in project open-kilda by telstra.
the class FlowMapper method toFlowUpdateRequest.
/**
* Map FlowUpdatePayload.
*
* @param source {@link FlowUpdatePayload} instance.
* @return {@link FlowRequest} instance.
*/
public FlowRequest toFlowUpdateRequest(FlowUpdatePayload source) {
FlowRequest target = toFlowRequest(source).toBuilder().diverseFlowId(source.getDiverseFlowId()).type(Type.UPDATE).build();
if (source.getSource().getDetectConnectedDevices() != null) {
DetectConnectedDevicesPayload srcDevs = source.getSource().getDetectConnectedDevices();
target.getDetectConnectedDevices().setSrcArp(srcDevs.isArp());
target.getDetectConnectedDevices().setSrcLldp(srcDevs.isLldp());
}
if (source.getDestination().getDetectConnectedDevices() != null) {
DetectConnectedDevicesPayload dstDevs = source.getDestination().getDetectConnectedDevices();
target.getDetectConnectedDevices().setDstArp(dstDevs.isArp());
target.getDetectConnectedDevices().setDstLldp(dstDevs.isLldp());
}
return target;
}
Aggregations