Remove raw references to Map in XSQL
[controller.git] / opendaylight / md-sal / sal-dom-xsql / src / main / java / org / opendaylight / controller / md / sal / dom / xsql / jdbc / JDBCCommand.java
index 85ce0e5392b7f249ebe0e095931309fce68ed63f..649709ecf385bf893993370e4cf3d10545f72fca 100644 (file)
@@ -3,18 +3,33 @@ package org.opendaylight.controller.md.sal.dom.xsql.jdbc;
 import java.io.Serializable;
 import java.util.Map;
 
+import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
+
 public class JDBCCommand implements Serializable {
+    private static final long serialVersionUID = 1L;
+
     public int type = 0;
     public static final int TYPE_EXECUTE_QUERY = 1;
     public static final int TYPE_QUERY_REPLY = 2;
     public static final int TYPE_QUERY_RECORD = 3;
     public static final int TYPE_QUERY_FINISH = 4;
     public static final int TYPE_QUERY_ERROR = 5;
+    public static final int TYPE_METADATA = 6;
+    public static final int TYPE_METADATA_REPLY = 7;
 
     private JDBCResultSet rs = null;
-    private Map record = null;
+    private Map<String, Object> record = null;
     private int rsID = -1;
     private Exception err = null;
+    private XSQLBluePrint bluePrint = null;
+
+    public JDBCCommand() {
+
+    }
+
+    public void setType(int t) {
+        this.type = t;
+    }
 
     public JDBCCommand(Exception _err, int _RSID) {
         this.type = TYPE_QUERY_ERROR;
@@ -22,6 +37,11 @@ public class JDBCCommand implements Serializable {
         this.rsID = _RSID;
     }
 
+    public JDBCCommand(XSQLBluePrint bl) {
+        this.type = TYPE_METADATA_REPLY;
+        this.bluePrint = bl;
+    }
+
     public JDBCCommand(JDBCResultSet _rs, int _type) {
         this.type = TYPE_EXECUTE_QUERY;
         this.rs = _rs;
@@ -29,7 +49,7 @@ public class JDBCCommand implements Serializable {
         this.rsID = rs.getID();
     }
 
-    public JDBCCommand(Map _record, int _rsID) {
+    public JDBCCommand(Map<String, Object> _record, int _rsID) {
         this.record = _record;
         this.rsID = _rsID;
         this.type = TYPE_QUERY_RECORD;
@@ -48,7 +68,7 @@ public class JDBCCommand implements Serializable {
         return this.rs;
     }
 
-    public Map getRecord() {
+    public Map<String, Object> getRecord() {
         return this.record;
     }
 
@@ -59,4 +79,8 @@ public class JDBCCommand implements Serializable {
     public Exception getERROR() {
         return this.err;
     }
+
+    public XSQLBluePrint getBluePrint() {
+        return this.bluePrint;
+    }
 }