2 * Copyright (C) 2013 Red Hat, Inc.
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
8 * Authors : Madhu Venugopal, Ashwin Raveendran
10 package org.opendaylight.ovsdb.lib.operations;
12 import org.opendaylight.ovsdb.lib.schema.TableSchema;
14 import com.fasterxml.jackson.annotation.JsonIgnore;
15 import com.fasterxml.jackson.annotation.JsonProperty;
17 public abstract class Operation<E extends TableSchema<E>> {
20 private TableSchema<E> tableSchema;
25 //todo(Ashwin): remove this
26 // Just a simple way to retain the result of a transact operation which the client can refer to.
27 private OperationResult result;
30 protected Operation() {
33 protected Operation(TableSchema<E> tableSchema) {
34 this.tableSchema = tableSchema;
37 public Operation(TableSchema<E> schema, String operation) {
38 this.tableSchema = schema;
42 public String getOp() {
46 public void setOp(String op) {
50 public OperationResult getResult() {
54 public void setResult(OperationResult result) {
58 public TableSchema<E> getTableSchema() {
62 public void setTableSchema(TableSchema<E> tableSchema) {
63 this.tableSchema = tableSchema;
67 public String getTable() {
68 return (tableSchema == null) ? null : tableSchema.getName();
72 public String toString() {
73 return "Operation [op=" + op + ", result=" + result + "]";