Search in sources :

Example 1 with FlowCacheSyncResponse

use of org.openkilda.messaging.info.flow.FlowCacheSyncResponse in project open-kilda by telstra.

the class FlowServiceImpl method syncFlowCache.

/**
 * {@inheritDoc}
 */
@Override
public FlowCacheSyncResults syncFlowCache(final String correlationId) {
    LOGGER.debug("Flow cache sync: {}={}", CORRELATION_ID, correlationId);
    FlowCacheSyncRequest data = new FlowCacheSyncRequest();
    CommandMessage request = new CommandMessage(data, System.currentTimeMillis(), correlationId, Destination.WFM);
    messageConsumer.clear();
    messageProducer.send(topic, request);
    Message message = (Message) messageConsumer.poll(correlationId);
    FlowCacheSyncResponse response = (FlowCacheSyncResponse) validateInfoMessage(request, message, correlationId);
    return response.getPayload();
}
Also used : FlowCacheSyncResponse(org.openkilda.messaging.info.flow.FlowCacheSyncResponse) InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) CommandMessage(org.openkilda.messaging.command.CommandMessage) FlowCacheSyncRequest(org.openkilda.messaging.command.flow.FlowCacheSyncRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

Message (org.openkilda.messaging.Message)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 FlowCacheSyncRequest (org.openkilda.messaging.command.flow.FlowCacheSyncRequest)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 FlowCacheSyncResponse (org.openkilda.messaging.info.flow.FlowCacheSyncResponse)1