private void calculateEffectivePolicy() { Policy result; if (getParent() != null) { Policy parentPolicy = getParent().getEffectivePolicy(); if (parentPolicy == null) { result = getPolicy(); } else { if (getPolicy() != null) { result = (Policy) parentPolicy.merge(getPolicy()); } else { result = parentPolicy; } } } else { result = getPolicy(); } setEffectivePolicy(result); }
private void calculateEffectivePolicy() { Policy result; if (getParent() != null) { Policy parentPolicy = getParent().getEffectivePolicy(); if (parentPolicy == null) { result = getPolicy(); } else { if (getPolicy() != null) { result = (Policy) parentPolicy.merge(getPolicy()); } else { result = parentPolicy; } } } else { result = getPolicy(); } setEffectivePolicy(result); }
public OMElement getPolicy(String serviceGroupId, String serviceGroupVersion) throws AxisFault { AxisServiceGroup axisServiceGroup = getAxisConfig().getServiceGroup(serviceGroupId); if (axisServiceGroup == null) { throw new AxisFault("Invalid AxisServiceGroup: " + serviceGroupId); } PolicyInclude groupPolicyInclude = axisServiceGroup.getPolicyInclude(); Policy groupPolicy = groupPolicyInclude.getPolicy(); if (groupPolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(groupPolicy); }
public OMElement getPolicy(String serviceId, String serviceVersion) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("invalid service name"); } PolicyInclude servicePolicyInclude = axisService.getPolicyInclude(); Policy servicePolicy = servicePolicyInclude.getPolicy(); if (servicePolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(servicePolicy); }
public OMElement getPolicy(String serviceId, String operationId) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("Invalid service : " + serviceId); } AxisOperation axisOperation = axisService.getOperation(new QName( operationId)); if (axisOperation == null) { throw new AxisFault("Invalid operation : " + operationId + " not available in service : " + serviceId); } PolicyInclude operationPolicyInclude = axisOperation.getPolicyInclude(); Policy operationPolicy = operationPolicyInclude.getPolicy(); if (operationPolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(operationPolicy); }
public boolean removePolicy(String serviceId, String version, String policyId) throws AxisFault { boolean isPolicyRemoved = false; AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("Invalid service name " + serviceId); } PolicyInclude policyInclude = axisService.getPolicyInclude(); if (policyInclude.getPolicy(policyId) != null) { policyInclude.removePolicyElement(policyId); isPolicyRemoved = true; } ServiceDO serviceDO = pm.getService(serviceId, version); List policiesToBeRemoved = new ArrayList(); for (Iterator policyIter = serviceDO.getPolicies().iterator(); policyIter.hasNext();) { ServicePolicyDO servicePolicyDO = (ServicePolicyDO) policyIter.next(); if (servicePolicyDO.getUuid().equals(policyId)) { policiesToBeRemoved.add(servicePolicyDO); } } Set policies = serviceDO.getPolicies(); for (Iterator iterator = policiesToBeRemoved.iterator(); iterator.hasNext();) { policies.remove(iterator.next()); isPolicyRemoved = true; } pm.updateEntity(serviceDO); return isPolicyRemoved; }
public OMElement getPolicy() throws AxisFault { PolicyInclude globalPolicyInclude = getAxisConfig().getPolicyInclude(); Policy globalPolicy = globalPolicyInclude.getPolicy(); if (globalPolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(globalPolicy); }
/** * @param moduleId * @param moduleVersion * @return OMElement * @throws AxisFault */ public OMElement getPolicy(String moduleId, String moduleVersion) throws AxisFault { AxisModule module = getAxisModule(moduleId, moduleVersion); PolicyInclude modulePolicyInclude = module.getPolicyInclude(); Policy modulePolicy = modulePolicyInclude.getPolicy(); if (modulePolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(modulePolicy); }
servicePolicyDO.setPolicy(policyElement.toString()); if (policyInclude.getPolicy(idAttrVal) != null) { policyInclude.updatePolicy(servicePolicy);