.setOverallRequestErrorMessage("When deploying a patch, no other packages may be deployed at the same time.");
return response;
}
try {
DeployIndividualPackageResponse response = getWorkflowManager().run(pkg);
if (response.getResult() == ContentResponseResult.FAILURE) {
overallResult = ContentResponseResult.FAILURE;
}
// just in case response is null, it would throw NPE on the getResult() check above but the item
// would already be a member in individualResponses; moving the add below the check ensures that
// only non-null instances of individualResponses will ever make it into the List
individualResponses.add(response);
} catch (Throwable throwable) {
log.error("Error deploying package: " + pkg, throwable);
// Don't forget to provide an individual response for the failed package.
DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(pkg.getKey(),
ContentResponseResult.FAILURE);
response.setErrorMessageFromThrowable(throwable);
individualResponses.add(response);
overallResult = ContentResponseResult.FAILURE;
}
} else if (packageTypeName.equals(PACKAGE_TYPE_LIBRARY)) {
if (packages.size() > 1) {
log.warn("Attempt to install more than one patch at a time, installation aborted.");
DeployPackagesResponse response = new DeployPackagesResponse(ContentResponseResult.FAILURE);
response
.setOverallRequestErrorMessage("When deploying a patch, no other packages may be deployed at the same time.");
return response;
} else {
deployJarLibrary(pkg, contentServices);
}
}
}
DeployPackagesResponse response = new DeployPackagesResponse(overallResult);
response.getPackageResponses().addAll(individualResponses);
return response;
}