2 * Copyright (c) 2014, 2015 Cisco Systems, 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.controller.md.sal.dom.xsql.jdbc;
11 import java.io.Serializable;
14 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
17 * To be removed in Nitrogen
20 public class JDBCCommand implements Serializable {
21 private static final long serialVersionUID = 1L;
24 public static final int TYPE_EXECUTE_QUERY = 1;
25 public static final int TYPE_QUERY_REPLY = 2;
26 public static final int TYPE_QUERY_RECORD = 3;
27 public static final int TYPE_QUERY_FINISH = 4;
28 public static final int TYPE_QUERY_ERROR = 5;
29 public static final int TYPE_METADATA = 6;
30 public static final int TYPE_METADATA_REPLY = 7;
32 private JDBCResultSet rs = null;
33 private Map<String, Object> record = null;
34 private int rsID = -1;
35 private Exception err = null;
36 private XSQLBluePrint bluePrint = null;
38 public JDBCCommand() {
42 public void setType(int t) {
46 public JDBCCommand(Exception _err, int _RSID) {
47 this.type = TYPE_QUERY_ERROR;
52 public JDBCCommand(XSQLBluePrint bl) {
53 this.type = TYPE_METADATA_REPLY;
57 public JDBCCommand(JDBCResultSet _rs, int _type) {
58 this.type = TYPE_EXECUTE_QUERY;
61 this.rsID = rs.getID();
64 public JDBCCommand(Map<String, Object> _record, int _rsID) {
65 this.record = _record;
67 this.type = TYPE_QUERY_RECORD;
70 public JDBCCommand(int _rsID) {
72 this.type = TYPE_QUERY_FINISH;
75 public int getType() {
79 public JDBCResultSet getRS() {
83 public Map<String, Object> getRecord() {
87 public int getRSID() {
91 public Exception getERROR() {
95 public XSQLBluePrint getBluePrint() {
96 return this.bluePrint;