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;
12 import java.util.concurrent.Future;
14 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
15 // FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
16 // import org.opendaylight.yangtools.concepts.Path;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
19 public interface DataModification<P/* extends Path<P> */, D> extends DataChange<P, D>, DataReader<P, D> {
22 * Returns transaction identifier
24 * @return Transaction identifier
26 Object getIdentifier();
28 TransactionStatus getStatus();
32 * Use {@link #putOperationalData(Object, Object)} instead.
37 void putRuntimeData(P path, D data);
39 void putOperationalData(P path, D data);
41 void putConfigurationData(P path, D data);
44 * Use {@link #removeOperationalData(Object)}
48 void removeRuntimeData(P path);
50 void removeOperationalData(P path);
52 void removeConfigurationData(P path);
55 * Initiates a two-phase commit of modification.
58 * The successful commit changes the state of the system and may affect
62 * The effects of successful commit of data are described in the
63 * specifications and YANG models describing the Provider components of
64 * controller. It is assumed that Consumer has an understanding of this
68 * @see DataCommitHandler for further information how two-phase commit is
71 * Identifier of the store, where commit should occur.
72 * @return Result of the Commit, containing success information or list of
73 * encountered errors, if commit was not successful. The Future
74 * blocks until {@link TransactionStatus#COMMITED} or
75 * {@link TransactionStatus#FAILED} is reached.
77 Future<RpcResult<TransactionStatus>> commit();