comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 556:87feb93330a6 onclient

Misc. changes suggested by analysis tool
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Thu, 16 Sep 2021 11:14:55 +0200 (2021-09-16)
parents 9fa67487f38a
children ce2b616ed22e
comparison
equal deleted inserted replaced
555:90c346571eb4 556:87feb93330a6
2133 * @param line the header line as String 2133 * @param line the header line as String
2134 * @param linetype the line type according to the MAPI protocol 2134 * @param linetype the line type according to the MAPI protocol
2135 * @return a non-null String if the line is invalid, 2135 * @return a non-null String if the line is invalid,
2136 * or additional lines are not allowed. 2136 * or additional lines are not allowed.
2137 */ 2137 */
2138 public abstract String addLine(String line, LineType linetype); 2138 String addLine(String line, LineType linetype);
2139 2139
2140 /** 2140 /**
2141 * Returns whether this Response expects more lines to be added 2141 * Returns whether this Response expects more lines to be added
2142 * to it. 2142 * to it.
2143 * 2143 *
2144 * @return true if a next line should be added, false otherwise 2144 * @return true if a next line should be added, false otherwise
2145 */ 2145 */
2146 public abstract boolean wantsMore(); 2146 boolean wantsMore();
2147 2147
2148 /** 2148 /**
2149 * Indicates that no more header lines will be added to this 2149 * Indicates that no more header lines will be added to this
2150 * Response implementation. 2150 * Response implementation.
2151 * 2151 *
2158 2158
2159 /** 2159 /**
2160 * Instructs the Response implementation to close and do the 2160 * Instructs the Response implementation to close and do the
2161 * necessary clean up procedures. 2161 * necessary clean up procedures.
2162 */ 2162 */
2163 public abstract void close(); 2163 void close();
2164 } 2164 }
2165 // }}} 2165 // }}}
2166 2166
2167 /** 2167 /**
2168 * The ResultSetResponse represents a tabular result sent by the 2168 * The ResultSetResponse represents a tabular result sent by the
3048 res = new ResultSetResponse(id, tuplecount, columncount, rowcount, this, seqnr); 3048 res = new ResultSetResponse(id, tuplecount, columncount, rowcount, this, seqnr);
3049 // only add this resultset to the hashmap if it can possibly have an additional datablock 3049 // only add this resultset to the hashmap if it can possibly have an additional datablock
3050 if (rowcount < tuplecount) { 3050 if (rowcount < tuplecount) {
3051 if (rsresponses == null) 3051 if (rsresponses == null)
3052 rsresponses = new HashMap<Integer, ResultSetResponse>(); 3052 rsresponses = new HashMap<Integer, ResultSetResponse>();
3053 rsresponses.put(Integer.valueOf(id), (ResultSetResponse) res); 3053 rsresponses.put(id, (ResultSetResponse) res);
3054 } 3054 }
3055 } break; 3055 } break;
3056 case StartOfHeaderParser.Q_UPDATE: 3056 case StartOfHeaderParser.Q_UPDATE:
3057 res = new UpdateResponse(sohp.getNextAsLong(), // count 3057 res = new UpdateResponse(sohp.getNextAsLong(), // count
3058 sohp.getNextAsString() // key-id 3058 sohp.getNextAsString() // key-id
3076 sohp.getNextAsInt(); // columncount 3076 sohp.getNextAsInt(); // columncount
3077 final int rowcount = sohp.getNextAsInt(); 3077 final int rowcount = sohp.getNextAsInt();
3078 final int offset = sohp.getNextAsInt(); 3078 final int offset = sohp.getNextAsInt();
3079 final ResultSetResponse t; 3079 final ResultSetResponse t;
3080 if (rsresponses != null) 3080 if (rsresponses != null)
3081 t = rsresponses.get(Integer.valueOf(id)); 3081 t = rsresponses.get(id);
3082 else 3082 else
3083 t = null; 3083 t = null;
3084 if (t == null) { 3084 if (t == null) {
3085 error = "M0M12!no ResultSetResponse with id " + id + " found"; 3085 error = "M0M12!no ResultSetResponse with id " + id + " found";
3086 break; 3086 break;
3273 * Callback for sending files for COPY ON CLIENT 3273 * Callback for sending files for COPY ON CLIENT
3274 * 3274 *
3275 * To be registered with {@link MonetConnection#setUploadHandler(UploadHandler)} 3275 * To be registered with {@link MonetConnection#setUploadHandler(UploadHandler)}
3276 */ 3276 */
3277 3277
3278 public static interface UploadHandler { 3278 public interface UploadHandler {
3279 /** 3279 /**
3280 * Called if the server sends a request to read file data. 3280 * Called if the server sends a request to read file data.
3281 * 3281 *
3282 * Use the given handle to receive data or send errors to the server. 3282 * Use the given handle to receive data or send errors to the server.
3283 * @param handle Handle to communicate with the server 3283 * @param handle Handle to communicate with the server
3295 /** 3295 /**
3296 * Callback for receiving files with COPY ON CLIENT 3296 * Callback for receiving files with COPY ON CLIENT
3297 * 3297 *
3298 * To be registered with {@link MonetConnection#setDownloadHandler(DownloadHandler)} 3298 * To be registered with {@link MonetConnection#setDownloadHandler(DownloadHandler)}
3299 */ 3299 */
3300 public static interface DownloadHandler { 3300 public interface DownloadHandler {
3301 /** 3301 /**
3302 * Called if the server sends a request to write a file. 3302 * Called if the server sends a request to write a file.
3303 * 3303 *
3304 * Use the given handle to send data or errors to the server. 3304 * Use the given handle to send data or errors to the server.
3305 * 3305 *