ec19f3b5b023c64489fcc78dd50fb46fa5ff8921
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-impl / src / main / java / org / opendaylight / ovsdb / hwvtepsouthbound / transactions / md / AbstractTransactionCommand.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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
9 package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md;
10
11 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
12 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDeviceInfo;
13 import org.opendaylight.ovsdb.lib.message.TableUpdates;
14 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfo;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
17
18 public abstract class AbstractTransactionCommand<T extends DataObject> implements TransactionCommand {
19
20     private TableUpdates updates;
21     private DatabaseSchema dbSchema;
22     private HwvtepConnectionInstance key;
23
24     public TableUpdates getUpdates() {
25         return updates;
26     }
27
28     public DatabaseSchema getDbSchema() {
29         return dbSchema;
30     }
31
32     public ConnectionInfo getConnectionInfo() {
33         return key.getMDConnectionInfo();
34     }
35
36     public HwvtepConnectionInstance getOvsdbConnectionInstance() {
37         return key;
38     }
39
40     public AbstractTransactionCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
41         this.updates = updates;
42         this.dbSchema = dbSchema;
43         this.key = key;
44     }
45
46     public HwvtepDeviceInfo getDeviceInfo() {
47         return key.getDeviceInfo();
48     }
49 }