2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.honeycomb.v3po.data;
19 import com.google.common.annotations.Beta;
20 import io.fd.honeycomb.v3po.translate.TranslationException;
21 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
22 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
23 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
26 * Modification of a {@link ModifiableDataManager}.
29 public interface DataModification extends ReadableDataManager {
32 * Delete the node at specified path.
34 * @param path Node path
36 void delete(YangInstanceIdentifier path);
39 * Merge the specified data with the currently-present data
42 * @param path Node path
43 * @param data Data to be merged
45 void merge(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
48 * Replace the data at specified path with supplied data.
50 * @param path Node path
51 * @param data New node data
53 void write(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
56 * Alters data tree using this modification.
58 * @throws DataValidationFailedException if modification data is not valid
59 * @throws TranslationException if failed while updating data tree state
61 void commit() throws DataValidationFailedException, TranslationException;
64 * Validate and prepare modification before commit. Besides commit, no further operation is expected after validate
65 * and the behaviour is undefined.
67 * @throws DataValidationFailedException if modification data is not valid
69 void validate() throws DataValidationFailedException;