manually cherry pick this patch https://git.opendaylight.org/gerrit/#/c/34579/
[unimgr.git] / impl / src / main / java / org / opendaylight / unimgr / api / AbstractCommand.java
1 /*
2  * Copyright (c) 2016 CableLabs 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.unimgr.api;
10
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14
15 public abstract class AbstractCommand<D extends DataObject> {
16
17     protected DataBroker dataBroker;
18     protected DataTreeModification<D> dataObject;
19
20     /**
21      * Abstract command basic constructor
22      * @param dataBroker
23      * @param dataObject
24      */
25     public AbstractCommand(final DataBroker dataBroker, final DataTreeModification<D> dataObject) {
26         this.dataBroker = dataBroker;
27         this.dataObject = dataObject;
28     }
29
30     /**
31      * Abstract execute method
32      */
33     public abstract void execute();
34
35 }