/** * 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 Void apply(final RpcResult<TransactionStatus> input) { Preconditions.checkArgument(input.isSuccessful() && input.getErrors().isEmpty(), "Submit failed with errors: %s", input.getErrors()); return null; } });
private static boolean isSuccessful(RpcResult<? extends CommonRpcResult> rpcResult) { return rpcResult != null && rpcResult.isSuccessful() && rpcResult.getResult().getResultCode() == ResultCode.Ok; }
@Override public OperationResult apply(final RpcResult<AddLspOutput> input) { return input.getResult(); } });
@Override public void onSuccess(RpcResult<Void> result) { if(!result.isSuccessful()) { LOG.warn("Rpc call to {} failed", msgFormat); } else { LOG.debug("Successful RPC Result - {}", msgFormat); } } });
@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 OperationResult apply(final RpcResult<RemoveLspOutput> input) { return input.getResult(); } });
public boolean registerEndpoint(RegisterEndpointInput regBaseEpInput) { try { RpcResult<Void> rpcResult = baseEpService.registerEndpoint(regBaseEpInput).get(); if (!rpcResult.isSuccessful()) { LOG.warn("Illegal state - registerEndpoint was not successful. Input of RPC: {}", regBaseEpInput); return false; } return true; } catch (InterruptedException | ExecutionException e) { LOG.error("Base endpoint registration failed. {}", regBaseEpInput, e); return false; } }
private NodeConnectorId getNodeConnectorIdFromInterface(String interfaceName) { GetNodeconnectorIdFromInterfaceInput input = new GetNodeconnectorIdFromInterfaceInputBuilder().setIntfName(interfaceName).build(); Future<RpcResult<GetNodeconnectorIdFromInterfaceOutput>> output = serviceProvider.getInterfaceManager().getNodeconnectorIdFromInterface(input); RpcResult<GetNodeconnectorIdFromInterfaceOutput> result = null; try { result = output.get(); if(result.isSuccessful()) { GetNodeconnectorIdFromInterfaceOutput ncIdOutput = result.getResult(); return ncIdOutput.getNodeconnectorId(); } } catch(ExecutionException | InterruptedException e) { //TODO: Handle exception } return null; }
@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()); } } });
@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 OperationResult apply(final RpcResult<UpdateLspOutput> input) { return input.getResult(); } });
public boolean unregisterEndpoint(UnregisterEndpointInput input) { try { RpcResult<Void> rpcResult = baseEpService.unregisterEndpoint(input).get(); if (!rpcResult.isSuccessful()) { LOG.warn("Illegal state - unregisterEndpoint was not successful. Input of RPC: {}", input); return false; } return true; } catch (InterruptedException | ExecutionException e) { LOG.error("unregisterEndpoint failed. {}", input, e); return false; } }
/** * 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 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(final RpcResult<TransactionStatus> result) { changeStatus(result.getResult()); }
@Deprecated public boolean unregisterEndpoint(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.UnregisterEndpointInput unregEndpointInput) { try { RpcResult<Void> rpcResult = epService.unregisterEndpoint(unregEndpointInput).get(); if (!rpcResult.isSuccessful()) { LOG.warn("Illegal state - unregisterEndpoint was not successful. Input of RPC: {}", unregEndpointInput); return false; } return true; } catch (InterruptedException | ExecutionException e) { LOG.error("unregisterEndpoint failed. {}", unregEndpointInput, e); return false; } }
@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(RpcResult<Void> result) { if (result.isSuccessful()) { LOG.debug("NAT Service : Successfully removed the label for the prefix {} from VPN {}", externalIp, vpnName); } else { LOG.error("NAT Service : Error in removing the label for prefix {} from VPN {}, {}", externalIp, vpnName, result.getErrors()); } } });