Search in sources :

Example 1 with DumpLogicalPortsRequest

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

the class SwitchValidateFsm method requestLogicalPorts.

private void requestLogicalPorts(String ipAddress) {
    SwitchId switchId = getSwitchId();
    log.info("Sending request to get switch logical ports. IP {} (switch={}, key={})", ipAddress, switchId, key);
    carrier.sendCommandToSpeaker(key, new DumpLogicalPortsRequest(ipAddress));
    pendingRequests.add(ExternalResources.ACTUAL_LOGICAL_PORTS);
}
Also used : SwitchId(org.openkilda.model.SwitchId) DumpLogicalPortsRequest(org.openkilda.messaging.command.grpc.DumpLogicalPortsRequest)

Example 2 with DumpLogicalPortsRequest

use of org.openkilda.messaging.command.grpc.DumpLogicalPortsRequest 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

DumpLogicalPortsRequest (org.openkilda.messaging.command.grpc.DumpLogicalPortsRequest)2 CommandData (org.openkilda.messaging.command.CommandData)1 CreateLogicalPortRequest (org.openkilda.messaging.command.grpc.CreateLogicalPortRequest)1 DeleteLogicalPortRequest (org.openkilda.messaging.command.grpc.DeleteLogicalPortRequest)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 SwitchId (org.openkilda.model.SwitchId)1