2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.md.sal.common.api.data;
10 import java.util.concurrent.Future;
12 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
13 import org.opendaylight.yangtools.concepts.Path;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
16 public interface DataModification<P extends Path<P>, D> extends DataChange<P, D>, DataReader<P, D> {
18 * Returns transaction identifier
20 * @return Transaction identifier
22 Object getIdentifier();
24 TransactionStatus getStatus();
27 * Store a piece of data at specified path. This acts as a merge operation,
28 * which is to say that any pre-existing data which is not explicitly
29 * overwritten will be preserved. This means that if you store a container,
30 * its child lists will be merged. Performing the following put operations:
32 * 1) container { list [ a ] }
33 * 2) container { list [ b ] }
35 * will result in the following data being present:
37 * container { list [ a, b ] }
39 * This also means that storing the container will preserve any augmentations
40 * which have been attached to it.
42 * If you require an explicit replace operation, perform
43 * {@link removeOperationalData} first.
45 void putOperationalData(P path, D data);
48 * Store a piece of data at specified path. This acts as a merge operation,
49 * which is to say that any pre-existing data which is not explicitly
50 * overwritten will be preserved. This means that if you store a container,
51 * its child lists will be merged. Performing the following put operations:
53 * 1) container { list [ a ] }
54 * 2) container { list [ b ] }
56 * will result in the following data being present:
58 * container { list [ a, b ] }
60 * This also means that storing the container will preserve any augmentations
61 * which have been attached to it.
63 * If you require an explicit replace operation, perform
64 * {@link removeConfigurationData} first.
66 void putConfigurationData(P path, D data);
68 void removeOperationalData(P path);
70 void removeConfigurationData(P path);
73 * Initiates a two-phase commit of modification.
76 * The successful commit changes the state of the system and may affect
80 * The effects of successful commit of data are described in the
81 * specifications and YANG models describing the Provider components of
82 * controller. It is assumed that Consumer has an understanding of this
86 * @see DataCommitHandler for further information how two-phase commit is
89 * Identifier of the store, where commit should occur.
90 * @return Result of the Commit, containing success information or list of
91 * encountered errors, if commit was not successful. The Future
92 * blocks until {@link TransactionStatus#COMMITED} or
93 * {@link TransactionStatus#FAILED} is reached.
95 Future<RpcResult<TransactionStatus>> commit();