if (storageNode == null) { // no storage node with the specified id
throw new IllegalStateException("There is no storage node with id [" + storageNodeId
+ "] stored in the database.");
}
if (storageNode.getResource() == null) { // no associated resource
throw new ResourceNotFoundException("This storage node [" + storageNode.getId()
+ "] has no associated resource.");
}
}
resourceId = storageNode.getResource().getId();
return resourceId;