Search in sources :

Example 1 with InstallIslDefaultRulesResult

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;
}
Also used : Isl(org.openkilda.model.Isl) IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder) InstallIslDefaultRulesResult(org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult)

Example 2 with InstallIslDefaultRulesResult

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()));
}
Also used : SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) InfoMessage(org.openkilda.messaging.info.InfoMessage) InstallIslDefaultRulesCommand(org.openkilda.messaging.payload.switches.InstallIslDefaultRulesCommand) DatapathId(org.projectfloodlight.openflow.types.DatapathId) InstallIslDefaultRulesResult(org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult)

Aggregations

InstallIslDefaultRulesResult (org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult)2 SwitchOperationException (org.openkilda.floodlight.error.SwitchOperationException)1 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 InstallIslDefaultRulesCommand (org.openkilda.messaging.payload.switches.InstallIslDefaultRulesCommand)1 Isl (org.openkilda.model.Isl)1 IslReference (org.openkilda.wfm.share.model.IslReference)1 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)1 DatapathId (org.projectfloodlight.openflow.types.DatapathId)1