}
} else if (dataset.isEmpty()) {
// so the agent doesn't have a cached value of the trait an the resource seems to be either down
// or unable to collect the trait.
// Let's try asking the server for the last known value
MeasurementDataTrait value = configuration.getServerServices().getMeasurementServerService()
.getLastKnownTraitValue(traitScheduleId);
if (value != null) {
traitValue = value.getValue();
}
} else {
throw new IllegalStateException(
"Asked for value of trait " + traitName + " on resource " + container.getResource() +
" but got more than one value back. This is unexpected.");