X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=ovsdb%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Flib%2Fmessage%2Foperations%2FOperation.java;fp=ovsdb%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Flib%2Fmessage%2Foperations%2FOperation.java;h=1330bb94c4d77ce0d7d1fa96c3102163e98b3597;hb=eb52b253e282b10d8314b076bc3734954822979c;hp=856e74f94cd1a1f46e7853c2d59f668a674fbd9c;hpb=07a81ada71e03f5f61ba547b930e0805c466c5ff;p=netvirt.git diff --git a/ovsdb/src/main/java/org/opendaylight/ovsdb/lib/message/operations/Operation.java b/ovsdb/src/main/java/org/opendaylight/ovsdb/lib/message/operations/Operation.java index 856e74f94c..1330bb94c4 100644 --- a/ovsdb/src/main/java/org/opendaylight/ovsdb/lib/message/operations/Operation.java +++ b/ovsdb/src/main/java/org/opendaylight/ovsdb/lib/message/operations/Operation.java @@ -5,18 +5,39 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * - * Authors : Madhu Venugopal + * Authors : Madhu Venugopal, Ashwin Raveendran */ package org.opendaylight.ovsdb.lib.message.operations; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.opendaylight.ovsdb.lib.meta.TableSchema; + +public abstract class Operation> { + + @JsonIgnore + private TableSchema tableSchema; -public abstract class Operation { private String op; + @JsonIgnore + //todo(Ashwin): remove this // Just a simple way to retain the result of a transact operation which the client can refer to. private OperationResult result; + + protected Operation() { + } + + protected Operation(TableSchema tableSchema) { + this.tableSchema = tableSchema; + } + + public Operation(TableSchema schema, String operation) { + this.tableSchema = schema; + this.op = operation; + } + public String getOp() { return op; } @@ -33,8 +54,22 @@ public abstract class Operation { this.result = result; } + public TableSchema getTableSchema() { + return tableSchema; + } + + public void setTableSchema(TableSchema tableSchema) { + this.tableSchema = tableSchema; + } + + @JsonProperty + public String getTable() { + return tableSchema.getName(); + } + @Override public String toString() { return "Operation [op=" + op + ", result=" + result + "]"; } + }