public static SecurityConfiguration findSecurityConfiguration(
final Domain domain,
final String serviceName,
final ActionReport report) {
// Lookup the security configurations
SecurityConfigurations secConfigs = domain.getExtensionByType(SecurityConfigurations.class);
if (secConfigs == null) {
report.setMessage("Unable to locate security configurations");
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return null;
}
// Get the security service
SecurityConfiguration ssc = secConfigs.getSecurityServiceByName(serviceName);
if (ssc == null) {
report.setMessage("Unable to locate security service: " + serviceName);
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return null;
}