JsonNode data = elem.get("data");
String imageId = data.get("imageId").getTextValue();
String launchConfigurationName = data.get("launchConfigurationName").getTextValue();
JsonNode ltimeNode = elem.get("ltime");
if (ltimeNode != null && !ltimeNode.isNull()) {
long ltime = ltimeNode.asLong();
Resource ami = idToResource.get(imageId);
String lastRefTimeByLC = ami.getAdditionalField(AMI_FIELD_LAST_LC_REF_TIME);
if (lastRefTimeByLC == null || Long.parseLong(lastRefTimeByLC) < ltime) {
LOGGER.info(String.format(
"The last time that the image %s was referenced by launch config %s is %d",