" to update policies");
}
return;
}
ProxyService proxyService = config.getProxyService(axisService.getName());
try {
Registry registry = this.configSystemRegistry;
String servicePath = RegistryResources.ROOT + "axis2" +
RegistryConstants.PATH_SEPARATOR + "service-groups" +
RegistryConstants.PATH_SEPARATOR +
axisService.getAxisServiceGroup().getServiceGroupName() +
RegistryConstants.PATH_SEPARATOR + "services" +
RegistryConstants.PATH_SEPARATOR + axisService.getName();
String servicePoliciesPath = servicePath
+ RegistryConstants.PATH_SEPARATOR + "policies";
List<PolicyInfo> remainingPolicies = new ArrayList<PolicyInfo>();
for (PolicyInfo info : proxyService.getPolicies()) {
if (!info.getPolicyKey().startsWith("conf:" + servicePoliciesPath)) {
remainingPolicies.add(info);
}
}
proxyService.setPolicies(remainingPolicies);
if (registry.resourceExists(servicePoliciesPath)) {
// there are service level policies
Resource servicePoliciesResource = registry.get(servicePoliciesPath);
if (servicePoliciesResource instanceof Collection) {
Collection servicePoliciesCollection = (Collection) servicePoliciesResource;
for (String servicePolicyResourcePath :
servicePoliciesCollection.getChildren()) {
PolicyInfo pi = handlePolicy(config,
proxyService, servicePolicyResourcePath, (UserRegistry) registry);
if (pi != null) {
pi.setPolicyKey("conf:" + pi.getPolicyKey());
proxyService.addPolicyInfo(pi);
}
}
}
}
// Update exposed transports
if (axisService.getExposedTransports() != null &&
!axisService.getExposedTransports().isEmpty()) {
proxyService.setTransports(
new ArrayList<String>(axisService.getExposedTransports()));
} else {
proxyService.setTransports(new ArrayList());
}
persistChanges(axisService.getName(), axisService.getAxisConfiguration());
} catch (RegistryException e) {
log.error("Error checking the policies from the registry", e);