BUG-865: Remove ModificationType.MERGE
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTree.java
1 /*
2  * Copyright (c) 2014 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.yangtools.yang.data.api.schema.tree;
9
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12
13 /**
14  * Interface representing a data tree which can be modified in an MVCC fashion.
15  */
16 public interface DataTree extends DataTreeTip {
17     /**
18      * Take a read-only point-in-time snapshot of the tree.
19      *
20      * @return Data tree snapshot.
21      */
22     DataTreeSnapshot takeSnapshot();
23
24     /**
25      * Make the data tree use a new schema context. The context will be used
26      * only by subsequent operations.
27      *
28      * @param newSchemaContext new SchemaContext
29      * @throws IllegalArgumentException if the new context is incompatible
30      */
31     void setSchemaContext(SchemaContext newSchemaContext);
32
33     /**
34      * Commit a data tree candidate.
35      *
36      * @param candidate data tree candidate
37      */
38     void commit(DataTreeCandidate candidate);
39
40     /**
41      * Get the root path of this data tree.
42      *
43      * @return The tree's root path.
44      */
45     YangInstanceIdentifier getRootPath();
46 }