public static void syncNodes(DbConn cnx, List<NodeDto> dtos) { for (NodeDto existing : getNodes(cnx)) { boolean foundInNewSet = false; for (NodeDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteQueue(cnx, existing.getId()); } } for (NodeDto dto : dtos) { upsertNode(cnx, dto); } }
public static void syncQueues(DbConn cnx, List<QueueDto> dtos) { for (QueueDto existing : getQueues(cnx)) { boolean foundInNewSet = false; for (QueueDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteQueue(cnx, existing.getId()); } } for (QueueDto dto : dtos) { upsertQueue(cnx, dto); } }
public static void syncNodes(DbConn cnx, List<NodeDto> dtos) { for (NodeDto existing : getNodes(cnx)) { boolean foundInNewSet = false; for (NodeDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteQueue(cnx, existing.getId()); } } for (NodeDto dto : dtos) { upsertNode(cnx, dto); } }
public static void syncQueues(DbConn cnx, List<QueueDto> dtos) { for (QueueDto existing : getQueues(cnx)) { boolean foundInNewSet = false; for (QueueDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteQueue(cnx, existing.getId()); } } for (QueueDto dto : dtos) { upsertQueue(cnx, dto); } }