MRI version bump for Aluminium
[genius.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / genius / infra / TypedWriteTransaction.java
1 /*
2  * Copyright © 2018 Red Hat, Inc. and others.
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.genius.infra;
9
10 import org.opendaylight.mdsal.binding.api.Transaction;
11 import org.opendaylight.mdsal.binding.api.WriteTransaction;
12 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15
16 /**
17  * Write transaction which is specific to a single logical datastore (configuration or operational). Designed for use
18  * with {@link ManagedNewTransactionRunner} (it doesn’t support explicit cancel or commit operations).
19  *
20  * @param <D> The logical datastore handled by the transaction.
21  * @see WriteTransaction
22  */
23 public interface TypedWriteTransaction<D extends Datastore> extends
24         Transaction {
25     /**
26      * Writes an object to the given path.
27      *
28      * @see WriteTransaction#put(LogicalDatastoreType, InstanceIdentifier, DataObject) )
29      *
30      * @param path The path to write to.
31      * @param data The object to write.
32      * @param <T> The type of the provided object.
33      */
34     <T extends DataObject> void put(InstanceIdentifier<T> path, T data);
35
36     /**
37      * Writes an object to the given path, creating missing parents if requested.
38      *
39      * @see WriteTransaction#put(LogicalDatastoreType, InstanceIdentifier, DataObject)
40      *
41      * @param path The path to write to.
42      * @param data The object to write.
43      * @param <T> The type of the provided object.
44      */
45     <T extends DataObject> void mergeParentStructurePut(InstanceIdentifier<T> path, T data);
46
47     /**
48      * Merges an object with the data already present at the given path.
49      *
50      * @see WriteTransaction#merge(LogicalDatastoreType, InstanceIdentifier, DataObject)
51      *
52      * @param path The path to write to.
53      * @param data The object to merge.
54      * @param <T> The type of the provided object.
55      */
56     <T extends DataObject> void merge(InstanceIdentifier<T> path, T data);
57
58     /**
59      * Merges an object with the data already present at the given path, creating missing parents if requested.
60      *
61      * @see WriteTransaction#merge(LogicalDatastoreType, InstanceIdentifier, DataObject)
62      *
63      * @param path The path to write to.
64      * @param data The object to merge.
65      * @param <T> The type of the provided object.
66      */
67     <T extends DataObject> void mergeParentStructureMerge(InstanceIdentifier<T> path, T data);
68
69     /**
70      * Deletes the object present at the given path.
71      *
72      * @see WriteTransaction#delete(LogicalDatastoreType, InstanceIdentifier)
73      *
74      * @param path The path to delete.
75      */
76     void delete(InstanceIdentifier<?> path);
77 }