in src/inventory/src/main/java/com/google/abmedge/inventory/InventoryController.java [316:329]
private void insertIfNotExists(Item i, Map<String, Set<String>> itemTypeToNameMap) {
if (itemTypeToNameMap.containsKey(i.getType())
&& itemTypeToNameMap.get(i.getType()).contains(i.getName())) {
LOGGER.warn(
"Item ['type': {}, 'name': {}] already exists. Skipping..", i.getType(), i.getName());
return;
}
try {
activeConnector.insert(i);
} catch (InventoryStoreConnectorException e) {
LOGGER.error("Failed to insert item '{}' of type '{}'", i.getName(), i.getType(), e);
}
LOGGER.info(String.format("Inserting new item: %s", i));
}