Search in sources :

Example 1 with InstallMissedFlowsRequest

use of org.openkilda.messaging.command.switches.InstallMissedFlowsRequest in project open-kilda by telstra.

the class RecordHandler method doSyncRulesRequest.

/**
 * Installs missed flows on the switch.
 * @param message with list of flows.
 */
private void doSyncRulesRequest(final CommandMessage message) {
    InstallMissedFlowsRequest request = (InstallMissedFlowsRequest) message.getData();
    final String switchId = request.getSwitchId();
    logger.debug("Processing rules to be updated for switch {}", switchId);
    for (BaseInstallFlow command : request.getFlowCommands()) {
        logger.debug("Processing command for switch {} {}", switchId, command);
        try {
            if (command instanceof InstallIngressFlow) {
                installIngressFlow((InstallIngressFlow) command);
            } else if (command instanceof InstallEgressFlow) {
                installEgressFlow((InstallEgressFlow) command);
            } else if (command instanceof InstallTransitFlow) {
                installTransitFlow((InstallTransitFlow) command);
            } else if (command instanceof InstallOneSwitchFlow) {
                installOneSwitchFlow((InstallOneSwitchFlow) command);
            }
        } catch (SwitchOperationException e) {
            logger.error("Error during flow installation", e);
        }
    }
}
Also used : InstallIngressFlow(org.openkilda.messaging.command.flow.InstallIngressFlow) SwitchOperationException(org.openkilda.floodlight.switchmanager.SwitchOperationException) InstallTransitFlow(org.openkilda.messaging.command.flow.InstallTransitFlow) InstallMissedFlowsRequest(org.openkilda.messaging.command.switches.InstallMissedFlowsRequest) InstallOneSwitchFlow(org.openkilda.messaging.command.flow.InstallOneSwitchFlow) BaseInstallFlow(org.openkilda.messaging.command.flow.BaseInstallFlow) InstallEgressFlow(org.openkilda.messaging.command.flow.InstallEgressFlow)

Aggregations

SwitchOperationException (org.openkilda.floodlight.switchmanager.SwitchOperationException)1 BaseInstallFlow (org.openkilda.messaging.command.flow.BaseInstallFlow)1 InstallEgressFlow (org.openkilda.messaging.command.flow.InstallEgressFlow)1 InstallIngressFlow (org.openkilda.messaging.command.flow.InstallIngressFlow)1 InstallOneSwitchFlow (org.openkilda.messaging.command.flow.InstallOneSwitchFlow)1 InstallTransitFlow (org.openkilda.messaging.command.flow.InstallTransitFlow)1 InstallMissedFlowsRequest (org.openkilda.messaging.command.switches.InstallMissedFlowsRequest)1