- private <T> SettableFuture<RpcResult<T>> getRpcErrorFuture(ConnectionException e) {
- List<RpcError> rpcErrorList = getConnectionErrorAsRpcErrors(e);
- SettableFuture<RpcResult<T>> futureWithError = SettableFuture.create();
- futureWithError.set(Rpcs.<T>getRpcResult(false, rpcErrorList));
- return futureWithError;
- }
-
- private List<RpcError> getConnectionErrorAsRpcErrors(ConnectionException e) {
- List<RpcError> rpcErrorList = new ArrayList<>();
- rpcErrorList.add(RpcErrors.getRpcError(OFConstants.APPLICATION_TAG,
- OFConstants.ERROR_TAG_TIMEOUT,
- CONNECTION_ERROR_MESSAGE,
- RpcError.ErrorSeverity.WARNING,
- e.getMessage(),
- RpcError.ErrorType.TRANSPORT,
- e.getCause()));
- return rpcErrorList;
- }
-