X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Futil%2FFailedRpcResult.java;fp=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Futil%2FFailedRpcResult.java;h=49b16d4cfbdd309cdbc944415ccbb0f7ccd08eca;hb=bee5972562efede5581a4655b439023837aa261c;hp=0000000000000000000000000000000000000000;hpb=82eb3f94c133e091ca5dd2f26450da9f121c12ca;p=controller.git diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/FailedRpcResult.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/FailedRpcResult.java new file mode 100644 index 0000000000..49b16d4cfb --- /dev/null +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/FailedRpcResult.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.sal.connect.util; + +import java.util.Collection; +import java.util.Collections; + +import org.opendaylight.yangtools.yang.common.RpcError; +import org.opendaylight.yangtools.yang.common.RpcResult; + +public final class FailedRpcResult implements RpcResult { + + private final RpcError rpcError; + + public FailedRpcResult(final RpcError rpcError) { + this.rpcError = rpcError; + } + + @Override + public boolean isSuccessful() { + return false; + } + + @Override + public T getResult() { + return null; + } + + @Override + public Collection getErrors() { + return Collections.singletonList(rpcError); + } +}