HBASE-26921 Rewrite the counting cells part in TestMultiVersions (#4316)
[hbase.git] / hbase-rest / src / test / java / org / apache / hadoop / hbase / rest / RowResourceBase.java
blob53f2f14ec6ae52763e6d5b09b893af0683cb2e38
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 java.io.ByteArrayInputStream;
24 import java.io.IOException;
25 import java.io.StringWriter;
26 import java.util.HashMap;
27 import java.util.Map;
28 import javax.xml.bind.JAXBContext;
29 import javax.xml.bind.JAXBException;
30 import javax.xml.bind.Marshaller;
31 import javax.xml.bind.Unmarshaller;
32 import org.apache.hadoop.conf.Configuration;
33 import org.apache.hadoop.hbase.HBaseTestingUtil;
34 import org.apache.hadoop.hbase.TableName;
35 import org.apache.hadoop.hbase.client.Admin;
36 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
37 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
38 import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
39 import org.apache.hadoop.hbase.rest.client.Client;
40 import org.apache.hadoop.hbase.rest.client.Cluster;
41 import org.apache.hadoop.hbase.rest.client.Response;
42 import org.apache.hadoop.hbase.rest.model.CellModel;
43 import org.apache.hadoop.hbase.rest.model.CellSetModel;
44 import org.apache.hadoop.hbase.rest.model.RowModel;
45 import org.apache.hadoop.hbase.util.Bytes;
46 import org.junit.After;
47 import org.junit.AfterClass;
48 import org.junit.Before;
49 import org.junit.BeforeClass;
51 import org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
52 import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
54 public class RowResourceBase {
55 protected static final String TABLE = "TestRowResource";
57 protected static final TableName TABLE_NAME = TableName.valueOf(TABLE);
59 protected static final String CFA = "a";
60 protected static final String CFB = "b";
61 protected static final String COLUMN_1 = CFA + ":1";
62 protected static final String COLUMN_2 = CFB + ":2";
63 protected static final String COLUMN_3 = CFA + ":";
64 protected static final String ROW_1 = "testrow1";
65 protected static final String VALUE_1 = "testvalue1";
66 protected static final String ROW_2 = "testrow2";
67 protected static final String VALUE_2 = "testvalue2";
68 protected static final String ROW_3 = "testrow3";
69 protected static final String VALUE_3 = "testvalue3";
70 protected static final String ROW_4 = "testrow4";
71 protected static final String VALUE_4 = "testvalue4";
72 protected static final String VALUE_5 = "5";
73 protected static final String VALUE_6 = "6";
75 protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
76 protected static final HBaseRESTTestingUtility REST_TEST_UTIL =
77 new HBaseRESTTestingUtility();
78 protected static Client client;
79 protected static JAXBContext context;
80 protected static Marshaller xmlMarshaller;
81 protected static Unmarshaller xmlUnmarshaller;
82 protected static Configuration conf;
83 protected static ObjectMapper jsonMapper;
85 @BeforeClass
86 public static void setUpBeforeClass() throws Exception {
87 conf = TEST_UTIL.getConfiguration();
88 TEST_UTIL.startMiniCluster(3);
89 REST_TEST_UTIL.startServletContainer(conf);
90 context = JAXBContext.newInstance(
91 CellModel.class,
92 CellSetModel.class,
93 RowModel.class);
94 xmlMarshaller = context.createMarshaller();
95 xmlUnmarshaller = context.createUnmarshaller();
96 jsonMapper = new JacksonJaxbJsonProvider()
97 .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
98 client = new Client(new Cluster().add("localhost",
99 REST_TEST_UTIL.getServletPort()));
102 @AfterClass
103 public static void tearDownAfterClass() throws Exception {
104 REST_TEST_UTIL.shutdownServletContainer();
105 TEST_UTIL.shutdownMiniCluster();
108 @Before
109 public void beforeMethod() throws Exception {
110 Admin admin = TEST_UTIL.getAdmin();
111 if (admin.tableExists(TABLE_NAME)) {
112 TEST_UTIL.deleteTable(TABLE_NAME);
114 TableDescriptorBuilder tableDescriptorBuilder =
115 TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE));
116 ColumnFamilyDescriptor columnFamilyDescriptor = ColumnFamilyDescriptorBuilder
117 .newBuilder(Bytes.toBytes(CFA)).build();
118 tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
119 columnFamilyDescriptor = ColumnFamilyDescriptorBuilder
120 .newBuilder(Bytes.toBytes(CFB)).build();
121 tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
122 admin.createTable(tableDescriptorBuilder.build());
125 @After
126 public void afterMethod() throws Exception {
127 Admin admin = TEST_UTIL.getAdmin();
128 if (admin.tableExists(TABLE_NAME)) {
129 TEST_UTIL.deleteTable(TABLE_NAME);
133 static Response putValuePB(String table, String row, String column,
134 String value) throws IOException {
135 StringBuilder path = new StringBuilder();
136 path.append('/');
137 path.append(table);
138 path.append('/');
139 path.append(row);
140 path.append('/');
141 path.append(column);
142 return putValuePB(path.toString(), table, row, column, value);
145 static Response putValuePB(String url, String table, String row,
146 String column, String value) throws IOException {
147 RowModel rowModel = new RowModel(row);
148 rowModel.addCell(new CellModel(Bytes.toBytes(column),
149 Bytes.toBytes(value)));
150 CellSetModel cellSetModel = new CellSetModel();
151 cellSetModel.addRow(rowModel);
152 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
153 cellSetModel.createProtobufOutput());
154 Thread.yield();
155 return response;
158 protected static void checkValueXML(String url, String table, String row,
159 String column, String value) throws IOException, JAXBException {
160 Response response = getValueXML(url);
161 assertEquals(200, response.getCode());
162 assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
163 CellSetModel cellSet = (CellSetModel)
164 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response.getBody()));
165 RowModel rowModel = cellSet.getRows().get(0);
166 CellModel cell = rowModel.getCells().get(0);
167 assertEquals(Bytes.toString(cell.getColumn()), column);
168 assertEquals(Bytes.toString(cell.getValue()), value);
171 protected static void checkValueXML(String table, String row, String column,
172 String value) throws IOException, JAXBException {
173 Response response = getValueXML(table, row, column);
174 assertEquals(200, response.getCode());
175 assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
176 CellSetModel cellSet = (CellSetModel)
177 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response.getBody()));
178 RowModel rowModel = cellSet.getRows().get(0);
179 CellModel cell = rowModel.getCells().get(0);
180 assertEquals(Bytes.toString(cell.getColumn()), column);
181 assertEquals(Bytes.toString(cell.getValue()), value);
184 protected static void checkIncrementValueXML(String table, String row, String column, long value)
185 throws IOException, JAXBException {
186 Response response1 = getValueXML(table, row, column);
187 assertEquals(200, response1.getCode());
188 assertEquals(Constants.MIMETYPE_XML, response1.getHeader("content-type"));
189 CellSetModel cellSet = (CellSetModel)
190 xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response1.getBody()));
191 RowModel rowModel = cellSet.getRows().get(0);
192 CellModel cell = rowModel.getCells().get(0);
193 assertEquals(Bytes.toString(cell.getColumn()), column);
194 assertEquals(Bytes.toLong(cell.getValue()), value);
197 protected static Response getValuePB(String url) throws IOException {
198 Response response = client.get(url, Constants.MIMETYPE_PROTOBUF);
199 return response;
202 protected static Response putValueXML(String table, String row, String column,
203 String value) throws IOException, JAXBException {
204 StringBuilder path = new StringBuilder();
205 path.append('/');
206 path.append(table);
207 path.append('/');
208 path.append(row);
209 path.append('/');
210 path.append(column);
211 return putValueXML(path.toString(), table, row, column, value);
214 protected static Response putValueXML(String url, String table, String row,
215 String column, String value) throws IOException, JAXBException {
216 RowModel rowModel = new RowModel(row);
217 rowModel.addCell(new CellModel(Bytes.toBytes(column),
218 Bytes.toBytes(value)));
219 CellSetModel cellSetModel = new CellSetModel();
220 cellSetModel.addRow(rowModel);
221 StringWriter writer = new StringWriter();
222 xmlMarshaller.marshal(cellSetModel, writer);
223 Response response = client.put(url, Constants.MIMETYPE_XML,
224 Bytes.toBytes(writer.toString()));
225 Thread.yield();
226 return response;
229 protected static Response getValuePB(String table, String row, String column)
230 throws IOException {
231 StringBuilder path = new StringBuilder();
232 path.append('/');
233 path.append(table);
234 path.append('/');
235 path.append(row);
236 path.append('/');
237 path.append(column);
238 return getValuePB(path.toString());
241 protected static void checkValuePB(String table, String row, String column,
242 String value) throws IOException {
243 Response response = getValuePB(table, row, column);
244 assertEquals(200, response.getCode());
245 assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
246 CellSetModel cellSet = new CellSetModel();
247 cellSet.getObjectFromMessage(response.getBody());
248 RowModel rowModel = cellSet.getRows().get(0);
249 CellModel cell = rowModel.getCells().get(0);
250 assertEquals(Bytes.toString(cell.getColumn()), column);
251 assertEquals(Bytes.toString(cell.getValue()), value);
254 protected static void checkIncrementValuePB(String table, String row, String column,
255 long value) throws IOException {
256 Response response = getValuePB(table, row, column);
257 assertEquals(200, response.getCode());
258 assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
259 CellSetModel cellSet = new CellSetModel();
260 cellSet.getObjectFromMessage(response.getBody());
261 RowModel rowModel = cellSet.getRows().get(0);
262 CellModel cell = rowModel.getCells().get(0);
263 assertEquals(Bytes.toString(cell.getColumn()), column);
264 assertEquals(Bytes.toLong(cell.getValue()), value);
267 protected static Response checkAndPutValuePB(String url, String table, String row, String column,
268 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
269 throws IOException {
270 RowModel rowModel = new RowModel(row);
271 rowModel.addCell(new CellModel(Bytes.toBytes(column),
272 Bytes.toBytes(valueToPut)));
274 if (otherCells != null) {
275 for (Map.Entry<String,String> entry : otherCells.entrySet()) {
276 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
277 Bytes.toBytes(entry.getValue())));
281 // This Cell need to be added as last cell.
282 rowModel.addCell(new CellModel(Bytes.toBytes(column),
283 Bytes.toBytes(valueToCheck)));
285 CellSetModel cellSetModel = new CellSetModel();
286 cellSetModel.addRow(rowModel);
287 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
288 cellSetModel.createProtobufOutput());
289 Thread.yield();
290 return response;
293 protected static Response checkAndPutValuePB(String table, String row,
294 String column, String valueToCheck, String valueToPut) throws IOException {
295 return checkAndPutValuePB(table,row,column,valueToCheck,valueToPut,null);
298 protected static Response checkAndPutValuePB(String table, String row, String column,
299 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
300 throws IOException {
301 StringBuilder path = new StringBuilder();
302 path.append('/');
303 path.append(table);
304 path.append('/');
305 path.append(row);
306 path.append("?check=put");
307 return checkAndPutValuePB(path.toString(), table, row, column,
308 valueToCheck, valueToPut, otherCells);
311 protected static Response checkAndPutValueXML(String url, String table, String row, String column,
312 String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
313 throws IOException, JAXBException {
314 RowModel rowModel = new RowModel(row);
315 rowModel.addCell(new CellModel(Bytes.toBytes(column),
316 Bytes.toBytes(valueToPut)));
318 if (otherCells != null) {
319 for (Map.Entry<String,String> entry : otherCells.entrySet()) {
320 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
321 Bytes.toBytes(entry.getValue())));
325 // This Cell need to be added as last cell.
326 rowModel.addCell(new CellModel(Bytes.toBytes(column),
327 Bytes.toBytes(valueToCheck)));
328 CellSetModel cellSetModel = new CellSetModel();
329 cellSetModel.addRow(rowModel);
330 StringWriter writer = new StringWriter();
331 xmlMarshaller.marshal(cellSetModel, writer);
332 Response response = client.put(url, Constants.MIMETYPE_XML,
333 Bytes.toBytes(writer.toString()));
334 Thread.yield();
335 return response;
338 protected static Response checkAndPutValueXML(String table, String row, String column,
339 String valueToCheck, String valueToPut) throws IOException, JAXBException {
340 return checkAndPutValueXML(table,row,column,valueToCheck,valueToPut, null);
343 protected static Response checkAndPutValueXML(String table, String row,
344 String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
345 throws IOException, JAXBException {
346 StringBuilder path = new StringBuilder();
347 path.append('/');
348 path.append(table);
349 path.append('/');
350 path.append(row);
351 path.append("?check=put");
352 return checkAndPutValueXML(path.toString(), table, row, column,
353 valueToCheck, valueToPut, otherCells);
356 protected static Response checkAndDeleteXML(String url, String table,
357 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
358 throws IOException, JAXBException {
359 RowModel rowModel = new RowModel(row);
361 if (cellsToDelete != null) {
362 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
363 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
364 Bytes.toBytes(entry.getValue())));
367 // Add this at the end
368 rowModel.addCell(new CellModel(Bytes.toBytes(column),
369 Bytes.toBytes(valueToCheck)));
370 CellSetModel cellSetModel = new CellSetModel();
371 cellSetModel.addRow(rowModel);
372 StringWriter writer = new StringWriter();
373 xmlMarshaller.marshal(cellSetModel, writer);
374 Response response = client.put(url, Constants.MIMETYPE_XML,
375 Bytes.toBytes(writer.toString()));
376 Thread.yield();
377 return response;
380 protected static Response checkAndDeleteXML(String table, String row,
381 String column, String valueToCheck) throws IOException, JAXBException {
382 return checkAndDeleteXML(table, row, column, valueToCheck, null);
385 protected static Response checkAndDeleteXML(String table, String row,
386 String column, String valueToCheck, HashMap<String,String> cellsToDelete)
387 throws IOException, JAXBException {
388 StringBuilder path = new StringBuilder();
389 path.append('/');
390 path.append(table);
391 path.append('/');
392 path.append(row);
393 path.append("?check=delete");
394 return checkAndDeleteXML(path.toString(), table, row, column, valueToCheck, cellsToDelete);
397 protected static Response checkAndDeleteJson(String table, String row,
398 String column, String valueToCheck) throws IOException {
399 return checkAndDeleteJson(table, row, column, valueToCheck, null);
402 protected static Response checkAndDeleteJson(String table, String row,
403 String column, String valueToCheck, HashMap<String,String> cellsToDelete)
404 throws IOException {
405 StringBuilder path = new StringBuilder();
406 path.append('/');
407 path.append(table);
408 path.append('/');
409 path.append(row);
410 path.append("?check=delete");
411 return checkAndDeleteJson(path.toString(), table, row, column, valueToCheck, cellsToDelete);
414 protected static Response checkAndDeleteJson(String url, String table,
415 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
416 throws IOException {
417 RowModel rowModel = new RowModel(row);
419 if (cellsToDelete != null) {
420 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
421 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
422 Bytes.toBytes(entry.getValue())));
425 // Add this at the end
426 rowModel.addCell(new CellModel(Bytes.toBytes(column),
427 Bytes.toBytes(valueToCheck)));
428 CellSetModel cellSetModel = new CellSetModel();
429 cellSetModel.addRow(rowModel);
430 String jsonString = jsonMapper.writeValueAsString(cellSetModel);
431 Response response = client.put(url, Constants.MIMETYPE_JSON,
432 Bytes.toBytes(jsonString));
433 Thread.yield();
434 return response;
437 protected static Response checkAndDeletePB(String table, String row, String column, String value)
438 throws IOException {
439 return checkAndDeletePB(table, row, column, value, null);
442 protected static Response checkAndDeletePB(String table, String row,
443 String column, String value, HashMap<String,String> cellsToDelete) throws IOException {
444 StringBuilder path = new StringBuilder();
445 path.append('/');
446 path.append(table);
447 path.append('/');
448 path.append(row);
449 path.append("?check=delete");
450 return checkAndDeleteValuePB(path.toString(), table, row, column, value, cellsToDelete);
452 protected static Response checkAndDeleteValuePB(String url, String table,
453 String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
454 throws IOException {
455 RowModel rowModel = new RowModel(row);
457 if (cellsToDelete != null) {
458 for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
459 rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
460 Bytes.toBytes(entry.getValue())));
463 // Add this at the end
464 rowModel.addCell(new CellModel(Bytes.toBytes(column), Bytes
465 .toBytes(valueToCheck)));
466 CellSetModel cellSetModel = new CellSetModel();
467 cellSetModel.addRow(rowModel);
468 Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
469 cellSetModel.createProtobufOutput());
470 Thread.yield();
471 return response;
474 protected static Response getValueXML(String table, String startRow,
475 String endRow, String column) throws IOException {
476 StringBuilder path = new StringBuilder();
477 path.append('/');
478 path.append(table);
479 path.append('/');
480 path.append(startRow);
481 path.append(",");
482 path.append(endRow);
483 path.append('/');
484 path.append(column);
485 return getValueXML(path.toString());
488 protected static Response getValueXML(String url) throws IOException {
489 Response response = client.get(url, Constants.MIMETYPE_XML);
490 return response;
493 protected static Response getValueJson(String url) throws IOException {
494 Response response = client.get(url, Constants.MIMETYPE_JSON);
495 return response;
498 protected static Response deleteValue(String table, String row, String column)
499 throws IOException {
500 StringBuilder path = new StringBuilder();
501 path.append('/');
502 path.append(table);
503 path.append('/');
504 path.append(row);
505 path.append('/');
506 path.append(column);
507 Response response = client.delete(path.toString());
508 Thread.yield();
509 return response;
512 protected static Response getValueXML(String table, String row, String column)
513 throws IOException {
514 StringBuilder path = new StringBuilder();
515 path.append('/');
516 path.append(table);
517 path.append('/');
518 path.append(row);
519 path.append('/');
520 path.append(column);
521 return getValueXML(path.toString());
524 protected static Response deleteRow(String table, String row)
525 throws IOException {
526 StringBuilder path = new StringBuilder();
527 path.append('/');
528 path.append(table);
529 path.append('/');
530 path.append(row);
531 Response response = client.delete(path.toString());
532 Thread.yield();
533 return response;
536 protected static Response getValueJson(String table, String row,
537 String column) throws IOException {
538 StringBuilder path = new StringBuilder();
539 path.append('/');
540 path.append(table);
541 path.append('/');
542 path.append(row);
543 path.append('/');
544 path.append(column);
545 return getValueJson(path.toString());
548 protected static void checkValueJSON(String table, String row, String column,
549 String value) throws IOException {
550 Response response = getValueJson(table, row, column);
551 assertEquals(200, response.getCode());
552 assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
553 ObjectMapper mapper = new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class,
554 MediaType.APPLICATION_JSON_TYPE);
555 CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
556 RowModel rowModel = cellSet.getRows().get(0);
557 CellModel cell = rowModel.getCells().get(0);
558 assertEquals(Bytes.toString(cell.getColumn()), column);
559 assertEquals(Bytes.toString(cell.getValue()), value);
562 protected static void checkIncrementValueJSON(String table, String row, String column,
563 long value) throws IOException {
564 Response response = getValueJson(table, row, column);
565 assertEquals(200, response.getCode());
566 assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
567 ObjectMapper mapper = new JacksonJaxbJsonProvider()
568 .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
569 CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
570 RowModel rowModel = cellSet.getRows().get(0);
571 CellModel cell = rowModel.getCells().get(0);
572 assertEquals(Bytes.toString(cell.getColumn()), column);
573 assertEquals(Bytes.toLong(cell.getValue()), value);
576 protected static Response putValueJson(String table, String row, String column,
577 String value) throws IOException {
578 StringBuilder path = new StringBuilder();
579 path.append('/');
580 path.append(table);
581 path.append('/');
582 path.append(row);
583 path.append('/');
584 path.append(column);
585 return putValueJson(path.toString(), table, row, column, value);
588 protected static Response putValueJson(String url, String table, String row, String column,
589 String value) throws IOException {
590 RowModel rowModel = new RowModel(row);
591 rowModel.addCell(new CellModel(Bytes.toBytes(column),
592 Bytes.toBytes(value)));
593 CellSetModel cellSetModel = new CellSetModel();
594 cellSetModel.addRow(rowModel);
595 String jsonString = jsonMapper.writeValueAsString(cellSetModel);
596 Response response = client.put(url, Constants.MIMETYPE_JSON,
597 Bytes.toBytes(jsonString));
598 Thread.yield();
599 return response;
602 protected static Response appendValueXML(String table, String row, String column,
603 String value) throws IOException, JAXBException {
604 StringBuilder path = new StringBuilder();
605 path.append('/');
606 path.append(table);
607 path.append('/');
608 path.append(row);
609 path.append("?check=append");
610 return putValueXML(path.toString(), table, row, column, value);
613 protected static Response appendValuePB(String table, String row, String column,
614 String value) throws IOException {
615 StringBuilder path = new StringBuilder();
616 path.append('/');
617 path.append(table);
618 path.append('/');
619 path.append(row);
620 path.append("?check=append");
621 return putValuePB(path.toString(), table, row, column, value);
624 protected static Response appendValueJson(String table, String row, String column,
625 String value) throws IOException, JAXBException {
626 StringBuilder path = new StringBuilder();
627 path.append('/');
628 path.append(table);
629 path.append('/');
630 path.append(row);
631 path.append("?check=append");
632 return putValueJson(path.toString(), table, row, column, value);
635 protected static Response incrementValueXML(String table, String row, String column,
636 String value) throws IOException, JAXBException {
637 StringBuilder path = new StringBuilder();
638 path.append('/');
639 path.append(table);
640 path.append('/');
641 path.append(row);
642 path.append("?check=increment");
643 return putValueXML(path.toString(), table, row, column, value);
646 protected static Response incrementValuePB(String table, String row, String column,
647 String value) throws IOException {
648 StringBuilder path = new StringBuilder();
649 path.append('/');
650 path.append(table);
651 path.append('/');
652 path.append(row);
653 path.append("?check=increment");
654 return putValuePB(path.toString(), table, row, column, value);
657 protected static Response incrementValueJson(String table, String row, String column,
658 String value) throws IOException, JAXBException {
659 StringBuilder path = new StringBuilder();
660 path.append('/');
661 path.append(table);
662 path.append('/');
663 path.append(row);
664 path.append("?check=increment");
665 return putValueJson(path.toString(), table, row, column, value);