/** * Send a GET request * @param path the path or URI * @return a Response object with response detail * @throws IOException */ public Response get(String path) throws IOException { return get(cluster, path); }
/** * Send a POST request * @param path the path or URI * @param contentType the content MIME type * @param content the content bytes * @return a Response object with response detail * @throws IOException */ public Response post(String path, String contentType, byte[] content) throws IOException { return post(cluster, path, contentType, content); }
/** * Constructor * @param cluster the cluster definition */ public Client(Cluster cluster) { initialize(cluster, false); }
@Override public void delete(List<Delete> deletes) throws IOException { for (Delete delete: deletes) { delete(delete); } }
@Override public void run() throws Exception { remoteAdmin.deleteTable("TestTable"); } });
/** * Send a DELETE request * @param path the path or URI * @return a Response object with response detail * @throws IOException */ public Response delete(String path) throws IOException { return delete(cluster, path); }
/** * Send a PUT request * @param path the path or URI * @param contentType the content MIME type * @param content the content bytes * @return a Response object with response detail * @throws IOException */ public Response put(String path, String contentType, byte[] content) throws IOException { return put(cluster, path, contentType, content); }
/** * @return the value of the Location header */ public String getLocation() { return getHeader("Location"); }
@Override public Result next() throws IOException { Result[] results = next(1); if (results == null || results.length < 1) { return null; } return results[0]; }
/** * Send a HEAD request * @param path the path or URI * @return a Response object with response detail * @throws IOException */ public Response head(String path) throws IOException { return head(cluster, path, null); }
@Override public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException { return doCheckAndDelete(row, family, qualifier, value, delete); }
@Override public void run() throws Exception { remoteAdmin.getClusterStatus(); } });
@Override public void run() throws Exception { remoteAdmin.getRestVersion(); } });
@Override public void run() throws Exception { remoteAdmin.getClusterVersion(); } });
@Override public void run() throws Exception { remoteAdmin.getTableList(); } });
/** * Send a GET request * @param path the path or URI * @param accept Accept header value * @return a Response object with response detail * @throws IOException */ public Response get(String path, String accept) throws IOException { return get(cluster, path, accept); }
/** * Send a DELETE request * @param path the path or URI * @param extraHdr additional Header to send * @return a Response object with response detail * @throws IOException */ public Response delete(String path, Header extraHdr) throws IOException { return delete(cluster, path, extraHdr); }
/** * Constructor * @param cluster the cluster definition * @param sslEnabled enable SSL or not */ public Client(Cluster cluster, boolean sslEnabled) { initialize(cluster, sslEnabled); }
/** * Send a GET request * @param path the path or URI * @param headers the HTTP headers to include in the request, * <tt>Accept</tt> must be supplied * @return a Response object with response detail * @throws IOException */ public Response get(String path, Header[] headers) throws IOException { return get(cluster, path, headers); }
/** * Send a GET request * @param cluster the cluster definition * @param path the path or URI * @return a Response object with response detail * @throws IOException */ public Response get(Cluster cluster, String path) throws IOException { return get(cluster, path, EMPTY_HEADER_ARRAY); }