this.service = service;
}
public boolean execute(DumpDomainContext context) throws Exception {
SelectRequest selectRequest = new SelectRequest(String.format("SELECT * FROM %s", context.getDomain()));
SelectResult selectResult = service.select(selectRequest);
ArrayNode rootNode = mapper.createArrayNode();
while (!selectResult.getItems().isEmpty()) {
for (Item item : selectResult.getItems())
appendResult(rootNode, item);
if (isBlank(selectResult.getNextToken()))
break;
selectResult = service.select(selectRequest.withNextToken(selectResult.getNextToken()));
}
FileWriter writer = new FileWriter(context.getOutputFile());
writeData(rootNode, writer);