Search in sources :

Example 36 with Message

use of org.openkilda.messaging.Message in project open-kilda by telstra.

the class SwitchServiceImpl method installRules.

@Override
public List<Long> installRules(String switchId, InstallRulesAction installAction, String correlationId) {
    LOGGER.debug("Install switch rules request received");
    SwitchRulesInstallRequest data = new SwitchRulesInstallRequest(switchId, installAction);
    CommandMessage request = new CommandWithReplyToMessage(data, System.currentTimeMillis(), correlationId, Destination.CONTROLLER, northboundTopic);
    messageProducer.send(floodlightTopic, request);
    Message message = messageConsumer.poll(correlationId);
    SwitchRulesResponse response = (SwitchRulesResponse) validateInfoMessage(request, message, correlationId);
    return response.getRuleIds();
}
Also used : Message(org.openkilda.messaging.Message) CommandMessage(org.openkilda.messaging.command.CommandMessage) CommandWithReplyToMessage(org.openkilda.messaging.command.CommandWithReplyToMessage) SwitchRulesInstallRequest(org.openkilda.messaging.command.switches.SwitchRulesInstallRequest) SwitchRulesResponse(org.openkilda.messaging.info.switches.SwitchRulesResponse) CommandWithReplyToMessage(org.openkilda.messaging.command.CommandWithReplyToMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Example 37 with Message

use of org.openkilda.messaging.Message in project open-kilda by telstra.

the class HeartBeatAction method run.

@Override
public void run() {
    Message message = new org.openkilda.messaging.HeartBeat();
    producer.handle(topic, message);
}
Also used : Message(org.openkilda.messaging.Message)

Example 38 with Message

use of org.openkilda.messaging.Message in project open-kilda by telstra.

the class SwitchEventCollector method switchDeactivated.

/*
     * IFloodlightModule methods.
     */
/**
 * {@inheritDoc}
 */
@Override
public void switchDeactivated(final DatapathId switchId) {
    switchManager.stopSafeMode(switchId);
    Message message = buildSwitchMessage(switchId, SwitchState.DEACTIVATED);
    kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message)

Example 39 with Message

use of org.openkilda.messaging.Message in project open-kilda by telstra.

the class SwitchEventCollector method switchPortChanged.

/**
 * {@inheritDoc}
 */
@Override
public void switchPortChanged(final DatapathId switchId, final OFPortDesc port, final PortChangeType type) {
    if (isPhysicalPort(port.getPortNo())) {
        Message message = buildPortMessage(switchId, port, type);
        kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
    }
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message)

Example 40 with Message

use of org.openkilda.messaging.Message in project open-kilda by telstra.

the class SwitchManager method sendSwitchActivate.

/**
 * {@inheritDoc}
 */
@Override
public void sendSwitchActivate(final IOFSwitch sw) throws SwitchOperationException {
    Message message = SwitchEventCollector.buildSwitchMessage(sw, SwitchState.ACTIVATED);
    kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
}
Also used : OFMessage(org.projectfloodlight.openflow.protocol.OFMessage) Message(org.openkilda.messaging.Message) ErrorMessage(org.openkilda.messaging.error.ErrorMessage)

Aggregations

Message (org.openkilda.messaging.Message)71 CommandMessage (org.openkilda.messaging.command.CommandMessage)55 InfoMessage (org.openkilda.messaging.info.InfoMessage)55 ErrorMessage (org.openkilda.messaging.error.ErrorMessage)29 Test (org.junit.Test)25 IOException (java.io.IOException)11 Values (org.apache.storm.tuple.Values)10 CtrlRequest (org.openkilda.messaging.ctrl.CtrlRequest)6 CtrlResponse (org.openkilda.messaging.ctrl.CtrlResponse)6 FlowIdStatusPayload (org.openkilda.messaging.payload.flow.FlowIdStatusPayload)6 CommandData (org.openkilda.messaging.command.CommandData)5 RequestData (org.openkilda.messaging.ctrl.RequestData)5 FlowResponse (org.openkilda.messaging.info.flow.FlowResponse)5 CommandWithReplyToMessage (org.openkilda.messaging.command.CommandWithReplyToMessage)4 DumpStateResponseData (org.openkilda.messaging.ctrl.DumpStateResponseData)4 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 BaseInstallFlow (org.openkilda.messaging.command.flow.BaseInstallFlow)3 FlowCreateRequest (org.openkilda.messaging.command.flow.FlowCreateRequest)3 FlowGetRequest (org.openkilda.messaging.command.flow.FlowGetRequest)3