Merge "BUG-2673: make CDS implement DOMDataTreeChangeListener"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / DataTreeChanged.java
1 /*
2  * Copyright (c) 2015 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.cluster.datastore.messages;
9
10 import com.google.common.base.Preconditions;
11 import java.util.Collection;
12 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
13
14 /**
15  * A message about a DataTree having been changed. The message is not
16  * serializable on purpose. For delegating the change across cluster nodes,
17  * this needs to be intercepted by a local agent and forwarded as
18  * a {@link DataTreeDelta}.
19  */
20 public final class DataTreeChanged {
21     private final Collection<DataTreeCandidate> changes;
22
23     public DataTreeChanged(final Collection<DataTreeCandidate> changes) {
24         this.changes = Preconditions.checkNotNull(changes);
25     }
26
27     /**
28      * Return the data changes.
29      *
30      * @return Change events
31      */
32     public Collection<DataTreeCandidate> getChanges() {
33         return changes;
34     }
35 }