BUG-1381: make users of JavassistUtils.getLock synchronized properly
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDataWriteTransactionImpl.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.md.sal.binding.impl;
9
10 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
11 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
12 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
13 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
14 import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataTransaction;
15 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18 import org.opendaylight.yangtools.yang.common.RpcResult;
19 import com.google.common.util.concurrent.CheckedFuture;
20 import com.google.common.util.concurrent.ListenableFuture;
21
22 class BindingDataWriteTransactionImpl<T extends DOMDataWriteTransaction> extends
23         AbstractWriteTransaction<T> implements WriteTransaction {
24
25     protected BindingDataWriteTransactionImpl(final T delegateTx, final BindingToNormalizedNodeCodec codec) {
26         super(delegateTx, codec);
27     }
28
29     @Override
30     public <T extends DataObject> void put(final LogicalDatastoreType store, final InstanceIdentifier<T> path,
31                                            final T data) {
32         doPut(store, path, data);
33     }
34
35     @Override
36     public <T extends DataObject> void merge(final LogicalDatastoreType store, final InstanceIdentifier<T> path,
37                                              final T data) {
38         doMerge(store, path, data);
39     }
40
41     @Override
42     public void delete(final LogicalDatastoreType store, final InstanceIdentifier<?> path) {
43         doDelete( store, path);
44     }
45
46     @Override
47     public ListenableFuture<RpcResult<TransactionStatus>> commit() {
48         return AbstractDataTransaction.convertToLegacyCommitFuture(submit());
49     }
50
51     @Override
52     public CheckedFuture<Void,TransactionCommitFailedException> submit() {
53         return doSubmit();
54     }
55
56     @Override
57     public boolean cancel() {
58         return doCancel();
59     }
60 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.