1 package org.opendaylight.controller.md.sal.dom.xsql.jdbc;
3 import java.io.Serializable;
6 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
8 public class JDBCCommand implements Serializable {
9 private static final long serialVersionUID = 1L;
12 public static final int TYPE_EXECUTE_QUERY = 1;
13 public static final int TYPE_QUERY_REPLY = 2;
14 public static final int TYPE_QUERY_RECORD = 3;
15 public static final int TYPE_QUERY_FINISH = 4;
16 public static final int TYPE_QUERY_ERROR = 5;
17 public static final int TYPE_METADATA = 6;
18 public static final int TYPE_METADATA_REPLY = 7;
20 private JDBCResultSet rs = null;
21 private Map<String, Object> record = null;
22 private int rsID = -1;
23 private Exception err = null;
24 private XSQLBluePrint bluePrint = null;
26 public JDBCCommand() {
30 public void setType(int t) {
34 public JDBCCommand(Exception _err, int _RSID) {
35 this.type = TYPE_QUERY_ERROR;
40 public JDBCCommand(XSQLBluePrint bl) {
41 this.type = TYPE_METADATA_REPLY;
45 public JDBCCommand(JDBCResultSet _rs, int _type) {
46 this.type = TYPE_EXECUTE_QUERY;
49 this.rsID = rs.getID();
52 public JDBCCommand(Map<String, Object> _record, int _rsID) {
53 this.record = _record;
55 this.type = TYPE_QUERY_RECORD;
58 public JDBCCommand(int _rsID) {
60 this.type = TYPE_QUERY_FINISH;
63 public int getType() {
67 public JDBCResultSet getRS() {
71 public Map<String, Object> getRecord() {
75 public int getRSID() {
79 public Exception getERROR() {
83 public XSQLBluePrint getBluePrint() {
84 return this.bluePrint;