2 * Copyright © 2017 AT&T, 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.transportpce.common.network;
11 import com.google.common.util.concurrent.FluentFuture;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.mdsal.common.api.CommitInfo;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20 public class NetworkTransactionImpl implements NetworkTransactionService {
22 RequestProcessor requestProcessor;
24 public NetworkTransactionImpl(RequestProcessor requestProcessor) {
25 this.requestProcessor = requestProcessor;
29 public <T extends DataObject> ListenableFuture<com.google.common.base.Optional<T>>
30 read(LogicalDatastoreType store, InstanceIdentifier<T> path) {
31 return requestProcessor.read(store, path);
36 public void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
37 requestProcessor.delete(store, path);
41 public <T extends DataObject> void put(LogicalDatastoreType store,
42 InstanceIdentifier<T> path, T data, boolean createMissingParents) {
44 requestProcessor.put(store, path, data, createMissingParents);
48 public <T extends DataObject> void put(LogicalDatastoreType store,
49 InstanceIdentifier<T> path, T data) {
50 requestProcessor.put(store, path, data);
53 public FluentFuture<? extends @NonNull CommitInfo> commit() {
54 return requestProcessor.commit();
60 requestProcessor.close();
63 public <T extends DataObject> void merge(LogicalDatastoreType store,
64 InstanceIdentifier<T> path, T data) {
65 requestProcessor.merge(store, path, data);
68 public <T extends DataObject> void merge(LogicalDatastoreType store,
69 InstanceIdentifier<T> path, T data, boolean createMissingParents) {
71 requestProcessor.merge(store, path, data, createMissingParents);