Simplify DOMOperationService API
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMActionResult.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.api;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.yang.common.RpcError;
15 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
16
17 /**
18  * Interface defining a result of an operation invocation.
19  *
20  * @author Robert Varga
21  */
22 @Beta
23 @NonNullByDefault
24 public interface DOMActionResult {
25     /**
26      * Returns a set of errors and warnings which occurred during processing the call.
27      *
28      * @return a Collection of {@link RpcError}, guaranteed to be non-null. In case no errors are reported, an empty
29      *         collection is returned.
30      */
31     Collection<RpcError> getErrors();
32
33     /**
34      * Returns the value result of the call.
35      *
36      * @return Invocation result, absent if the operation has not produced a result. This might be the case if the
37      *         operation does not produce a result, or if it failed.
38      */
39     Optional<ContainerNode> getOutput();
40 }