@Override public void onSuccess(RpcResult<Void> result) { if(result.isSuccessful()) { LOG.debug("Successfully removed the label for the prefix {} from VPN {}", externalIp, vpnName); } else { LOG.error("Error in removing the label for prefix {} from VPN {}, {}", externalIp, vpnName, result.getErrors()); } } });
@Override public void onSuccess(RpcResult<Void> result) { if(result.isSuccessful()) { LOG.debug("Created IdPool for Aliveness Monitor Service"); } else { LOG.error("RPC to create Idpool failed {}", result.getErrors()); } } });
@Override public void onSuccess(RpcResult<Void> result) { if(!result.isSuccessful()) { LOG.warn("Rpc call to {} failed", msgFormat, getErrorText(result.getErrors())); } else { LOG.debug("Successful RPC Result - {}", msgFormat); } } });
@Override public void onSuccess(RpcResult<Void> result) { if (result.isSuccessful()) { log.info("NAT Service : Successfully installed custom FIB routes for prefix {}", externalIp); } else { log.error("NAT Service : Error in rpc call to create custom Fib entries for prefix {} in DPN {}, {}", externalIp, dpnId, result.getErrors()); } } });
@Override public void onSuccess(RpcResult<Void> result) { if(result.isSuccessful()) { LOG.debug("Successfully removed the label for the prefix {} from VPN {}", externalIp, vpnName); } else { LOG.error("Error in removing the label for prefix {} from VPN {}, {}", externalIp, vpnName, result.getErrors()); } } });
@Override public void onSuccess(RpcResult<Void> result) { if(!result.isSuccessful()) { LOG.warn("Rpc call to {} failed {}", msgFormat, getErrorText(result.getErrors())); } else { LOG.debug("Successful RPC Result - {}", msgFormat); } } });
/** * * @param input rpc result input * @param result results * @param <E> rpc result input type * @return rpc result */ protected static <E> RpcResult<E> assembleRpcResult(RpcResult<?> input, E result) { Collection<RpcError> errors = input.getErrors(); return Rpcs.getRpcResult(input.isSuccessful(), result, errors); }
public static void releaseId(IdManagerService idManager, String poolName, String idKey) { ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build(); try { Future<RpcResult<Void>> result = idManager.releaseId(idInput); RpcResult<Void> rpcResult = result.get(); if(!rpcResult.isSuccessful()) { LOG.warn("RPC Call to Get Unique Id returned with Errors {}", rpcResult.getErrors()); } } catch (InterruptedException | ExecutionException e) { LOG.warn("Exception when getting Unique Id for key {}", idKey, e); } }
public static void releaseId(IdManagerService idManager, String poolName, String idKey) { ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build(); try { Future<RpcResult<Void>> result = idManager.releaseId(idInput); RpcResult<Void> rpcResult = result.get(); if (!rpcResult.isSuccessful()) { LOG.warn("RPC Call to Get Unique Id returned with Errors {}", rpcResult.getErrors()); } } catch (InterruptedException | ExecutionException e) { LOG.warn("Exception when getting Unique Id for key {}", idKey, e); } }
@Override public void onSuccess(RpcResult<E> rpcReply) { if (rpcReply.isSuccessful()) { E result = rpcReply.getResult(); sendOpenFlowMessageToCore(coreConnector, result, ofVersion, xId, datapathId, moduleId); } else { for (RpcError rpcError : rpcReply.getErrors()) { LOG.info("SHIM RELAY: error in communication with switch: {}", rpcError.getMessage()); } } }
@Override public void onSuccess(final RpcResult<?> result) { if (result.isSuccessful()) { callback.onSuccess((Output) result.getResult()); } else { //FIXME: It's not suitable to do this way here. It's better for // 'onFailure' to accept Collection<RpcError> as input. result.getErrors().forEach(e -> callback.onFailure(e.getCause())); } }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }
@Override public DOMRpcResult apply(final RpcResult<NetconfMessage> input) { if (input.isSuccessful()) { return transformer.toRpcResult(input.getResult(), type); } else { // TODO check whether the listener sets errors properly return new DefaultDOMRpcResult(input.getErrors()); } } });
private DOMRpcResult transform(final RpcResult<?> input) { if (input.isSuccessful()) { final Object inputData = input.getResult(); if (inputData instanceof DataContainer) { return new DefaultDOMRpcResult(codec.toNormalizedNodeRpcData((DataContainer) inputData)); } else { return new DefaultDOMRpcResult((NormalizedNode<?, ?>) null); } } return new DefaultDOMRpcResult(input.getErrors()); }
private DOMRpcResult transform(final RpcResult<?> input) { if (input.isSuccessful()) { final Object inputData = input.getResult(); if (inputData instanceof DataContainer) { return new DefaultDOMRpcResult(codec.toNormalizedNodeRpcData((DataContainer) inputData)); } return new DefaultDOMRpcResult((NormalizedNode<?, ?>) null); } return new DefaultDOMRpcResult(input.getErrors()); } }
@Override public RpcResult<UpdateMeterOutput> apply(final RpcResult<Void> inputArg) { UpdateMeterOutputBuilder meterModOutput = new UpdateMeterOutputBuilder(); BigInteger bigIntXid = BigInteger.valueOf(input.getXid()); meterModOutput.setTransactionId(new TransactionId(bigIntXid)); UpdateMeterOutput result = meterModOutput.build(); RpcResult<UpdateMeterOutput> rpcResult = RpcResultBuilder .<UpdateMeterOutput>status(inputArg.isSuccessful()).withResult(result) .withRpcErrors(inputArg.getErrors()).build(); return rpcResult; } });
@Override public RpcResult<UpdateGroupOutput> apply(final RpcResult<Void> inputArg) { UpdateGroupOutputBuilder groupModOutput = new UpdateGroupOutputBuilder(); BigInteger bigIntXid = BigInteger.valueOf(input.getXid()); groupModOutput.setTransactionId(new TransactionId(bigIntXid)); UpdateGroupOutput result = groupModOutput.build(); RpcResult<UpdateGroupOutput> rpcResult = RpcResultBuilder .<UpdateGroupOutput>status(inputArg.isSuccessful()).withResult(result) .withRpcErrors(inputArg.getErrors()).build(); return rpcResult; } });
@Override public RpcResult<UpdatePortOutput> apply(final RpcResult<Void> inputArg) { UpdatePortOutputBuilder portModOutput = new UpdatePortOutputBuilder(); BigInteger bigIntXid = BigInteger.valueOf(input.getXid()); portModOutput.setTransactionId(new TransactionId(bigIntXid)); UpdatePortOutput result = portModOutput.build(); RpcResult<UpdatePortOutput> rpcResult = RpcResultBuilder .<UpdatePortOutput>status(inputArg.isSuccessful()).withResult(result) .withRpcErrors(inputArg.getErrors()).build(); return rpcResult; } });