use of org.openkilda.wfm.CommandContext in project open-kilda by telstra.
the class ControllerToSpeakerProxyBoltTest method injectRegionUpdate.
private void injectRegionUpdate(RegionMappingUpdate update) {
Tuple input = new TupleImpl(generalTopologyContext, new Values(update, new CommandContext()), SWITCH_MONITOR_BOLT, RegionTrackerBolt.STREAM_REGION_NOTIFICATION_ID);
subject.execute(input);
verify(outputCollector).ack(eq(input));
}
use of org.openkilda.wfm.CommandContext in project open-kilda by telstra.
the class ControllerToSpeakerProxyBoltTest method injectLifecycleEventUpdate.
private void injectLifecycleEventUpdate(Signal signal) {
LifecycleEvent event = LifecycleEvent.builder().signal(signal).build();
Tuple input = new TupleImpl(generalTopologyContext, new Values(event, new CommandContext()), ZOOKEEPER_SPOUT, STREAM_SPOUT_DEFAULT);
subject.execute(input);
verify(outputCollector).ack(eq(input));
}
use of org.openkilda.wfm.CommandContext in project open-kilda by telstra.
the class SpeakerToNetworkProxyBoltTest method injectLifecycleEventUpdate.
private void injectLifecycleEventUpdate(Signal signal) {
LifecycleEvent event = LifecycleEvent.builder().signal(signal).build();
Tuple input = new TupleImpl(generalTopologyContext, new Values(event, new CommandContext()), ZOOKEEPER_SPOUT, STREAM_SPOUT_DEFAULT);
subject.execute(input);
verify(outputCollector).ack(eq(input));
}
use of org.openkilda.wfm.CommandContext in project open-kilda by telstra.
the class FlowSwapEndpointsHubBolt method sendFlowUpdateRequest.
@Override
public void sendFlowUpdateRequest(FlowRequest flowRequest) {
String childKey = KeyProvider.generateChainedKey(currentKey);
CommandContext commandContext = getCommandContext();
CommandMessage commandMessage = new CommandMessage(flowRequest, commandContext.getCreateTime(), childKey);
emit(Stream.SWAP_ENDPOINTS_HUB_TO_ROUTER_BOLT.name(), getCurrentTuple(), new Values(childKey, commandMessage, new CommandContext(commandMessage)));
}
use of org.openkilda.wfm.CommandContext in project open-kilda by telstra.
the class EmitUpdateRulesRequestsAction method buildCommands.
private Collection<FlowSegmentRequestFactory> buildCommands(FlowMirrorPointCreateFsm stateMachine, Flow flow) {
final FlowCommandBuilder commandBuilder = commandBuilderFactory.getBuilder(flow.getEncapsulationType());
PathId flowPathId = stateMachine.getFlowPathId();
FlowPath path = flow.getPath(flowPathId).orElseThrow(() -> new FlowProcessingException(ErrorType.NOT_FOUND, format("Flow path %s not found", flowPathId)));
PathId oppositePathId = flow.getOppositePathId(flowPathId).orElseThrow(() -> new FlowProcessingException(ErrorType.NOT_FOUND, format("Opposite flow path id for path %s not found", flowPathId)));
FlowPath oppositePath = flow.getPath(oppositePathId).orElse(null);
RequestedFlowMirrorPoint mirrorPoint = stateMachine.getRequestedFlowMirrorPoint();
CommandContext context = stateMachine.getCommandContext();
SpeakerRequestBuildContext speakerContext = buildBaseSpeakerContextForInstall(path.getSrcSwitchId(), path.getDestSwitchId());
if (mirrorPoint.getMirrorPointSwitchId().equals(path.getSrcSwitchId())) {
return new ArrayList<>(commandBuilder.buildIngressOnlyOneDirection(context, flow, path, oppositePath, speakerContext.getForward(), MirrorContext.builder().buildMirrorFactoryOnly(true).addNewGroup(stateMachine.isAddNewGroup()).build()));
} else if (mirrorPoint.getMirrorPointSwitchId().equals(path.getDestSwitchId())) {
return new ArrayList<>(commandBuilder.buildEgressOnlyOneDirection(context, flow, path, oppositePath, MirrorContext.builder().buildMirrorFactoryOnly(true).addNewGroup(stateMachine.isAddNewGroup()).build()));
}
return Collections.emptyList();
}
Aggregations