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;
16 public class JDBCCommand implements Serializable {
17 private static final long serialVersionUID = 1L;
20 public static final int TYPE_EXECUTE_QUERY = 1;
21 public static final int TYPE_QUERY_REPLY = 2;
22 public static final int TYPE_QUERY_RECORD = 3;
23 public static final int TYPE_QUERY_FINISH = 4;
24 public static final int TYPE_QUERY_ERROR = 5;
25 public static final int TYPE_METADATA = 6;
26 public static final int TYPE_METADATA_REPLY = 7;
28 private JDBCResultSet rs = null;
29 private Map<String, Object> record = null;
30 private int rsID = -1;
31 private Exception err = null;
32 private XSQLBluePrint bluePrint = null;
34 public JDBCCommand() {
38 public void setType(int t) {
42 public JDBCCommand(Exception _err, int _RSID) {
43 this.type = TYPE_QUERY_ERROR;
48 public JDBCCommand(XSQLBluePrint bl) {
49 this.type = TYPE_METADATA_REPLY;
53 public JDBCCommand(JDBCResultSet _rs, int _type) {
54 this.type = TYPE_EXECUTE_QUERY;
57 this.rsID = rs.getID();
60 public JDBCCommand(Map<String, Object> _record, int _rsID) {
61 this.record = _record;
63 this.type = TYPE_QUERY_RECORD;
66 public JDBCCommand(int _rsID) {
68 this.type = TYPE_QUERY_FINISH;
71 public int getType() {
75 public JDBCResultSet getRS() {
79 public Map<String, Object> getRecord() {
83 public int getRSID() {
87 public Exception getERROR() {
91 public XSQLBluePrint getBluePrint() {
92 return this.bluePrint;