Add DOMInstanceNotificationService
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMDataTreeQueryOperations.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, 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 com.google.common.util.concurrent.FluentFuture;
12 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
13 import org.opendaylight.mdsal.common.api.ReadFailedException;
14 import org.opendaylight.mdsal.dom.api.query.DOMQuery;
15 import org.opendaylight.mdsal.dom.api.query.DOMQueryResult;
16
17 /**
18  * Query-like operations supported by {@link DOMDataTreeReadTransaction} and {@link DOMDataTreeReadWriteTransaction}.
19  * This interface defines the operations without a tie-in with lifecycle management.
20  */
21 @Beta
22 public interface DOMDataTreeQueryOperations {
23     /**
24      * Executes a query on the provided logical data store.
25      *
26      * @param store Logical data store from which read should occur.
27      * @param query DOMQuery to execute
28      * @return a FluentFuture containing the result of the query. The Future blocks until the operation is complete.
29      *         Once complete:
30      *         <ul>
31      *           <li>The Future returns the result of the query</li>
32      *           <li>If the query execution fails, the Future will fail with a {@link ReadFailedException} or
33      *               an exception derived from ReadFailedException.
34      *            </li>
35      *         </ul>
36      * @throws NullPointerException if any of the arguments is null
37      * @throws IllegalArgumentException if the query is not supported
38      */
39     FluentFuture<DOMQueryResult> execute(LogicalDatastoreType store, DOMQuery query);
40 }