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.yang.common.RpcResult;
15 //FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
16 //import org.opendaylight.yangtools.concepts.Path;
17 public interface DataModification<P/* extends Path<P> */, D> extends DataChange<P, D>, DataReader<P, D> {
20 * Returns transaction identifier
22 * @return Transaction identifier
24 Object getIdentifier();
26 TransactionStatus getStatus();
30 * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
36 void putRuntimeData(P path, D data);
39 * Store a piece of data at specified path. This acts as a merge operation,
40 * which is to say that any pre-existing data which is not explicitly
41 * overwritten will be preserved. This means that if you store a container,
42 * its child lists will be merged. Performing the following put operations:
44 * 1) container { list [ a ] }
45 * 2) container { list [ b ] }
47 * will result in the following data being present:
49 * container { list [ a, b ] }
51 * This also means that storing the container will preserve any augmentations
52 * which have been attached to it.
54 * If you require an explicit replace operation, perform
55 * {@link removeOperationalData} first.
57 void putOperationalData(P path, D data);
60 * Store a piece of data at specified path. This acts as a merge operation,
61 * which is to say that any pre-existing data which is not explicitly
62 * overwritten will be preserved. This means that if you store a container,
63 * its child lists will be merged. Performing the following put operations:
65 * 1) container { list [ a ] }
66 * 2) container { list [ b ] }
68 * will result in the following data being present:
70 * container { list [ a, b ] }
72 * This also means that storing the container will preserve any augmentations
73 * which have been attached to it.
75 * If you require an explicit replace operation, perform
76 * {@link removeConfigurationData} first.
78 void putConfigurationData(P path, D data);
81 * @deprecated Use {@link #removeOperationalData(Object)}
86 void removeRuntimeData(P path);
88 void removeOperationalData(P path);
90 void removeConfigurationData(P path);
93 * Initiates a two-phase commit of modification.
96 * The successful commit changes the state of the system and may affect
100 * The effects of successful commit of data are described in the
101 * specifications and YANG models describing the Provider components of
102 * controller. It is assumed that Consumer has an understanding of this
106 * @see DataCommitHandler for further information how two-phase commit is
109 * Identifier of the store, where commit should occur.
110 * @return Result of the Commit, containing success information or list of
111 * encountered errors, if commit was not successful. The Future
112 * blocks until {@link TransactionStatus#COMMITED} or
113 * {@link TransactionStatus#FAILED} is reached.
115 Future<RpcResult<TransactionStatus>> commit();