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> {
19 * Returns transaction identifier
21 * @return Transaction identifier
23 Object getIdentifier();
25 TransactionStatus getStatus();
29 * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
35 void putRuntimeData(P path, D data);
38 * Store a piece of data at specified path. This acts as a merge operation,
39 * which is to say that any pre-existing data which is not explicitly
40 * overwritten will be preserved. This means that if you store a container,
41 * its child lists will be merged. Performing the following put operations:
43 * 1) container { list [ a ] }
44 * 2) container { list [ b ] }
46 * will result in the following data being present:
48 * container { list [ a, b ] }
50 * This also means that storing the container will preserve any augmentations
51 * which have been attached to it.
53 * If you require an explicit replace operation, perform
54 * {@link removeOperationalData} first.
56 void putOperationalData(P path, D data);
59 * Store a piece of data at specified path. This acts as a merge operation,
60 * which is to say that any pre-existing data which is not explicitly
61 * overwritten will be preserved. This means that if you store a container,
62 * its child lists will be merged. Performing the following put operations:
64 * 1) container { list [ a ] }
65 * 2) container { list [ b ] }
67 * will result in the following data being present:
69 * container { list [ a, b ] }
71 * This also means that storing the container will preserve any augmentations
72 * which have been attached to it.
74 * If you require an explicit replace operation, perform
75 * {@link removeConfigurationData} first.
77 void putConfigurationData(P path, D data);
80 * @deprecated Use {@link #removeOperationalData(Object)}
85 void removeRuntimeData(P path);
87 void removeOperationalData(P path);
89 void removeConfigurationData(P path);
92 * Initiates a two-phase commit of modification.
95 * The successful commit changes the state of the system and may affect
99 * The effects of successful commit of data are described in the
100 * specifications and YANG models describing the Provider components of
101 * controller. It is assumed that Consumer has an understanding of this
105 * @see DataCommitHandler for further information how two-phase commit is
108 * Identifier of the store, where commit should occur.
109 * @return Result of the Commit, containing success information or list of
110 * encountered errors, if commit was not successful. The Future
111 * blocks until {@link TransactionStatus#COMMITED} or
112 * {@link TransactionStatus#FAILED} is reached.
114 Future<RpcResult<TransactionStatus>> commit();