public ServiceResponse<KieScannerResource> updateScanner(String id, KieScannerResource resource) {
if (resource == null || resource.getStatus() == null) {
logger.error("Error updating scanner for container " + id + ". Status is null: " + resource);
return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.FAILURE, "Error updating scanner for container " + id + ". Status is null: " + resource);
}
KieScannerStatus status = resource.getStatus();
try {
KieContainerInstance kci = (KieContainerInstance) context.getContainer(id);
if (kci != null && kci.getKieContainer() != null) {
switch (status) {
case CREATED: