@Override public Answer execute( final FindLogicalSwitchPortCommand command, final NiciraNvpResource niciraNvpResource) { final String logicalSwitchUuid = command.getLogicalSwitchUuid(); final String logicalSwitchPortUuid = command.getLogicalSwitchPortUuid(); final NiciraNvpApi niciraNvpApi = niciraNvpResource.getNiciraNvpApi(); try { final NiciraNvpList<LogicalSwitchPort> ports = niciraNvpApi.findLogicalSwitchPortsByUuid(logicalSwitchUuid, logicalSwitchPortUuid); if (ports.getResultCount() == 0) { return new FindLogicalSwitchPortAnswer( command, false, "Logical switchport " + logicalSwitchPortUuid + " not found", null); } else { return new FindLogicalSwitchPortAnswer( command, true, "Logical switchport " + logicalSwitchPortUuid + " found", logicalSwitchPortUuid); } } catch (final NiciraNvpApiException e) { final CommandRetryUtility retryUtility = niciraNvpResource.getRetryUtility(); retryUtility.addRetry(command, NUM_RETRIES); return retryUtility.retry(command, FindLogicalSwitchPortAnswer.class, e); } }