UDDI registry Administrative (JMX) Interface
Use the UDDI registry Administrative Interface to inspect and manage the runtime configuration of a UDDI application. We can manage the information and the activation state about a UDDI node, update properties and policies, set publish tier limits, register UDDI publishers, and control value set support.
The operations of the UDDI registry Administrative Interface can be read and invoked using standard JMX (Java Management Extensions) interfaces. The use of JMX is explained in Use admin programs (JMX).
Each WAS UDDI registry application registers an MBean with an MBean identifier of UddiNode. Client applications can use this MBean to inspect and manage the runtime configuration of a UDDI application. This includes managing the activation state of and information about a UDDI node, updating properties and policies, setting publish tier limits, registration of UDDI publishers, and controlling value set support.
We can read and invoke the UddiNode attributes and operations using standard JMX interfaces. A client utility class UddiNodeProxy.java provides a ready-made application to connect to a UddiNode MBean and perform all the available operations. Example classes are also provided to drive UddiNodeProxy and demonstrate how to use the various UDDI management data types.
When WAS security is enabled, we can only invoke the operations of the UddiNode MBean if we are a user in an admin role. The operations that make updates require the Administrator or Operator role, while get operations can be performed by Administrator, Operator, Configurator and Monitor roles.
UddiNodeProxy Usage
The following .jar files are required for compilation:
The UddiNodeProxy class provides a utility method to programmatically interrogate the UddiNode MBean and output all the available attributes, operations and notifications to System.out. For each operation, the return type, operation name and parameter types are output, as well as the impact property that indicates how the operation changes the state of the UddiNode MBean (and the UDDI node). As for all MBeans, the value for the impact property can be one of:
- ACTION:
- state of MBean will be changed
- INFO:
- of the MBean remains unchanged and will return information
- ACTION_INFO:
- state of the MBean will change and return some information
- UNKNOWN:
- the impact of invoking the operation is not known
- Invoke outputMBeanInterface:uddiNode.outputMBeanInterface();Expected output:
java.lang.String getNodeID() [INFO] (getter for attribute nodeID) java.lang.String getNodeState() [INFO] (getter for attribute nodeState) java.lang.String getNodeDescription() [INFO] (getter for attribute nodeDescription) java.lang.String getNodeApplicationName() [INFO] (getter for attribute nodeApplicationName) void activateNode() [ACTION] (activates UDDI node) void deactivateNode() [ACTION] (deactivates UDDI node) void initNode() [ACTION] (initializes Uddi node) com.ibm.uddi.v3.management.Property getProperty(java.lang.String propertyId) [INFO] (returns UDDI Property) com.ibm.uddi.v3.management.PolicyGroup getPolicyGroup(java.lang.String policyGroupId) [INFO] (returns UDDI PolicyGroup) com.ibm.uddi.v3.management.Policy getPolicy(java.lang.String policyId) [INFO] (returns UDDI Policy) void updatePolicy(com.ibm.uddi.v3.management.Policy policy) [ACTION] (updates UDDI Policy) void updateProperty(com.ibm.uddi.v3.management.ConfigurationProperty property) [ACTION] (updates UDDI Property) void updateProperties(java.util.List properties) [ACTION] (updates collection of UDDI properties) void updatePolicies(java.util.List policies) [ACTION] (updates collection of UDDI policies) java.util.List getProperties() [INFO] (returns the collection of UDDI properties) java.util.List getPolicyGroups() [INFO] (returns collection of policy groups (note that the policies are not populated)) java.util.List getValueSets() [INFO] (returns collection of value set status objects) com.ibm.uddi.v3.management.ValueSetStatus getValueSetDetail(java.lang.String tModelKey) [INFO] (returns status for a value set) com.ibm.uddi.v3.management.ValueSetProperty getValueSetProperty(java.lang.String tModelKey,java.lang. String valueSetPropertyId) [INFO] (returns a property of a value set) void updateValueSet(com.ibm.uddi.v3.management.ValueSetStatus valueSet) [ACTION] (updates value set status) void updateValueSets(java.util.List valueSets) [ACTION] (updates multiple value sets) void loadValueSet(java.lang.String filePath,java.lang.String tModelKey) [ACTION] (loads values for a value set from a UDDI registry V3/V2 taxonomy data file.) void loadValueSet(com.ibm.uddi.v3.management.ValueSetData valueSetData) [ACTION] (loads values for a value set with the given tModel key.) void changeValueSetTModelKey(java.lang.String oldTModelKey,java.lang.String newTModelKey) [ACTION] (replaces all occurrences of values belonging to original tModelKey to new tModelKey.) void unloadValueSet(java.lang.String tModelKey) [ACTION] (unloads values for a value set with the given tModel key.) java.lang.Boolean isExistingValueSet(java.lang.String tModelKey) [INFO] (Determine if Value Set data exists for the given tModel key.) java.util.List getTierInfos() [INFO] (returns the collection of UDDI tier descriptions.) java.util.List getLimitInfos() [INFO] (returns the collection of UDDI limit descriptions.) java.util.List getEntitlementInfos() [INFO] (returns the collection of UDDI entitlements.) com.ibm.uddi.v3.management.Tier getTierDetail(java.lang.String tierId) [INFO] (returns UDDI Tier detail, specifying limits to the number of entities that can be published.) com.ibm.uddi.v3.management.Tier createTier(com.ibm.uddi.v3.management.Tier tier) [ACTION] (creates a UDDI Tier, specifying limits to the number of entities that can be published. Returns the new tier ID.) com.ibm.uddi.v3.management.Tier updateTier(com.ibm.uddi.v3.management.Tier tier) [ACTION] (updates UDDI Tier details. Returns the updated Tier.) void deleteTier(java.lang.String tierId) [ACTION] (deletes the UDDI Tier, if it not in use.) void setDefaultTier(java.lang.String tierId) [ACTION] (Tier that auto registered UDDI publishers are assigned to.) java.lang.Integer getUserCount(java.lang.String tierId) [INFO] (returns the number of UDDI publisher within the specified tier.) com.ibm.uddi.v3.management.TierInfo getUserTier(java.lang.String userId) [INFO] (returns UDDI Tier information, specifying the tier this user belongs to.) com.ibm.uddi.v3.management.UddiUser getUddiUser(java.lang.String userId) [INFO] (returns UDDI user details, including tier and entitlements details.) java.util.List getUserInfos() [INFO] (returns the collection of UDDI user names and the tier they belong to.) void createUddiUser(com.ibm.uddi.v3.management.UddiUser user) [ACTION] (creates a new UDDI user.) void createUddiUsers(java.util.List users) [ACTION] (creates the collection of new UDDI users.) void updateUddiUser(com.ibm.uddi.v3.management.UddiUser user) [ACTION] (updates UDDI user details.) void deleteUddiUser(java.lang.String userId) [ACTION] (deletes UDDI publisher.) void assignTier(java.util.List userIds,java.lang.String tierId) [ACTION] (sets the tier for a List of users.) notificationInfo: description=default UDDI event,descriptorType=notification,severity=(6),name= uddi.node.event notificationInfo: description=null,descriptorType=notification,severity=(6),name=jmx.attribute. changedSee ManageNodeInfoSample class for sample code that demonstrates the attributes and operations described in this section.
Manage UDDI node states and attributes
UDDI nodes can be in one of several states, depending on the way the UDDI application was installed (as a default configuration or one where the administrator controls when initialization occurs). The UddiNode MBean provides four read only attributes: nodeID, nodeState, nodeDescription and nodeApplicationName. In addition the following MBean operations change UDDI node state: activateNode, deactivateNode and initNode.
nodeID The node ID is the unique identifier for a UDDI node. If the UDDI application is installed as a default configuration the node ID is automatically generated. If the UDDI application is set up manually, the node ID is set by the administrator. It must be a valid UDDI key.
String nodeID = uddiNode.getNode(); System.out.println("node ID: " + nodeId);nodeState The nodeState attribute can have one of the following values:
Table 1. nodeState attribute values
nodeState value English text associated with state node.state.uninitialized Not initialized node.state.initialized Initialized node.state.initPending Initialization pending node.state.initInProgress Initialization in progress node.state.initMigrationPending Migration pending node.state.initMigration Migration in progress node.state.initValueSetCreationPending Value set creation pending node.state.initValueSetCreation Value set creation in progress node.state.activated Activated node.state.deactivated Deactivated node.state.unknown Unknown
After installing a UDDI application using the default configuration, the UDDI node will be in activated state, that is, ready to receive and process UDDI API requests. The node ID and root key generator and some other properties are generated and cannot be changed. For a manually installed UDDI application where you want to specify the UDDI node ID and root key generator values, starting the UDDI application will put the UDDI node into initPending state. In this state, we can update all writable values up until the point you invoke the initNode operation. The initNode operation loads base tModels and value set data and writes all the configuration data to the UDDI node's database. During initialization the state is initInProgress. When initialization completes, the state changes momentarily to initialized and settles at activated. At this point the state can only be switched between activated and deactivated using deactivateNode and activateNode MBean operations. Each node state value is in fact a message key that can be looked up in the messages.properties resource bundle. The attribute value can be retrieved using the getNodeState method of UddiNodeProxy:
- Invoke getNodeState:
String nodeStateKey = uddiNode.getNodeState();- Look up translated text from ResourceBundle and output:
String messages = "com.ibm.uddi.v3.management.messages"; ResourceBundle bundle = ResourceBundle.getBundle(messages, Locale.ENGLISH); String nodeStateText = bundle.getString(nodeStateKey); System.out.println("node state: " + nodeStateText);nodeDescription We can get the administrator assigned description for the UDDI node using the getNodeDescription method of UddiNodeProxy:
- Invoke getNodeDescription and output:
String nodeDescription = uddiNode.getNodeDescription(); System.out.println("node description: " + nodeDescription);nodeApplicationName The nodeApplicationName attribute is useful for discovering where the UDDI application that corresponds to the UDDI node is installed. The value will be a concatenation of the cell, node and server names, separated by colons. Retrieve the application location using the getApplicationId method of UddiNodeProxy:
- Invoke getApplicationId and output:
String nodeApplicationId = uddiNode.getApplicationId(); System.out.println("node application location: " + nodeApplicationId);activateNode Changes the state of the UDDI node to activated, if the UDDI node was previously deactivated.
- . Invoke activateNode:
uddiNode.activateNode();deactivateNode Changes the state of the UDDI node to deactivated, if the UDDI node was previously activated.
- Invoke deactivateNode:
uddiNode.deactivateNode();initNode Causes UDDI node initialization, and when this completes the state of the UDDI node is ‘activated'.
- Invoke initNode:
uddiNode.initNode();
Manage configuration properties
UDDI node runtime behavior is affected by the setting of several configuration properties. The UddiNode MBean provides operations to inspect and update their values, as follows: getProperties, getProperty, updateProperty and updateProperties.
See ManagePropertiesSample class for sample code that demonstrates the operations described in this section.
getProperties Returns collection of all configuration properties as ConfigurationProperty objects.
- Invoke getProperties:
List properties = uddiNode.getProperties();- Cast each collection member to ConfigurationProperty:
if (properties != null) { for (Iterator iter = properties.iterator(); iter.hasNext();) { ConfigurationProperty property = (ConfigurationProperty) iter.next(); System.out.println(property); } }After we have the ConfigurationProperty objects, we can inspect attributes like the ID, value, type, whether the property is read only, required for initialization, and get name and description message keys. For example, invoking the toString method returns results similar to:
ConfigurationProperty id: operatorNodeIDValue nameKey: property.name.operatorNodeIDValue descriptionKey: property.desc.operatorNodeIDValue type: java.lang.String value: uddi:capnscarlet:capnscarlet:server1:default unitsKey: readOnly: true required: true usingMessageKeys: false validValues: noneUse the nameKey and descriptionKey values to look up the translated name and description for a given locale, using the messages.properties resource in the sample package.
getProperty Returns ConfigurationProperty object with the specified ID. Available property IDs are specified in PropertyConstants together with descriptions of the purpose of the corresponding properties.
- Invoke getProperty:
ConfigurationProperty property = uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);- To retrieve the value of the property, we can use the getValue method, which returns an Object, but in this case the property is of type integer, so it is easier to retrieve the value using the convenience method getIntegerValue:
int maxResults = property.getIntegerValue();updateProperty Updates the value of the ConfigurationProperty object with the specified ID. Available property IDs are specified in PropertyConstants together with descriptions of the purpose of the corresponding properties. Although we can invoke the setter methods in a ConfigurationProperty object, the only value that is updated in the UDDI node is the value. So to update a property, the steps are typically:
- Create a ConfigurationProperty object and set its ID:
ConfigurationProperty defaultLanguage = new ConfigurationProperty(); defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);- Set the value:
defaultLanguage.setStringValue("ja");- Invoke updateProperty:
uddiNode.updateProperty(defaultLanguage);updateProperties Updates several ConfigurationProperty objects in a single request. Set up the ConfigurationProperty objects as for the updateProperty operation.
- Add updated properties to a List:
List updatedProperties = new ArrayList(); updatedProperties.add(updatedProperty1); updatedProperties.add(updatedProperty2);- Invoke updateProperties:
uddiNode.updateProperties(updatedProperties);
Manage policies
Policies affecting behavior of the UDDI API are managed using the following UddiNode operations: getPolicyGroups, getPolicyGroup, getPolicy, updatePolicy and updatePolicies.
See ManagePoliciesSample class for sample code that demonstrates the attributes and operations described in this section.
getPolicyGroups Returns collection of all policy groups as PolicyGroup objects.
- Invoke getPolicyGroups:
List policyGroups = uddiNode.getPolicyGroups();- Cast each collection member to PolicyGroup:
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 we 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 within a policy group, use the getPolicyGroup operation.
getPolicyGroup Returns the PolicyGroup object with the supplied ID.
- Convert policy group ID to a String:
String groupId = Integer.toString(PolicyConstants.REG_APIS_GROUP);- Invoke getPolicyGroup:
PolicyGroup policyGroup = uddiNode.getPolicyGroup(groupId);getPolicy Returns the Policy object for the specified ID. Like a ConfigurationProperty, a Policy object has an ID, name and description keys, type, value and indicators specifying if the policy is read only or required for node initialization.
- Convert policy ID to a String:
String policyId = Integer.toString( PolicyConstants.REG_AUTHORIZATION_FOR_INQUIRY_API);- Invoke getPolicy:
Policy policy = uddiNode.getPolicy(policyId);updatePolicy Updates the value of the Policy object with the specified ID. Available policy IDs are specified in PolicyConstants together with descriptions of the purpose of the corresponding policies. Although we can invoke the setter methods in a Policy object, the only value that is updated in the UDDI node is the value. So to update a policy, the steps are typically:
- Create a Policy object and set its ID:
Policy updatedPolicy = new Policy(); String policyId = Integer.toString(PolicyConstants.REG_SUPPORTS_UUID_KEYS); updatedPolicy.setId(policyId);- Set the value:
updatedPolicy.setBooleanValue(true);- Invoke updatePolicy:
uddiNode.updatePolicy(updatedPolicy);updatePolicies Updates several Policy objects in a single request. Set up the Policy objects as for the updatePolicy operation.
- Add updated policies to a List:
List updatedPolicies = new ArrayList(); updatedPolicies.add(updatedPolicy1); updatedPolicies.add(updatedPolicy2);- Invoke updatePolicies:
uddiNode.updatePolicies(updatedPolicies);Manage Tiers
Tiers control how many of each type of UDDI entities a publisher can save in the UDDI registry. A tier has an ID, an administrator defined name and description, and a set of limits, one for each type of entity. Tiers are managed using the following UddiNode operations: createTier, getTierDetail, getTierInfos, getLimitInfos, setDefaultTier, updateTier, deleteTier and getUserCount.
See ManageTiersSample class for sample code that demonstrates the attributes and operations described in this section.
createTier Creates a new tier, with specified publish limits for each UDDI entity.
- Set tier name and description in a TierInfo object.
String tierName = "Tier 100"; String tierDescription = "A tier with all limits set to 100."; TierInfo tierInfo = new TierInfo(null, tierName, tierDescription);- Define Limit objects for each UDDI entity:
List limits = new ArrayList(); Limit businessLimit = new Limit(); businessLimit.setIntegerValue(100); businessLimit.setId(LimitConstants.BUSINESS_LIMIT); Limit serviceLimit = new Limit(); serviceLimit.setIntegerValue(100); serviceLimit.setId(LimitConstants.SERVICE_LIMIT); Limit bindingLimit = new Limit(); bindingLimit.setIntegerValue(100); bindingLimit.setId(LimitConstants.BINDING_LIMIT); Limit tModelLimit = new Limit(); tModelLimit.setIntegerValue(100); tModelLimit.setId(LimitConstants.TMODEL_LIMIT); Limit assertionLimit = new Limit(); assertionLimit.setIntegerValue(100); assertionLimit.setId(LimitConstants.ASSERTION_LIMIT); limits.add(businessLimit); limits.add(serviceLimit); limits.add(bindingLimit); limits.add(tModelLimit); limits.add(assertionLimit);- Create Tier object:
Tier tier = new Tier(tierInfo, limits);- Invoke create Tier and retrieve created tier:
Tier createdTier = uddiNode.createTier(tier);- Inspect generated tier ID of created tier:
tierId = createdTier.getId(); System.out.println("created tier has ID: " + tierId);getTierDetail Returns the Tier object for the given tier ID. The Tier class has getter methods for the tier ID, tier name and description (as set by the administrator), and the collection of Limit objects, which specify how many of each UDDI entity type might be published by UDDI publishers allocated to the tier. The isDefault method indicates whether the tier is the default tier, that is, the tier that is allocated to UDDI publishers when auto registration is enabled.
- Invoke getTierDetail:
Tier tier = uddiNode.getTierDetail("2");updateTier Updates tier contents with the supplied Tier object.
- Update an existing Tier object (which might have been newly instantiated, or returned by the getTierDetail or createTier operations). This example retains the tier name and description, and all the limit values except the limit being updated:
modifiedTier.setName(tier.getName()); modifiedTier.setDescription(tier.getDescription()); Limit tModelLimit = new Limit(); tModelLimit.setId(LimitConstants.TMODEL_LIMIT); tModelLimit.setIntegerValue(50); List updatedLimits = new ArrayList(); updatedLimits.add(tModelLimit); modifiedTier.setLimits(updatedLimits);- Invoke updateTier:
uddiNode.updateTier(modifiedTier);getTierInfos Returns collection of lightweight tier descriptor objects (TierInfo) that contain the tier ID, and tier name and description values, and whether the tier is the default tier.
- Invoke getTierInfos:
List tierInfos = uddiNode.getTierInfos();- Output content of each TierInfo:
if (tierInfos != null) { for (Iterator iter = tierInfos.iterator(); iter.hasNext();) { TierInfo tierInfo = (TierInfo) iter.next(); System.out.println(tierInfo); } }setDefaultTier Tier with the given tier ID is the default tier. The default tier is the tier that is allocated to UDDI publishers when auto registration is enabled. Typically, you set this to a tier with low publish limits to stop casual users from publishing too many entities.
- Invoke setDefaultTier:
uddiNode.setDefaultTier("4");deleteTier Removes the tier with the given tier ID. Tiers can only be removed if they have no UDDI publishers assigned to them, and the tier is not the default tier.
- Invoke deleteTier:
uddiNode.deleteTier("4");getUserCount Returns the number of UDDI publishers assigned to tier specified by the tier ID.
- Invoke getUserCount:
Integer userCount = uddiNode.getUserCount("4"); System.out.println("users in tier 4: " + userCount.intValue());getLimitInfos Returns collection of Limit objects representing the limit values for each type of UDDI entity. Limits are used in Tier objects.
- Invoke getLimitInfos:
List limits = uddiNode.getLimitInfos();- Output the ID and limit value for each Limit object:
for (Iterator iter = limits.iterator(); iter.hasNext();) { Limit limit = (Limit) iter.next(); System.out.println("limit ID: " + limit.getId() + ", limit value: " + limit.getIntegerValue()); }
Manage UDDI publishers
UDDI publishers are managed using the UddiNode MBean operations createUddiUser, createUddiUsers, updateUddiUser, deleteUddiUser, getUddiUser, getUserInfos, getEntitlementInfos, assignTier, getUserTier. An example is provided for each, making use of the UddiNodeProxy client class.
See ManagePublishersSample class for sample code that demonstrates the attributes and operations described in this section.
createUddiUser
Registers a single UDDI publisher, in a specified tier, with specified entitlements. The UddiUser class represents the UDDI publisher, and this is constructed using a user ID, a TierInfo object that specifies the tier ID to allocate the UDDI publisher to, and a collection of Entitlement objects that specify what the UDDI publisher is permitted to do.
Tip: to allocate the UDDI publisher default entitlements, set the entitlements parameter to null.
- Create the UddiUser object:
UddiUser user = new UddiUser("user1", new TierInfo("3"), null);- Invoke createUddiUser:
uddiNode.createUddiUser(user);createUddiUsers Registers multiple UDDI publishers. This example shows how to register 7 UDDI publishers in one call, with default entitlements.
- Create TierInfo objects for tiers that publishers will be allocated to:
TierInfo tier1 = new TierInfo("1"); TierInfo tier4 = new TierInfo("4");- Create UddiUser objects for each UDDI publisher, specifying tier to allocate to:
UddiUser publisher1 = new UddiUser("Publisher1", tier4, null); UddiUser publisher2 = new UddiUser("Publisher2", tier4, null); UddiUser publisher3 = new UddiUser("Publisher3", tier4, null); UddiUser publisher4 = new UddiUser("Publisher4", tier1, null); UddiUser publisher5 = new UddiUser("Publisher5", tier1, null); UddiUser cts1 = new UddiUser("cts1", tier4, null); UddiUser cts2 = new UddiUser("cts2", tier4, null);- Add the UddiUser objects to a List:
List uddiUsers = new ArrayList(); uddiUsers.add(publisher1); uddiUsers.add(publisher2); uddiUsers.add(publisher3); uddiUsers.add(publisher4); uddiUsers.add(publisher5); uddiUsers.add(cts1); uddiUsers.add(cts2);- Invoke createUddiUsers:
uddiNode.createUddiUsers(uddiUsers);updateUddiUser Updates a UDDI publisher with the details in the supplied UddiUser object. This is typically used to change the tier of one UDDI publisher or update their entitlements.
Tip: only supply the entitlements you want to update - the remainder of available entitlements will retain their existing value.
- Create Entitlement objects with appropriate permission. (the entitlement IDs are found in EntitlementConstants:
Entitlement publishUuiDKeyGenerator = new Entitlement(PUBLISH_UUID_KEY_GENERATOR, true); Entitlement publishWithUuidKey = new Entitlement(PUBLISH_WITH_UUID_KEY, true);- Add Entitlement objects to a List:
List entitlements = new ArrayList(); entitlements.add(publishUuiDKeyGenerator); entitlements.add(publishWithUuidKey);- Update a UddiUser object with the updated entitlements:
user.setEntitlements(entitlements);- Invoke updateUddiUser:
uddiNode.updateUddiUser(user);getUddiUser Retrieves details about a UDDI publisher in the form of a UddiUser object. This specifies the UDDI publisher ID, information about the tier they are assigned to and the entitlements they possess.
- Invoke getUddiUser:
UddiUser user1 = uddiNode.getUddiUser("user1");- Output the contents of UddiUser:
System.out.println("retrieved user: " + user1);getUserInfos Returns a collection of UserInfo objects. Each UserInfo represents a UDDI publisher known to the UDDI node, and the name of the tier they are allocated to. To get details about a specific UDDI publisher, including the tier ID, and entitlements, use the getUddiUser operation.
- Invoke getUserInfos:
List registeredUsers = uddiNode.getUserInfos();- Output the UserInfo objects:
System.out.println("retrieved registered users: "); System.out.println(registeredUsers);getEntitlementInfos Returns a collection of Entitlement objects. Each entitlement is a property that controls whether permission is granted to a UDDI publisher to perform a specified action.
- Invoke getEntitlementInfos:
List entitlementInfos = uddiNode.getEntitlementInfos();- Specify where to find message resources:
String messages = "com.ibm.uddi.v3.management.messages"; ResourceBundle bundle = ResourceBundle.getBundle( messages, Locale.ENGLISH);- Iterate through the Entitlement objects, displaying the ID, name and description:
for (Iterator iter = entitlementInfos.iterator(); iter.hasNext();) { Entitlement entitlement = (Entitlement) iter.next(); StringBuffer entitlementOutput = new StringBuffer(); String entitlementId = entitlement.getId(); String entitlementName = bundle.getString(entitlement.getNameKey()); String entitlementDescription = bundle.getString(entitlement.getDescriptionKey()); entitlementOutput.append("Entitlement id: "); entitlementOutput.append(entitlementId); entitlementOutput.append("\n name: "); entitlementOutput.append(entitlementName); entitlementOutput.append("\n description: "); entitlementOutput.append(entitlementDescription); System.out.println(entitlementOutput.toString()); }deleteUddiUser Removes the UDDI publisher with the specified user name (ID) from the UDDI registry.
- Invoke deleteUddiUser:
uddiNode.deleteUddiUser("user1");assignTier Assigns UDDI publishers with supplied IDs to the specified tier. This is useful when you want to restrict several UDDI publishers, perhaps by assigning them all to a tier that doesn't allow publishing of any entities.
- Create list of publisher IDs:
List uddiUserIds = new ArrayList(); uddiUserIds.add("Publisher1"); uddiUserIds.add("Publisher2"); uddiUserIds.add("Publisher3"); uddiUserIds.add("Publisher4"); uddiUserIds.add("Publisher5"); uddiUserIds.add("cts1"); uddiUserIds.add("cts2");- Invoke assignTier:
uddiNode.assignTier(uddiUserIds, "0");getUserTier Returns information about the tier a UDDI publisher is assigned to. The returned TierInfo has getters methods for retrieving the tier ID, tier name, tier description, and whether the tier is the default tier.
- Invoke getUserTier:
TierInfo tierInfo = getUserTier("Publisher3");- Output the contents of the TierInfo object:
System.out.println(tierInfo);
Manage value sets
Value sets are represented in a UDDI registry as value set tModels, with a UDDI types keyedReference with value ‘categorization'. Such value sets are backed with a set of valid values and for user defined value sets, this data is loaded into the UDDI registry using UddiNode MBean operations (although it is more convenient to use the User defined value set tool for this purpose). Each value set can be controlled by policy as being supported or not supported. When a value set is supported by policy, it can be referenced within UDDI publish requests. The UddiNode operations available to manage value sets and their data are: getValueSets, getValueSetDetail, getValueSetProperty, updateValueSet, updateValueSets, loadValueSet, changeValueSetTModelKey, unloadValueSet and isExistingValueSet.
See ManageValueSetsSample class for sample code that demonstrates the attributes and operations described in this section.
getValueSets Returns collection of ValueSetStatus objects.
- Invoke getValueSets:
List valueSets = uddiNode.getValueSets();- Cast each element to ValueSetStatus and output contents:
for (Iterator iter = valueSets.iterator(); iter.hasNext();) { ValueSetStatus valueSetStatus = (ValueSetStatus) iter.next(); System.out.println(valueSetStatus); }getValueSetDetail Returns ValueSetStatus object for the given value set tModel key.
- Invoke getValueSetDetail:
uddiNode.getValueSetDetail( "uddi:uddi.org:ubr:categorization:naics:2002");- Retrieve and display details:
String name = valueSetStatus.getName(); String displayName = valueSetStatus.getDisplayName(); boolean supported = valueSetStatus.isSupported(); System.out.println("name: " + name); System.out.println("display name: " + displayName); System.out.println("supported: " + supported);- Display value set properties:
List properties = valueSetStatus.getProperties(); for (Iterator iter = properties.iterator(); iter.hasNext();) { ValueSetProperty property = (ValueSetProperty) iter.next(); System.out.println(property); }getValueSetProperty Returns a property of a value set as a ValueSetProperty object. This is mainly for use by the admin console to render properties of a value set as a row in a table. For example, one such property is the keyedReference, which indicates whether the value set is checked.
- Invoke getValueSetProperty:
uddiNode.getValueSetProperty( "uddi:uddi.org:ubr:categorization:naics:2002", ValueSetPropertyConstants.VS_CHECKED);- Read and display boolean value of the property:
boolean checked = valueSetProperty.getBooleanValue(); System.out.println("checked: " + checked);updateValueSet Updates value set status. Only the supported attribute can be updated (all other setter methods are used by the UDDI application).
- Create a ValueSetStatus object specifying the tModel key and the updated supported value:
ValueSetStatus updatedStatus = new ValueSetStatus(); updatedStatus.setTModelKey( "uddi:uddi.org:ubr:categorization:naics:2002"); updatedStatus.setSupported(true);- Invoke updateValueSet:
uddiNode.updateValueSet(updatedStatus);updateValueSets Updates value set status for multiple value sets. As for the updateValueSet operation, only the supported attribute is updated.
- Populate List with updated ValueSetStatus objects:
List valueSets = new ArrayList(); ValueSetStatus valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:categorization:naics:2002"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus); valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:categorizationgroup:wgs84"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus); valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:identifier:iso6523:icd"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus);- Invoke updateValueSets:
uddiNode.updateValueSets(valueSets);loadValueSet Loads values for a value set from a UDDI registry V3/V2 taxonomy data file on the local file system.
there is also a loadValueSet operation that takes a ValueSetData object but this is only for use by the user defined value set tool.
- Invoke loadValueSet:
(Windows)
uddiNode.loadValueSet( "C:/valuesets/myvalueset.txt", "uddi:cell:node:server:myValueSet");changeValueSetTModelKey Any value set values that were allocated to one value set tModel are allocated to the new value set tModel.
- Invoke changeValueSetTModelKey with old and new tModel keys:
uddiNode.changeValueSetTModelKey( "uddi:cell:node:server:myValueSet", "uddi:cell:node:server:myNewValueSet");unloadValueSet Unloads values for a value set with the given tModel key.
- Invoke unloadValueSet:
uddiNode.unloadValueSet("uddi:myValueSet");isExistingValueSet Determines if value set data exists for the given tModel key.
- Invoke isExistingValueSet and display result:
boolean exists = uddiNode.isExistingValueSet( "uddi:uddi.org:ubr:categorization:naics:2002"); System.out.println("NAICS 2002 is a value set: " + exists);
Related tasks
Use the UDDI registry 
Related information
UDDI registry management interfaces