MD-SAL API integration
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / ovsdb / transact / TransactCommand.java
1 /*
2  * Copyright (c) 2014, 2016 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.ovsdb.southbound.ovsdb.transact;
9
10 import java.util.Collection;
11 import org.opendaylight.mdsal.binding.api.DataTreeModification;
12 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
13 import org.opendaylight.ovsdb.southbound.InstanceIdentifierCodec;
14 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
15
16 /**
17  * Contract for a transactional command.
18  */
19 public interface TransactCommand {
20     /**
21      * Queue the command defined by the class implementing this interface in the given transaction builder, with the
22      * given bridge state, in reaction to the given events.
23      *
24      * @param transaction The transaction builder.
25      * @param state The bridge state.
26      * @param events The events to be represented.
27      * @param instanceIdentifierCodec The instance identifier codec to use.
28      */
29     void execute(TransactionBuilder transaction, BridgeOperationalState state,
30                  DataChangeEvent events,
31                  InstanceIdentifierCodec instanceIdentifierCodec);
32
33     /**
34      * Queue the command defined by the class implementing this interface in the given transaction builder, with the
35      * given bridge state, in reaction to the given modifications.
36      *
37      * @param transaction The transaction builder.
38      * @param state The bridge state.
39      * @param modifications The modifications to be represented.
40      * @param instanceIdentifierCodec The instance identifier codec to use.
41      */
42     void execute(TransactionBuilder transaction, BridgeOperationalState state,
43                  Collection<DataTreeModification<Node>> modifications,
44                  InstanceIdentifierCodec instanceIdentifierCodec);
45 }