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 {
10 public static final int TYPE_EXECUTE_QUERY = 1;
11 public static final int TYPE_QUERY_REPLY = 2;
12 public static final int TYPE_QUERY_RECORD = 3;
13 public static final int TYPE_QUERY_FINISH = 4;
14 public static final int TYPE_QUERY_ERROR = 5;
15 public static final int TYPE_METADATA = 6;
16 public static final int TYPE_METADATA_REPLY = 7;
18 private JDBCResultSet rs = null;
19 private Map record = null;
20 private int rsID = -1;
21 private Exception err = null;
22 private XSQLBluePrint bluePrint = null;
24 public JDBCCommand() {
28 public void setType(int t) {
32 public JDBCCommand(Exception _err, int _RSID) {
33 this.type = TYPE_QUERY_ERROR;
38 public JDBCCommand(XSQLBluePrint bl) {
39 this.type = TYPE_METADATA_REPLY;
43 public JDBCCommand(JDBCResultSet _rs, int _type) {
44 this.type = TYPE_EXECUTE_QUERY;
47 this.rsID = rs.getID();
50 public JDBCCommand(Map _record, int _rsID) {
51 this.record = _record;
53 this.type = TYPE_QUERY_RECORD;
56 public JDBCCommand(int _rsID) {
58 this.type = TYPE_QUERY_FINISH;
61 public int getType() {
65 public JDBCResultSet getRS() {
69 public Map getRecord() {
73 public int getRSID() {
77 public Exception getERROR() {
81 public XSQLBluePrint getBluePrint() {
82 return this.bluePrint;