* @param resource This can be a detached object
* @throws InvalidInventoryReportException
*/
private void validateResource(Resource resource) throws InvalidInventoryReportException {
if (resource.getResourceType() == null) {
throw new InvalidInventoryReportException("Reported resource [" + resource + "] has a null type.");
}
if (resource.getResourceKey() == null) {
throw new InvalidInventoryReportException("Reported resource [" + resource + "] has a null key.");
}
if (resource.getInventoryStatus() == InventoryStatus.DELETED) {
throw new InvalidInventoryReportException(
"Reported resource ["
+ resource
+ "] has an illegal inventory status of 'DELETED' - agents are not allowed to delete platforms from inventory.");
}