You can use the UDDI registry administrative interface to manage policies that affect the UDDI API.
In the samples for WebSphere® Application Server, the ManagePoliciesSample class in the UDDI registry samples demonstrates these operations.
List policyGroups = uddiNode.getPolicyGroups();
if (policyGroups != null) { for (Iterator iter = policyGroups.iterator(); iter.hasNext();) { PolicyGroup policyGroup = (PolicyGroup) iter.next(); System.out.println(policyGroup); } }
Each policy group has an ID, name, and description key, which you can look up in the messages.properties resource in the sample package. Although the PolicyGroup class does have a getPolicies method, PolicyGroup objects that are returned by the getPolicyGroups operation do not contain any Policy objects. Because of this behavior, clients can determine the known policy groups, and their IDs, without retrieving the entire set of policies in one request. To retrieve the policies in a policy group, use the getPolicyGroup operation.
String groupId = Integer.toString(PolicyConstants.REG_APIS_GROUP);
PolicyGroup policyGroup = uddiNode.getPolicyGroup(groupId);
String policyId = Integer.toString( PolicyConstants.REG_AUTHORIZATION_FOR_INQUIRY_API);
Policy policy = uddiNode.getPolicy(policyId);
Policy updatedPolicy = new Policy(); String policyId = Integer.toString(PolicyConstants.REG_SUPPORTS_UUID_KEYS); updatedPolicy.setId(policyId);
updatedPolicy.setBooleanValue(true);
uddiNode.updatePolicy(updatedPolicy);
List updatedPolicies = new ArrayList(); updatedPolicies.add(updatedPolicy1); updatedPolicies.add(updatedPolicy2);
uddiNode.updatePolicies(updatedPolicies);