2 * Copyright (c) 2016 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
9 package org.opendaylight.netconf.topology.singleton.api;
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
13 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import scala.concurrent.Future;
18 * Provides API for all operations of read and write transactions
20 public interface NetconfDOMTransaction {
23 * Read data from particular data-store
24 * @param store data-store type
25 * @param path unique identifier of a particular node instance in the data tree
26 * @return result as future
28 Future<Optional<NormalizedNodeMessage>> read(LogicalDatastoreType store, YangInstanceIdentifier path);
31 * Test existence of node in certain data-store
32 * @param store data-store type
33 * @param path unique identifier of a particular node instance in the data tree
34 * @return result as future
36 Future<Boolean> exists(LogicalDatastoreType store, YangInstanceIdentifier path);
39 * Put data to particular data-store
40 * @param store data-store type
41 * @param data data for inserting included in NormalizedNodeMessage object
43 void put(LogicalDatastoreType store, NormalizedNodeMessage data);
46 * Merge data with existing node in particular data-store
47 * @param store data-store type
48 * @param data data for merging included in NormalizedNodeMessage object
50 void merge(LogicalDatastoreType store, NormalizedNodeMessage data);
53 * Delete node in particular data-store in path
54 * @param store data-store type
55 * @param path unique identifier of a particular node instance in the data tree
57 void delete(LogicalDatastoreType store, YangInstanceIdentifier path);
61 * @return success or not
66 * Commit opened transaction.
67 * @return void or raised exception
69 Future<Void> submit();