use of org.jumpmind.symmetric.io.data.writer.ProtocolDataWriter in project symmetric-ds by JumpMind.
the class DataExtractorService method extractOnlyOutgoingBatch.
/**
* This method will extract an outgoing batch, but will not update the outgoing batch status
*/
public boolean extractOnlyOutgoingBatch(String nodeId, long batchId, Writer writer) {
boolean extracted = false;
Node targetNode = null;
if (Constants.UNROUTED_NODE_ID.equals(nodeId)) {
targetNode = new Node(nodeId, parameterService.getNodeGroupId());
} else {
targetNode = nodeService.findNode(nodeId);
}
if (targetNode != null) {
OutgoingBatch batch = outgoingBatchService.findOutgoingBatch(batchId, nodeId);
if (batch != null) {
IDataWriter dataWriter = new ProtocolDataWriter(nodeService.findIdentityNodeId(), writer, targetNode.requires13Compatiblity());
List<OutgoingBatch> batches = new ArrayList<OutgoingBatch>(1);
batches.add(batch);
batches = extract(new ProcessInfo(), targetNode, batches, dataWriter, null, ExtractMode.EXTRACT_ONLY);
extracted = batches.size() > 0;
}
}
return extracted;
}
Aggregations