use of org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult in project open-kilda by telstra.
the class NetworkIslServiceTest method prepareActiveIsl.
private IslReference prepareActiveIsl(boolean isMultitable) {
// prepare data
final Isl islAlphaBeta = makeIsl(endpointAlpha1, endpointBeta2, isMultitable).build();
final Isl islBetaAlpha = makeIsl(endpointBeta2, endpointAlpha1, isMultitable).build();
// setup alpha -> beta half
IslReference reference = new IslReference(endpointAlpha1, endpointBeta2);
service.islUp(endpointAlpha1, reference, new IslDataHolder(islAlphaBeta));
verifyNoMoreInteractions(dashboardLogger);
// setup beta -> alpha half
service.islUp(endpointBeta2, reference, new IslDataHolder(islBetaAlpha));
if (isMultitable) {
service.islDefaultRuleInstalled(reference, new InstallIslDefaultRulesResult(endpointAlpha1.getDatapath(), endpointAlpha1.getPortNumber(), endpointBeta2.getDatapath(), endpointBeta2.getPortNumber(), true));
service.islDefaultRuleInstalled(reference, new InstallIslDefaultRulesResult(endpointBeta2.getDatapath(), endpointBeta2.getPortNumber(), endpointAlpha1.getDatapath(), endpointAlpha1.getPortNumber(), true));
}
verify(dashboardLogger).onIslUp(eq(reference), any());
reset(dashboardLogger);
reset(carrier);
return reference;
}
use of org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult in project open-kilda by telstra.
the class RecordHandler method doInstallIslDefaultRule.
private void doInstallIslDefaultRule(CommandMessage message) {
InstallIslDefaultRulesCommand toSetup = (InstallIslDefaultRulesCommand) message.getData();
InstallIslDefaultRulesResult result = new InstallIslDefaultRulesResult(toSetup.getSrcSwitch(), toSetup.getSrcPort(), toSetup.getDstSwitch(), toSetup.getDstPort(), true);
DatapathId dpid = DatapathId.of(toSetup.getSrcSwitch().toLong());
try {
if (toSetup.isMultitableMode()) {
context.getSwitchManager().installMultitableEndpointIslRules(dpid, toSetup.getSrcPort());
}
if (toSetup.isServer42IslRtt()) {
context.getSwitchManager().installServer42IslRttInputFlow(dpid, toSetup.getServer42Port(), toSetup.getSrcPort());
}
} catch (SwitchOperationException e) {
logger.error("Failed to install isl rules for switch: '{}'", toSetup.getSrcSwitch(), e);
result.setSuccess(false);
}
getKafkaProducer().sendMessageAndTrack(context.getKafkaSwitchManagerTopic(), record.key(), new InfoMessage(result, System.currentTimeMillis(), message.getCorrelationId(), context.getRegion()));
}
Aggregations