@Test public void testBulkRequest() { Connection db = getConnection(); long app = getAppId(); try { Record record; List<Record> records = new ArrayList<Record>(); List<Long> ids = insertRecords(); ResultSet rs = db.select(app, "order by Record_number asc"); if (rs.size() != 3) { fail("invalid count"); } int i = 0; while (rs.next()) { record = new Record(); record.setId(rs.getId()); record.setRevision(rs.getRevision()); record.setString("Single_line_text", "hoge" + i); records.add(record); i++; } BulkRequest bulk = new BulkRequest(); bulk.updateByRecords(app, records); records = new ArrayList<Record>(); record = new Record(); record.setString("Single_line_text", "fuga"); records.add(record); record = new Record(); record.setString("Single_line_text", "piyo"); records.add(record); bulk.insert(app, records); bulk.delete(app, ids.get(1)); db.bulkRequest(bulk); rs = db.select(app, "order by Record_number asc"); if (rs.size() != 4) { fail("invalid count"); } i = 0; String[] values = { "hoge0", "hoge2", "fuga", "piyo" }; while (rs.next()) { if (!rs.getString("Single_line_text").equals(values[i])) { fail("invalid value:" + values[i]); } i++; } } catch (Exception e) { fail("db exception:" + e.getMessage()); } }
public void bulkRequest(BulkRequest bulk) throws DBException { String json = bulk.getJson(); request("POST", "bulkRequest.json", json); }
Connection { public void bulkRequest(BulkRequest bulk) throws DBException { String json = bulk.getJson(); request("POST", "bulkRequest.json", json); } }
Connection { public void bulkRequest(BulkRequest bulk) throws DBException { String json = bulk.getJson(); request("POST", "bulkRequest.json", json); } Connection(String domain, String login, String password);  Connection(String domain, String apiToken); }
Connection { public void bulkRequest(BulkRequest bulk) throws DBException { String json = bulk.getJson(); request("POST", "bulkRequest.json", json); } Connection(String domain, String login, String password);  Connection(String domain, String apiToken); void close(); boolean isTrustAllHosts(); void setTrustAllHosts(boolean trustAllHosts); void setBasicAuth(final String username, final String password); long getGuestSpaceId(); void setGuestSpaceId(long guestSpaceId); void addHeader(String name, String value); void setProxy(String host, int port); void setClientCert(String cert, String password); String request(String method, String api, String body); Properties getProperties(); String request(String method, String api, String body, File outFile); ResultSet select(long app, String query); ResultSet selectWithTotalCount(long app, String query); ResultSet select(long app, String query, String[] columns); ResultSet selectWithTotalCount(long app, String query, String[] columns); long insert(long app, Record record); void lazyUpload(Field field); List<Long> insert(long app, List<Record> records); void update(long app, long id, Record record); long updateRecord(long app, Record record); void update(long app, List<Long> ids, Record record); void updateRecords(long app, List<Record> records); void updateByQuery(long app, String query, Record record); long updateRecordByKey(long app, String key, Record record); void updateRecordsByKey(long app, String key, List<Record> records); long updateAssignees(long app, long id, List<String> codes, long revision); long updateAssignees(long app, long id, List<String> codes); long updateStatus(long app, long id, String action, String assignee, long revision); long updateStatus(long app, long id, String action, String assignee); void updateStatus(long app, List<Long> ids, List<String> actions, List<String> assignees, List<Long> revisions); void delete(long app, long id); void deleteRecord(long app, Record record); void deleteRecords(long app, List<Record> records); void delete(long app, List<Long> ids); void deleteByQuery(long app, String query); String uploadFile(File file, String contentType); String uploadFile(File file); String uploadFile(String contentType, InputStream file, String fileName); File downloadFile(String fileKey); void bulkRequest(BulkRequest bulk); AppDto getApp(long id); List<AppDto> getApps(String name); List<AppDto> getApps(List<Long> ids, List<String> codes, 
    		String name, List<Long> spaceIds, long limit, long offset); long addComment(long app, long record, String text, List<MentionDto> mentions); void deleteComment(long app, long record, long id); CommentSet getComments(long app, long record, boolean descending, long limit, long offset); CommentSet getComments(long app, long record, boolean descending); }
Connection { public void bulkRequest(BulkRequest bulk) throws DBException { String json = bulk.getJson(); request("POST", "bulkRequest.json", json); } Connection(String domain, String login, String password);  Connection(String domain, String apiToken); void close(); boolean isTrustAllHosts(); void setTrustAllHosts(boolean trustAllHosts); void setBasicAuth(final String username, final String password); long getGuestSpaceId(); void setGuestSpaceId(long guestSpaceId); void addHeader(String name, String value); void setProxy(String host, int port); void setClientCert(String cert, String password); String request(String method, String api, String body); Properties getProperties(); String request(String method, String api, String body, File outFile); ResultSet select(long app, String query); ResultSet selectWithTotalCount(long app, String query); ResultSet select(long app, String query, String[] columns); ResultSet selectWithTotalCount(long app, String query, String[] columns); long insert(long app, Record record); void lazyUpload(Field field); List<Long> insert(long app, List<Record> records); void update(long app, long id, Record record); long updateRecord(long app, Record record); void update(long app, List<Long> ids, Record record); void updateRecords(long app, List<Record> records); void updateByQuery(long app, String query, Record record); long updateRecordByKey(long app, String key, Record record); void updateRecordsByKey(long app, String key, List<Record> records); long updateAssignees(long app, long id, List<String> codes, long revision); long updateAssignees(long app, long id, List<String> codes); long updateStatus(long app, long id, String action, String assignee, long revision); long updateStatus(long app, long id, String action, String assignee); void updateStatus(long app, List<Long> ids, List<String> actions, List<String> assignees, List<Long> revisions); void delete(long app, long id); void deleteRecord(long app, Record record); void deleteRecords(long app, List<Record> records); void delete(long app, List<Long> ids); void deleteByQuery(long app, String query); String uploadFile(File file, String contentType); String uploadFile(File file); String uploadFile(String contentType, InputStream file, String fileName); File downloadFile(String fileKey); void bulkRequest(BulkRequest bulk); AppDto getApp(long id); List<AppDto> getApps(String name); List<AppDto> getApps(List<Long> ids, List<String> codes, 
    		String name, List<Long> spaceIds, long limit, long offset); long addComment(long app, long record, String text, List<MentionDto> mentions); void deleteComment(long app, long record, long id); CommentSet getComments(long app, long record, boolean descending, long limit, long offset); CommentSet getComments(long app, long record, boolean descending); static final String DEFAULT_CONTENT_TYPE; }