Revert "HBASE-26523 Upgrade hbase-thirdparty dependency to 4.0.0 (#3910)"
[hbase.git] / hbase-rest / src / test / java / org / apache / hadoop / hbase / rest / RowResourceBase.java
blobdd309d7bc95b964ff04a5f4ef80259454c54e918
1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package org.apache.hadoop.hbase.rest;
20 import static org.junit.Assert.assertEquals;
22 import com.fasterxml.jackson.databind.ObjectMapper;
23 import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
25 import java.io.ByteArrayInputStream;
26 import java.io.IOException;
27 import java.io.StringWriter;
29 import java.util.HashMap;
30 import java.util.Map;
31 import javax.ws.rs.core.MediaType;
32 import javax.xml.bind.JAXBContext;
33 import javax.xml.bind.JAXBException;
34 import javax.xml.bind.Marshaller;
35 import javax.xml.bind.Unmarshaller;
37 import org.apache.hadoop.conf.Configuration;
38 import org.apache.hadoop.hbase.HBaseTestingUtil;
39 import org.apache.hadoop.hbase.TableName;
40 import org.apache.hadoop.hbase.client.Admin;
41 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
42 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
43 import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
44 import org.apache.hadoop.hbase.rest.client.Client;
45 import org.apache.hadoop.hbase.rest.client.Cluster;
46 import org.apache.hadoop.hbase.rest.client.Response;
47 import org.apache.hadoop.hbase.rest.model.CellModel;
48 import org.apache.hadoop.hbase.rest.model.CellSetModel;
49 import org.apache.hadoop.hbase.rest.model.RowModel;
50 import org.apache.hadoop.hbase.util.Bytes;
51 import org.junit.After;
52 import org.junit.AfterClass;
53 import org.junit.Before;
54 import org.junit.BeforeClass;
56 public class RowResourceBase {
57 protected static final String TABLE = "TestRowResource";
59 protected static final TableName TABLE_NAME = TableName.valueOf(TABLE);
61 protected static final String CFA = "a";
62 protected static final String CFB = "b";
63 protected static final String COLUMN_1 = CFA + ":1";
64 protected static final String COLUMN_2 = CFB + ":2";
65 protected static final String COLUMN_3 = CFA + ":";
66 protected static final String ROW_1 = "testrow1";
67 protected static final String VALUE_1 = "testvalue1";
68 protected static final String ROW_2 = "testrow2";
69 protected static final String VALUE_2 = "testvalue2";
70 protected static final String ROW_3 = "testrow3";
71 protected static final String VALUE_3 = "testvalue3";
72 protected static final String ROW_4 = "testrow4";
73 protected static final String VALUE_4 = "testvalue4";
74 protected static final String VALUE_5 = "5";
75 protected static final String VALUE_6 = "6";
77 protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
78 protected static final HBaseRESTTestingUtility REST_TEST_UTIL =
79 new HBaseRESTTestingUtility();
80 protected static Client client;
81 protected static JAXBContext context;
82 protected static Marshaller xmlMarshaller;
83 protected static Unmarshaller xmlUnmarshaller;
84 protected static Configuration conf;
85 protected static ObjectMapper jsonMapper;
87 @BeforeClass
88 public static void setUpBeforeClass() throws Exception {
89 conf = TEST_UTIL.getConfiguration();
90 TEST_UTIL.startMiniCluster(3);
91 REST_TEST_UTIL.startServletContainer(conf);
92 context = JAXBContext.newInstance(
93 CellModel.class,
94 CellSetModel.class,
95 RowModel.class);
96 xmlMarshaller = context.createMarshaller();
97 xmlUnmarshaller = context.createUnmarshaller();
98 jsonMapper = new JacksonJaxbJsonProvider()
99 .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
100 client = new Client(new Cluster().add("localhost",
101 REST_TEST_UTIL.getServletPort()));
104 @AfterClass
105 public static void tearDownAfterClass() throws Exception {
106 REST_TEST_UTIL.shutdownServletContainer();
107 TEST_UTIL.shutdownMiniCluster();
110 @Before
111 public void beforeMethod() throws Exception {
112 Admin admin = TEST_UTIL.getAdmin();
113 if (admin.tableExists(TABLE_NAME)) {
114 TEST_UTIL.deleteTable(TABLE_NAME);
116 TableDescriptorBuilder tableDescriptorBuilder =
117 TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE));
118 ColumnFamilyDescriptor columnFamilyDescriptor = ColumnFamilyDescriptorBuilder
119 .newBuilder(Bytes.toBytes(CFA)).build();
120 tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
121 columnFamilyDescriptor = ColumnFamilyDescriptorBuilder
122 .newBuilder(Bytes.toBytes(CFB)).build();
123 tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
124 admin.createTable(tableDescriptorBuilder.build());
127 @After
128 public void afterMethod() throws Exception {
129 Admin admin = TEST_UTIL.getAdmin();
130 if (admin.tableExists(TABLE_NAME)) {
131 TEST_UTIL.deleteTable(TABLE_NAME);
135 static Response putValuePB(String table, String row, String column,
136 String value) throws IOException {
137 StringBuilder path = new StringBuilder();
138 path.append('/');
139 path.append(table);
140 path.append('/');
141 path.append(row);
142 path.append('/');
143 path.append(column);
144 return putValuePB(path.toString(), table, row, column, value);
147 static Response putValuePB(String url, String table, String row,
148 String column, String value) throws IOException {
149 RowModel rowModel = new RowModel(row);
150 rowModel.addCell(new CellModel(Bytes.toBytes(column),
151 Bytes.toBytes(value)));
152 CellSetModel cellSetModel = new CellSetModel();
153 cellSetModel.addRow(rowModel);
154 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
155 cellSetModel.createProtobufOutput());
156 Thread.yield();
157 return response;
160 protected static void checkValueXML(String url, String table, String row,
161 String column, String value) throws IOException, JAXBException {
162 Response response = getValueXML(url);
163 assertEquals(200, response.getCode());
164 assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
165 CellSetModel cellSet = (CellSetModel)
166 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response.getBody()));
167 RowModel rowModel = cellSet.getRows().get(0);
168 CellModel cell = rowModel.getCells().get(0);
169 assertEquals(Bytes.toString(cell.getColumn()), column);
170 assertEquals(Bytes.toString(cell.getValue()), value);
173 protected static void checkValueXML(String table, String row, String column,
174 String value) throws IOException, JAXBException {
175 Response response = getValueXML(table, row, column);
176 assertEquals(200, response.getCode());
177 assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
178 CellSetModel cellSet = (CellSetModel)
179 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response.getBody()));
180 RowModel rowModel = cellSet.getRows().get(0);
181 CellModel cell = rowModel.getCells().get(0);
182 assertEquals(Bytes.toString(cell.getColumn()), column);
183 assertEquals(Bytes.toString(cell.getValue()), value);
186 protected static void checkIncrementValueXML(String table, String row, String column, long value)
187 throws IOException, JAXBException {
188 Response response1 = getValueXML(table, row, column);
189 assertEquals(200, response1.getCode());
190 assertEquals(Constants.MIMETYPE_XML, response1.getHeader("content-type"));
191 CellSetModel cellSet = (CellSetModel)
192 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response1.getBody()));
193 RowModel rowModel = cellSet.getRows().get(0);
194 CellModel cell = rowModel.getCells().get(0);
195 assertEquals(Bytes.toString(cell.getColumn()), column);
196 assertEquals(Bytes.toLong(cell.getValue()), value);
199 protected static Response getValuePB(String url) throws IOException {
200 Response response = client.get(url, Constants.MIMETYPE_PROTOBUF);
201 return response;
204 protected static Response putValueXML(String table, String row, String column,
205 String value) throws IOException, JAXBException {
206 StringBuilder path = new StringBuilder();
207 path.append('/');
208 path.append(table);
209 path.append('/');
210 path.append(row);
211 path.append('/');
212 path.append(column);
213 return putValueXML(path.toString(), table, row, column, value);
216 protected static Response putValueXML(String url, String table, String row,
217 String column, String value) throws IOException, JAXBException {
218 RowModel rowModel = new RowModel(row);
219 rowModel.addCell(new CellModel(Bytes.toBytes(column),
220 Bytes.toBytes(value)));
221 CellSetModel cellSetModel = new CellSetModel();
222 cellSetModel.addRow(rowModel);
223 StringWriter writer = new StringWriter();
224 xmlMarshaller.marshal(cellSetModel, writer);
225 Response response = client.put(url, Constants.MIMETYPE_XML,
226 Bytes.toBytes(writer.toString()));
227 Thread.yield();
228 return response;
231 protected static Response getValuePB(String table, String row, String column)
232 throws IOException {
233 StringBuilder path = new StringBuilder();
234 path.append('/');
235 path.append(table);
236 path.append('/');
237 path.append(row);
238 path.append('/');
239 path.append(column);
240 return getValuePB(path.toString());
243 protected static void checkValuePB(String table, String row, String column,
244 String value) throws IOException {
245 Response response = getValuePB(table, row, column);
246 assertEquals(200, response.getCode());
247 assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
248 CellSetModel cellSet = new CellSetModel();
249 cellSet.getObjectFromMessage(response.getBody());
250 RowModel rowModel = cellSet.getRows().get(0);
251 CellModel cell = rowModel.getCells().get(0);
252 assertEquals(Bytes.toString(cell.getColumn()), column);
253 assertEquals(Bytes.toString(cell.getValue()), value);
256 protected static void checkIncrementValuePB(String table, String row, String column,
257 long value) throws IOException {
258 Response response = getValuePB(table, row, column);
259 assertEquals(200, response.getCode());
260 assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
261 CellSetModel cellSet = new CellSetModel();
262 cellSet.getObjectFromMessage(response.getBody());
263 RowModel rowModel = cellSet.getRows().get(0);
264 CellModel cell = rowModel.getCells().get(0);
265 assertEquals(Bytes.toString(cell.getColumn()), column);
266 assertEquals(Bytes.toLong(cell.getValue()), value);
269 protected static Response checkAndPutValuePB(String url, String table, String row, String column,
270 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
271 throws IOException {
272 RowModel rowModel = new RowModel(row);
273 rowModel.addCell(new CellModel(Bytes.toBytes(column),
274 Bytes.toBytes(valueToPut)));
276 if (otherCells != null) {
277 for (Map.Entry<String,String> entry : otherCells.entrySet()) {
278 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
279 Bytes.toBytes(entry.getValue())));
283 // This Cell need to be added as last cell.
284 rowModel.addCell(new CellModel(Bytes.toBytes(column),
285 Bytes.toBytes(valueToCheck)));
287 CellSetModel cellSetModel = new CellSetModel();
288 cellSetModel.addRow(rowModel);
289 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
290 cellSetModel.createProtobufOutput());
291 Thread.yield();
292 return response;
295 protected static Response checkAndPutValuePB(String table, String row,
296 String column, String valueToCheck, String valueToPut) throws IOException {
297 return checkAndPutValuePB(table,row,column,valueToCheck,valueToPut,null);
300 protected static Response checkAndPutValuePB(String table, String row, String column,
301 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
302 throws IOException {
303 StringBuilder path = new StringBuilder();
304 path.append('/');
305 path.append(table);
306 path.append('/');
307 path.append(row);
308 path.append("?check=put");
309 return checkAndPutValuePB(path.toString(), table, row, column,
310 valueToCheck, valueToPut, otherCells);
313 protected static Response checkAndPutValueXML(String url, String table, String row, String column,
314 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
315 throws IOException, JAXBException {
316 RowModel rowModel = new RowModel(row);
317 rowModel.addCell(new CellModel(Bytes.toBytes(column),
318 Bytes.toBytes(valueToPut)));
320 if (otherCells != null) {
321 for (Map.Entry<String,String> entry : otherCells.entrySet()) {
322 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
323 Bytes.toBytes(entry.getValue())));
327 // This Cell need to be added as last cell.
328 rowModel.addCell(new CellModel(Bytes.toBytes(column),
329 Bytes.toBytes(valueToCheck)));
330 CellSetModel cellSetModel = new CellSetModel();
331 cellSetModel.addRow(rowModel);
332 StringWriter writer = new StringWriter();
333 xmlMarshaller.marshal(cellSetModel, writer);
334 Response response = client.put(url, Constants.MIMETYPE_XML,
335 Bytes.toBytes(writer.toString()));
336 Thread.yield();
337 return response;
340 protected static Response checkAndPutValueXML(String table, String row, String column,
341 String valueToCheck, String valueToPut) throws IOException, JAXBException {
342 return checkAndPutValueXML(table,row,column,valueToCheck,valueToPut, null);
345 protected static Response checkAndPutValueXML(String table, String row,
346 String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
347 throws IOException, JAXBException {
348 StringBuilder path = new StringBuilder();
349 path.append('/');
350 path.append(table);
351 path.append('/');
352 path.append(row);
353 path.append("?check=put");
354 return checkAndPutValueXML(path.toString(), table, row, column,
355 valueToCheck, valueToPut, otherCells);
358 protected static Response checkAndDeleteXML(String url, String table,
359 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
360 throws IOException, JAXBException {
361 RowModel rowModel = new RowModel(row);
363 if (cellsToDelete != null) {
364 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
365 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
366 Bytes.toBytes(entry.getValue())));
369 // Add this at the end
370 rowModel.addCell(new CellModel(Bytes.toBytes(column),
371 Bytes.toBytes(valueToCheck)));
372 CellSetModel cellSetModel = new CellSetModel();
373 cellSetModel.addRow(rowModel);
374 StringWriter writer = new StringWriter();
375 xmlMarshaller.marshal(cellSetModel, writer);
376 Response response = client.put(url, Constants.MIMETYPE_XML,
377 Bytes.toBytes(writer.toString()));
378 Thread.yield();
379 return response;
382 protected static Response checkAndDeleteXML(String table, String row,
383 String column, String valueToCheck) throws IOException, JAXBException {
384 return checkAndDeleteXML(table, row, column, valueToCheck, null);
387 protected static Response checkAndDeleteXML(String table, String row,
388 String column, String valueToCheck, HashMap<String,String> cellsToDelete)
389 throws IOException, JAXBException {
390 StringBuilder path = new StringBuilder();
391 path.append('/');
392 path.append(table);
393 path.append('/');
394 path.append(row);
395 path.append("?check=delete");
396 return checkAndDeleteXML(path.toString(), table, row, column, valueToCheck, cellsToDelete);
399 protected static Response checkAndDeleteJson(String table, String row,
400 String column, String valueToCheck) throws IOException {
401 return checkAndDeleteJson(table, row, column, valueToCheck, null);
404 protected static Response checkAndDeleteJson(String table, String row,
405 String column, String valueToCheck, HashMap<String,String> cellsToDelete)
406 throws IOException {
407 StringBuilder path = new StringBuilder();
408 path.append('/');
409 path.append(table);
410 path.append('/');
411 path.append(row);
412 path.append("?check=delete");
413 return checkAndDeleteJson(path.toString(), table, row, column, valueToCheck, cellsToDelete);
416 protected static Response checkAndDeleteJson(String url, String table,
417 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
418 throws IOException {
419 RowModel rowModel = new RowModel(row);
421 if (cellsToDelete != null) {
422 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
423 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
424 Bytes.toBytes(entry.getValue())));
427 // Add this at the end
428 rowModel.addCell(new CellModel(Bytes.toBytes(column),
429 Bytes.toBytes(valueToCheck)));
430 CellSetModel cellSetModel = new CellSetModel();
431 cellSetModel.addRow(rowModel);
432 String jsonString = jsonMapper.writeValueAsString(cellSetModel);
433 Response response = client.put(url, Constants.MIMETYPE_JSON,
434 Bytes.toBytes(jsonString));
435 Thread.yield();
436 return response;
439 protected static Response checkAndDeletePB(String table, String row, String column, String value)
440 throws IOException {
441 return checkAndDeletePB(table, row, column, value, null);
444 protected static Response checkAndDeletePB(String table, String row,
445 String column, String value, HashMap<String,String> cellsToDelete) throws IOException {
446 StringBuilder path = new StringBuilder();
447 path.append('/');
448 path.append(table);
449 path.append('/');
450 path.append(row);
451 path.append("?check=delete");
452 return checkAndDeleteValuePB(path.toString(), table, row, column, value, cellsToDelete);
454 protected static Response checkAndDeleteValuePB(String url, String table,
455 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
456 throws IOException {
457 RowModel rowModel = new RowModel(row);
459 if (cellsToDelete != null) {
460 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
461 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
462 Bytes.toBytes(entry.getValue())));
465 // Add this at the end
466 rowModel.addCell(new CellModel(Bytes.toBytes(column), Bytes
467 .toBytes(valueToCheck)));
468 CellSetModel cellSetModel = new CellSetModel();
469 cellSetModel.addRow(rowModel);
470 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
471 cellSetModel.createProtobufOutput());
472 Thread.yield();
473 return response;
476 protected static Response getValueXML(String table, String startRow,
477 String endRow, String column) throws IOException {
478 StringBuilder path = new StringBuilder();
479 path.append('/');
480 path.append(table);
481 path.append('/');
482 path.append(startRow);
483 path.append(",");
484 path.append(endRow);
485 path.append('/');
486 path.append(column);
487 return getValueXML(path.toString());
490 protected static Response getValueXML(String url) throws IOException {
491 Response response = client.get(url, Constants.MIMETYPE_XML);
492 return response;
495 protected static Response getValueJson(String url) throws IOException {
496 Response response = client.get(url, Constants.MIMETYPE_JSON);
497 return response;
500 protected static Response deleteValue(String table, String row, String column)
501 throws IOException {
502 StringBuilder path = new StringBuilder();
503 path.append('/');
504 path.append(table);
505 path.append('/');
506 path.append(row);
507 path.append('/');
508 path.append(column);
509 Response response = client.delete(path.toString());
510 Thread.yield();
511 return response;
514 protected static Response getValueXML(String table, String row, String column)
515 throws IOException {
516 StringBuilder path = new StringBuilder();
517 path.append('/');
518 path.append(table);
519 path.append('/');
520 path.append(row);
521 path.append('/');
522 path.append(column);
523 return getValueXML(path.toString());
526 protected static Response deleteRow(String table, String row)
527 throws IOException {
528 StringBuilder path = new StringBuilder();
529 path.append('/');
530 path.append(table);
531 path.append('/');
532 path.append(row);
533 Response response = client.delete(path.toString());
534 Thread.yield();
535 return response;
538 protected static Response getValueJson(String table, String row,
539 String column) throws IOException {
540 StringBuilder path = new StringBuilder();
541 path.append('/');
542 path.append(table);
543 path.append('/');
544 path.append(row);
545 path.append('/');
546 path.append(column);
547 return getValueJson(path.toString());
550 protected static void checkValueJSON(String table, String row, String column,
551 String value) throws IOException {
552 Response response = getValueJson(table, row, column);
553 assertEquals(200, response.getCode());
554 assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
555 ObjectMapper mapper = new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class,
556 MediaType.APPLICATION_JSON_TYPE);
557 CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
558 RowModel rowModel = cellSet.getRows().get(0);
559 CellModel cell = rowModel.getCells().get(0);
560 assertEquals(Bytes.toString(cell.getColumn()), column);
561 assertEquals(Bytes.toString(cell.getValue()), value);
564 protected static void checkIncrementValueJSON(String table, String row, String column,
565 long value) throws IOException {
566 Response response = getValueJson(table, row, column);
567 assertEquals(200, response.getCode());
568 assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
569 ObjectMapper mapper = new JacksonJaxbJsonProvider()
570 .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
571 CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
572 RowModel rowModel = cellSet.getRows().get(0);
573 CellModel cell = rowModel.getCells().get(0);
574 assertEquals(Bytes.toString(cell.getColumn()), column);
575 assertEquals(Bytes.toLong(cell.getValue()), value);
578 protected static Response putValueJson(String table, String row, String column,
579 String value) throws IOException {
580 StringBuilder path = new StringBuilder();
581 path.append('/');
582 path.append(table);
583 path.append('/');
584 path.append(row);
585 path.append('/');
586 path.append(column);
587 return putValueJson(path.toString(), table, row, column, value);
590 protected static Response putValueJson(String url, String table, String row, String column,
591 String value) throws IOException {
592 RowModel rowModel = new RowModel(row);
593 rowModel.addCell(new CellModel(Bytes.toBytes(column),
594 Bytes.toBytes(value)));
595 CellSetModel cellSetModel = new CellSetModel();
596 cellSetModel.addRow(rowModel);
597 String jsonString = jsonMapper.writeValueAsString(cellSetModel);
598 Response response = client.put(url, Constants.MIMETYPE_JSON,
599 Bytes.toBytes(jsonString));
600 Thread.yield();
601 return response;
604 protected static Response appendValueXML(String table, String row, String column,
605 String value) throws IOException, JAXBException {
606 StringBuilder path = new StringBuilder();
607 path.append('/');
608 path.append(table);
609 path.append('/');
610 path.append(row);
611 path.append("?check=append");
612 return putValueXML(path.toString(), table, row, column, value);
615 protected static Response appendValuePB(String table, String row, String column,
616 String value) throws IOException {
617 StringBuilder path = new StringBuilder();
618 path.append('/');
619 path.append(table);
620 path.append('/');
621 path.append(row);
622 path.append("?check=append");
623 return putValuePB(path.toString(), table, row, column, value);
626 protected static Response appendValueJson(String table, String row, String column,
627 String value) throws IOException, JAXBException {
628 StringBuilder path = new StringBuilder();
629 path.append('/');
630 path.append(table);
631 path.append('/');
632 path.append(row);
633 path.append("?check=append");
634 return putValueJson(path.toString(), table, row, column, value);
637 protected static Response incrementValueXML(String table, String row, String column,
638 String value) throws IOException, JAXBException {
639 StringBuilder path = new StringBuilder();
640 path.append('/');
641 path.append(table);
642 path.append('/');
643 path.append(row);
644 path.append("?check=increment");
645 return putValueXML(path.toString(), table, row, column, value);
648 protected static Response incrementValuePB(String table, String row, String column,
649 String value) throws IOException {
650 StringBuilder path = new StringBuilder();
651 path.append('/');
652 path.append(table);
653 path.append('/');
654 path.append(row);
655 path.append("?check=increment");
656 return putValuePB(path.toString(), table, row, column, value);
659 protected static Response incrementValueJson(String table, String row, String column,
660 String value) throws IOException, JAXBException {
661 StringBuilder path = new StringBuilder();
662 path.append('/');
663 path.append(table);
664 path.append('/');
665 path.append(row);
666 path.append("?check=increment");
667 return putValueJson(path.toString(), table, row, column, value);