Merge "Helium: improve contract with ListenerRegistration"
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / DataTreeCandidateNode.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.controller.md.sal.dom.store.impl.tree;
9
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12
13 import com.google.common.base.Optional;
14
15 /**
16  * A single node within a {@link DataTreeCandidate}. The nodes are organized
17  * in tree hierarchy, reflecting the modification from which this candidate
18  * was created. The node itself exposes the before- and after-image of the
19  * tree restricted to the modified nodes.
20  */
21 public interface DataTreeCandidateNode {
22     /**
23      * Get the node identifier.
24      *
25      * @return The node identifier.
26      */
27     PathArgument getIdentifier();
28
29     /**
30      * Get an unmodifiable iterable of modified child nodes.
31      *
32      * @return Unmodifiable iterable of modified child nodes.
33      */
34     Iterable<DataTreeCandidateNode> getChildNodes();
35
36     /**
37      * Return the type of modification this node is undergoing.
38      *
39      * @return Node modification type.
40      */
41     ModificationType getModificationType();
42
43     /**
44      * Return the before-image of data corresponding to the node.
45      *
46      * @return Node data as they were present in the tree before
47      *         the modification was applied.
48      */
49     Optional<NormalizedNode<?, ?>> getDataAfter();
50
51     /**
52      * Return the after-image of data corresponding to the node.
53      *
54      * @return Node data as they will be present in the tree after
55      *         the modification is applied.
56      */
57     Optional<NormalizedNode<?, ?>> getDataBefore();
58 }