2 * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.ovsdb.lib.operations;
11 import org.opendaylight.ovsdb.lib.schema.TableSchema;
13 import com.fasterxml.jackson.annotation.JsonIgnore;
14 import com.fasterxml.jackson.annotation.JsonProperty;
16 public abstract class Operation<E extends TableSchema<E>> {
19 private TableSchema<E> tableSchema;
24 //todo(Ashwin): remove this
25 // Just a simple way to retain the result of a transact operation which the client can refer to.
26 private OperationResult result;
29 protected Operation() {
32 protected Operation(TableSchema<E> tableSchema) {
33 this.tableSchema = tableSchema;
36 public Operation(TableSchema<E> schema, String operation) {
37 this.tableSchema = schema;
41 public String getOp() {
45 public void setOp(String op) {
49 public OperationResult getResult() {
53 public void setResult(OperationResult result) {
57 public TableSchema<E> getTableSchema() {
61 public void setTableSchema(TableSchema<E> tableSchema) {
62 this.tableSchema = tableSchema;
66 public String getTable() {
67 return (tableSchema == null) ? null : tableSchema.getName();
71 public String toString() {
72 return "Operation [op=" + op + ", result=" + result + "]";