http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryExecuteRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryExecuteRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryExecuteRequest.java deleted file mode 100644 index a5da36a..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryExecuteRequest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.request; - -/** - * ODBC query execute request. - */ -public class OdbcQueryExecuteRequest extends OdbcRequest { - /** Cache name. */ - private String cacheName; - - /** Sql query. */ - private String sqlQry; - - /** Sql query arguments. */ - private Object[] args; - - /** - * @param cacheName Cache name. - * @param sqlQry SQL query. - * @param args Arguments list. - */ - public OdbcQueryExecuteRequest(String cacheName, String sqlQry, Object[] args) { - super(EXECUTE_SQL_QUERY); - this.cacheName = cacheName; - this.sqlQry = sqlQry; - this.args = args; - } - - /** - * @param sqlQry Sql query. - */ - public void sqlQuery(String sqlQry) { - this.sqlQry = sqlQry; - } - - /** - * @return Sql query. - */ - public String sqlQuery() { - return sqlQry; - } - - /** - * @param args Sql query arguments. - */ - public void arguments(Object[] args) { - this.args = args; - } - - /** - * @return Sql query arguments. - */ - public Object[] arguments() { - return args; - } - - /** - * @param cacheName Cache name. - */ - public void cacheName(String cacheName) { - this.cacheName = cacheName; - } - - /** - * @return Cache name. - */ - public String cacheName() { - return cacheName; - } -}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryFetchRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryFetchRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryFetchRequest.java deleted file mode 100644 index d30ecf7..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryFetchRequest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.request; - -/** - * ODBC query fetch request. - */ -public class OdbcQueryFetchRequest extends OdbcRequest { - /** Query ID. */ - private long queryId; - - /** Page size - maximum number of rows to return. */ - private Integer pageSize; - - /** - * @param queryId Query ID. - * @param pageSize Page size. - */ - public OdbcQueryFetchRequest(long queryId, int pageSize) { - super(FETCH_SQL_QUERY); - this.queryId = queryId; - this.pageSize = pageSize; - } - - /** - * @param pageSize Page size. - */ - public void pageSize(Integer pageSize) { - this.pageSize = pageSize; - } - - /** - * @return Page size. - */ - public int pageSize() { - return pageSize; - } - - /** - * @param queryId Query ID. - */ - public void cacheName(long queryId) { - this.queryId = queryId; - } - - /** - * @return Query ID. - */ - public long queryId() { - return queryId; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetColumnsMetaRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetColumnsMetaRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetColumnsMetaRequest.java deleted file mode 100644 index 3ab2a16..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetColumnsMetaRequest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.request; - -/** - * ODBC query get columns meta request. - */ -public class OdbcQueryGetColumnsMetaRequest extends OdbcRequest { - /** Cache name. */ - private String cacheName; - - /** Table name. */ - private String tableName; - - /** Column name. */ - private String columnName; - - /** - * @param cacheName Cache name. - */ - public OdbcQueryGetColumnsMetaRequest(String cacheName, String tableName, String columnName) { - super(GET_COLUMNS_META); - - this.cacheName = cacheName; - this.tableName = tableName; - this.columnName = columnName; - } - - /** - * @param cacheName Cache name. - */ - public void cacheName(String cacheName) { - this.cacheName = cacheName; - } - - /** - * @return Cache name. - */ - public String cacheName() { - return cacheName; - } - - /** - * @param tableName Table name. - */ - public void tableName(String tableName) { - this.tableName = tableName; - } - - /** - * @return Table name. - */ - public String tableName() { - return tableName; - } - - /** - * @param columnName Column name. - */ - public void columnName(String columnName) { - this.columnName = columnName; - } - - /** - * @return Column name. - */ - public String columnName() { - return columnName; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetTablesMetaRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetTablesMetaRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetTablesMetaRequest.java deleted file mode 100644 index 811091c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcQueryGetTablesMetaRequest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.request; - -/** - * ODBC query get tables meta request. - */ -public class OdbcQueryGetTablesMetaRequest extends OdbcRequest { - /** Catalog search pattern. */ - private String catalog; - - /** Schema search pattern. */ - private String schema; - - /** Table search pattern. */ - private String table; - - /** Table type search pattern. */ - private String tableType; - - /** - * @param catalog Catalog search pattern. - * @param schema Schema search pattern. - * @param table Table search pattern. - * @param tableType Table type search pattern. - */ - public OdbcQueryGetTablesMetaRequest(String catalog, String schema, String table, String tableType) { - super(GET_TABLES_META); - - this.catalog = catalog; - this.schema = schema; - this.table = table; - this.tableType = tableType; - } - - /** - * @param catalog Catalog search pattern. - */ - public void catalog(String catalog) { - this.catalog = catalog; - } - - /** - * @return catalog search pattern. - */ - public String catalog() { - return catalog; - } - - /** - * @param schema Schema search pattern. - */ - public void schema(String schema) { - this.schema = schema; - } - - /** - * @return Schema search pattern. - */ - public String schema() { - return schema; - } - - /** - * @param table Schema search pattern. - */ - public void table(String table) { - this.table = table; - } - - /** - * @return Table search pattern. - */ - public String table() { - return table; - } - - /** - * @param tableType Table type search pattern. - */ - public void tableType(String tableType) { - this.tableType = tableType; - } - - /** - * @return Table type search pattern. - */ - public String tableType() { - return tableType; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcRequest.java deleted file mode 100644 index 63bd747..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/OdbcRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.request; - -/** - * ODBC command request. - */ -public class OdbcRequest { - /** Execute sql query. */ - public static final int EXECUTE_SQL_QUERY = 1; - - /** Fetch query results. */ - public static final int FETCH_SQL_QUERY = 2; - - /** Close query. */ - public static final int CLOSE_SQL_QUERY = 3; - - /** Get columns meta query. */ - public static final int GET_COLUMNS_META = 4; - - /** Get columns meta query. */ - public static final int GET_TABLES_META = 5; - - /** Command. */ - private int cmd; - - /** - * @param cmd Command type. - */ - public OdbcRequest(int cmd) { - this.cmd = cmd; - } - - /** - * @return Command. - */ - public int command() { - return cmd; - } - - /** - * @param cmd Command. - */ - public void command(int cmd) { - this.cmd = cmd; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryCloseResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryCloseResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryCloseResult.java deleted file mode 100644 index c8cdd2c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryCloseResult.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -/** - * Query result. - */ -public class OdbcQueryCloseResult { - /** Query ID. */ - private long queryId; - - /** - * @param queryId Query ID. - */ - public OdbcQueryCloseResult(long queryId){ - this.queryId = queryId; - } - - /** - * @return Query ID. - */ - public long getQueryId() { - return queryId; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryExecuteResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryExecuteResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryExecuteResult.java deleted file mode 100644 index 119470e..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryExecuteResult.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -import org.apache.ignite.internal.processors.odbc.OdbcColumnMeta; - -import java.util.Collection; - -/** - * Query execute result. - */ -public class OdbcQueryExecuteResult { - /** Query ID. */ - private long queryId; - - /** Fields metadata. */ - private Collection<OdbcColumnMeta> columnsMeta; - - /** - * @param queryId Query ID. - * @param columnsMeta Columns metadata. - */ - public OdbcQueryExecuteResult(long queryId, Collection<OdbcColumnMeta> columnsMeta){ - this.queryId = queryId; - this.columnsMeta = columnsMeta; - } - - /** - * @return Query ID. - */ - public long getQueryId() { - return queryId; - } - - /** - * @return Columns metadata. - */ - public Collection<OdbcColumnMeta> getColumnsMetadata() { - return columnsMeta; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryFetchResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryFetchResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryFetchResult.java deleted file mode 100644 index 8385301..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryFetchResult.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -import java.util.Collection; - -/** - * Query fetch result. - */ -public class OdbcQueryFetchResult { - /** Query ID. */ - private long queryId; - - /** Query result rows. */ - private Collection<?> items = null; - - /** Flag indicating the query has no unfetched results. */ - private boolean last = false; - - /** - * @param queryId Query ID. - */ - public OdbcQueryFetchResult(long queryId){ - this.queryId = queryId; - } - - /** - * @return Query ID. - */ - public long getQueryId() { - return queryId; - } - - /** - * @param items Query result rows. - */ - public void setItems(Collection<?> items) { - this.items = items; - } - - /** - * @return Query result rows. - */ - public Collection<?> getItems() { - return items; - } - - /** - * @param last Flag indicating the query has no unfetched results. - */ - public void setLast(boolean last) { - this.last = last; - } - - /** - * @return Flag indicating the query has no unfetched results. - */ - public boolean getLast() { - return last; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetColumnsMetaResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetColumnsMetaResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetColumnsMetaResult.java deleted file mode 100644 index 46373ba..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetColumnsMetaResult.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -import org.apache.ignite.internal.processors.odbc.OdbcColumnMeta; - -import java.util.Collection; - -/** - * Query get columns meta result. - */ -public class OdbcQueryGetColumnsMetaResult { - /** Query result rows. */ - private Collection<OdbcColumnMeta> meta; - - /** - * @param meta Column metadata. - */ - public OdbcQueryGetColumnsMetaResult(Collection<OdbcColumnMeta> meta) { - this.meta = meta; - } - - /** - * @return Query result rows. - */ - public Collection<OdbcColumnMeta> getMeta() { - return meta; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetTablesMetaResult.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetTablesMetaResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetTablesMetaResult.java deleted file mode 100644 index 3d3cb86..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcQueryGetTablesMetaResult.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -import org.apache.ignite.internal.processors.odbc.OdbcTableMeta; - -import java.util.Collection; - -/** - * Query get columns meta result. - */ -public class OdbcQueryGetTablesMetaResult { - /** Query result rows. */ - private Collection<OdbcTableMeta> meta; - - /** - * @param meta Column metadata. - */ - public OdbcQueryGetTablesMetaResult(Collection<OdbcTableMeta> meta) { - this.meta = meta; - } - - /** - * @return Query result rows. - */ - public Collection<OdbcTableMeta> getMeta() { - return meta; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a756311/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcResponse.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcResponse.java deleted file mode 100644 index 038275d..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/OdbcResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ignite.internal.processors.odbc.response; - -import org.apache.ignite.internal.util.tostring.GridToStringInclude; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.jetbrains.annotations.Nullable; - -/** - * ODBC protocol response. - */ -public class OdbcResponse { - - /** Command succeeded. */ - public static final int STATUS_SUCCESS = 0; - - /** Command failed. */ - public static final int STATUS_FAILED = 1; - - /** Success status. */ - @SuppressWarnings("RedundantFieldInitialization") - private int successStatus = STATUS_SUCCESS; - - /** Error. */ - private String err; - - /** Response object. */ - @GridToStringInclude - private Object obj; - - /** - * Constructs successful rest response. - * - * @param obj Response object. - */ - public OdbcResponse(Object obj) { - successStatus = STATUS_SUCCESS; - this.obj = obj; - } - - /** - * Constructs failed rest response. - * - * @param status Response status. - * @param err Error, {@code null} if success is {@code true}. - */ - public OdbcResponse(int status, @Nullable String err) { - assert status != STATUS_SUCCESS; - - successStatus = status; - this.err = err; - } - - /** - * @return Success flag. - */ - public int getSuccessStatus() { - return successStatus; - } - - /** - * @return Response object. - */ - public Object getResponse() { - return obj; - } - - /** - * @param obj Response object. - */ - public void setResponse(@Nullable Object obj) { - this.obj = obj; - } - - /** - * @return Error. - */ - public String getError() { - return err; - } - - /** - * @param err Error. - */ - public void setError(String err) { - this.err = err; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(OdbcResponse.class, this); - } -}
