Search in sources :

Example 1 with GetSwitchInfoRequest

use of org.openkilda.messaging.command.grpc.GetSwitchInfoRequest in project open-kilda by telstra.

the class MessageProcessor method handleCommandMessage.

private void handleCommandMessage(CommandMessage command, String key) {
    CommandData data = command.getData();
    String correlationId = command.getCorrelationId();
    CompletableFuture<Response> result;
    if (data instanceof CreateLogicalPortRequest) {
        result = handleCreateLogicalPortRequest((CreateLogicalPortRequest) data);
    } else if (data instanceof DumpLogicalPortsRequest) {
        result = handleDumpLogicalPortsRequest((DumpLogicalPortsRequest) data);
    } else if (data instanceof GetSwitchInfoRequest) {
        result = handleGetSwitchInfoRequest((GetSwitchInfoRequest) data);
    } else if (data instanceof GetPacketInOutStatsRequest) {
        result = handleGetPacketInOutStatsRequest((GetPacketInOutStatsRequest) data);
    } else if (data instanceof DeleteLogicalPortRequest) {
        result = handleDeleteLogicalPortRequest((DeleteLogicalPortRequest) data);
    } else {
        result = unhandledMessage(command);
    }
    result.thenAccept(response -> sendResponse(response, correlationId, key));
}
Also used : GetSwitchInfoResponse(org.openkilda.messaging.info.grpc.GetSwitchInfoResponse) CreateLogicalPortResponse(org.openkilda.messaging.info.grpc.CreateLogicalPortResponse) GetPacketInOutStatsResponse(org.openkilda.messaging.info.grpc.GetPacketInOutStatsResponse) DeleteLogicalPortResponse(org.openkilda.messaging.info.grpc.DeleteLogicalPortResponse) DumpLogicalPortsResponse(org.openkilda.messaging.info.grpc.DumpLogicalPortsResponse) DeleteLogicalPortRequest(org.openkilda.messaging.command.grpc.DeleteLogicalPortRequest) GetSwitchInfoRequest(org.openkilda.messaging.command.grpc.GetSwitchInfoRequest) DumpLogicalPortsRequest(org.openkilda.messaging.command.grpc.DumpLogicalPortsRequest) GetPacketInOutStatsRequest(org.openkilda.messaging.command.grpc.GetPacketInOutStatsRequest) CommandData(org.openkilda.messaging.command.CommandData) CreateLogicalPortRequest(org.openkilda.messaging.command.grpc.CreateLogicalPortRequest)

Aggregations

CommandData (org.openkilda.messaging.command.CommandData)1 CreateLogicalPortRequest (org.openkilda.messaging.command.grpc.CreateLogicalPortRequest)1 DeleteLogicalPortRequest (org.openkilda.messaging.command.grpc.DeleteLogicalPortRequest)1 DumpLogicalPortsRequest (org.openkilda.messaging.command.grpc.DumpLogicalPortsRequest)1 GetPacketInOutStatsRequest (org.openkilda.messaging.command.grpc.GetPacketInOutStatsRequest)1 GetSwitchInfoRequest (org.openkilda.messaging.command.grpc.GetSwitchInfoRequest)1 CreateLogicalPortResponse (org.openkilda.messaging.info.grpc.CreateLogicalPortResponse)1 DeleteLogicalPortResponse (org.openkilda.messaging.info.grpc.DeleteLogicalPortResponse)1 DumpLogicalPortsResponse (org.openkilda.messaging.info.grpc.DumpLogicalPortsResponse)1 GetPacketInOutStatsResponse (org.openkilda.messaging.info.grpc.GetPacketInOutStatsResponse)1 GetSwitchInfoResponse (org.openkilda.messaging.info.grpc.GetSwitchInfoResponse)1