// get the current replications in the replication db
Map replicationIDs = getReplicationIDs(instance);
boolean replicationComplete = false;
while(!replicationComplete) {
// need to check the active tasks
HttpResponse response = instance.getConnection().get("/_active_tasks");
ObjectMapper mapper = new ObjectMapper();
try {
JsonNode results = mapper.readTree(response.getContent());
replicationComplete = true;
for (JsonNode element : results) {
if ("Replication".equals(element.get("type").getTextValue())) {
String task = element.get("task").getTextValue();
String repID = task.substring(0, 4);