f00bf495a2a120523c70c0d2f1ea1b51106e3e40
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / DataTreeCursorProvider.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.binding.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13
14 /**
15  * Provides access to {#link DataTreeCursor}'s anchored at the specified path.
16  */
17 public interface DataTreeCursorProvider {
18     /**
19      * Create a new {@link DataTreeCursor} at specified path. May fail if specified path
20      * does not exist.
21      *
22      * @param path Path at which the cursor is to be anchored
23      * @return A new cursor, or null if the path does not exist.
24      * @throws IllegalStateException if there is another cursor currently open, or the transaction
25      *         is already closed (closed or submitted).
26      */
27     <T extends DataObject> @Nullable DataTreeCursor createCursor(@NonNull DataTreeIdentifier<T> path);
28 }