Each WebSphere UDDI Registry application registers an MBean with an MBean identifier of ‘UddiNode’. This MBean may be used by client applications 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.
You 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 WebSphere Application Server global security is enabled, you can only invoke the operations of the UddiNode MBean if you are a user in an administrative role. The operations which make updates require the Administrator or Operator role, while get operations can be performed by Administator, Operator, Configurator and Monitor roles.
UddiNodeProxy Usage
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] (Specifies the 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.changed
See ManageNodeInfoSample class for sample code that demonstrates the attributes and operations described in this section.
Managing 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
String nodeID = uddiNode.getNode(); System.out.println("node ID: " + nodeId);
nodeState
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.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, you 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.
String nodeStateKey = uddiNode.getNodeState();
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
String nodeDescription = uddiNode.getNodeDescription(); System.out.println("node description: " + nodeDescription);
nodeApplicationName
String nodeApplicationId = uddiNode.getApplicationId(); System.out.println("node application location: " + nodeApplicationId);
activateNode
uddiNode.activateNode();
deactivateNode
uddiNode.deactivateNode();
initNode
uddiNode.initNode();
Managing 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
List properties = uddiNode.getProperties();
if (properties != null) { for (Iterator iter = properties.iterator(); iter.hasNext();) { ConfigurationProperty property = (ConfigurationProperty) iter.next(); System.out.println(property); } }
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: none
The nameKey and descriptionKey values can be used to look up the translated name and description for a given locale, using the messages.properties resource in uddiadmin.jar.
getProperty
ConfigurationProperty property = uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);
int maxResults = property.getIntegerValue();
updateProperty
ConfigurationProperty defaultLanguage = new ConfigurationProperty(); defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);
defaultLanguage.setStringValue("ja");
uddiNode.updateProperty(defaultLanguage);
updateProperties
List updatedProperties = new ArrayList(); updatedProperties.add(updatedProperty1); updatedProperties.add(updatedProperty2);
uddiNode.updateProperties(updatedProperties);
Managing 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
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 can be looked up in the messages.properties resource in uddiadmin.jar). While the PolicyGroup class does have a getPolicies method it is important to note that PolicyGroup objects returned by the getPolicyGroups operation do not contain any Policy objects. This is so 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, you would use the getPolicyGroup operation.
getPolicyGroup
String groupId = Integer.toString(PolicyConstants.REG_APIS_GROUP);
PolicyGroup policyGroup = uddiNode.getPolicyGroup(groupId);
getPolicy
String policyId = Integer.toString( PolicyConstants.REG_AUTHORIZATION_FOR_INQUIRY_API);
Policy policy = uddiNode.getPolicy(policyId);
updatePolicy
Policy updatedPolicy = new Policy(); String policyId = Integer.toString(PolicyConstants.REG_SUPPORTS_UUID_KEYS); updatedPolicy.setId(policyId);
updatedPolicy.setBooleanValue(true);
uddiNode.updatePolicy(updatedPolicy);
updatePolicies
List updatedPolicies = new ArrayList(); updatedPolicies.add(updatedPolicy1); updatedPolicies.add(updatedPolicy2);
uddiNode.updatePolicies(updatedPolicies);
Managing 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
String tierName = "Tier 100"; String tierDescription = "A tier with all limits set to 100."; TierInfo tierInfo = new TierInfo(null, tierName, tierDescription);
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);
Tier tier = new Tier(tierInfo, limits);
Tier createdTier = uddiNode.createTier(tier);
tierId = createdTier.getId(); System.out.println("created tier has ID: " + tierId);
getTierDetail
Tier tier = uddiNode.getTierDetail("2");
updateTier
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);
uddiNode.updateTier(modifiedTier);
getTierInfos
List tierInfos = uddiNode.getTierInfos();
if (tierInfos != null) { for (Iterator iter = tierInfos.iterator(); iter.hasNext();) { TierInfo tierInfo = (TierInfo) iter.next(); System.out.println(tierInfo); } }
setDefaultTier
uddiNode.setDefaultTier("4");
deleteTier
uddiNode.deleteTier("4");
getUserCount
Integer userCount = uddiNode.getUserCount("4"); System.out.println("users in tier 4: " + userCount.intValue());
getLimitInfos
List limits = uddiNode.getLimitInfos();
for (Iterator iter = limits.iterator(); iter.hasNext();) { Limit limit = (Limit) iter.next(); System.out.println("limit ID: " + limit.getId() + ", limit value: " + limit.getIntegerValue()); }
Managing 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 name (ID), a TierInfo object which specifies the tier ID to allocate the UDDI publisher to, and a collection of Entitlement objects which specify what the UDDI publisher is permitted to do.
UddiUser user = new UddiUser("user1", new TierInfo("3"), null);
uddiNode.createUddiUser(user);
createUddiUsers
TierInfo tier1 = new TierInfo("1"); TierInfo tier4 = new TierInfo("4");
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);
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);
uddiNode.createUddiUsers(uddiUsers);
updateUddiUser
Entitlement publishUuiDKeyGenerator = new Entitlement(PUBLISH_UUID_KEY_GENERATOR, true); Entitlement publishWithUuidKey = new Entitlement(PUBLISH_WITH_UUID_KEY, true);
List entitlements = new ArrayList(); entitlements.add(publishUuiDKeyGenerator); entitlements.add(publishWithUuidKey);
user.setEntitlements(entitlements);
uddiNode.updateUddiUser(user);
getUddiUser
UddiUser user1 = uddiNode.getUddiUser("user1");
System.out.println("retrieved user: " + user1);
getUserInfos
List registeredUsers = uddiNode.getUserInfos();
System.out.println("retrieved registered users: "); System.out.println(registeredUsers);
getEntitlementInfos
List entitlementInfos = uddiNode.getEntitlementInfos();
String messages = "com.ibm.uddi.v3.management.messages"; ResourceBundle bundle = ResourceBundle.getBundle( messages, Locale.ENGLISH);
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
uddiNode.deleteUddiUser("user1");
assignTier
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");
uddiNode.assignTier(uddiUserIds, "0");
getUserTier
TierInfo tierInfo = getUserTier("Publisher3");
System.out.println(tierInfo);
Managing 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
List valueSets = uddiNode.getValueSets();
for (Iterator iter = valueSets.iterator(); iter.hasNext();) { ValueSetStatus valueSetStatus = (ValueSetStatus) iter.next(); System.out.println(valueSetStatus); }
getValueSetDetail
uddiNode.getValueSetDetail( "uddi:uddi.org:ubr:categorization:naics:2002");
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);
List properties = valueSetStatus.getProperties(); for (Iterator iter = properties.iterator(); iter.hasNext();) { ValueSetProperty property = (ValueSetProperty) iter.next(); System.out.println(property); }
getValueSetProperty
uddiNode.getValueSetProperty( "uddi:uddi.org:ubr:categorization:naics:2002", ValueSetPropertyConstants.VS_CHECKED);
boolean checked = valueSetProperty.getBooleanValue(); System.out.println("checked: " + checked);
updateValueSet
ValueSetStatus updatedStatus = new ValueSetStatus(); updatedStatus.setTModelKey( "uddi:uddi.org:ubr:categorization:naics:2002"); updatedStatus.setSupported(true);
uddiNode.updateValueSet(updatedStatus);
updateValueSets
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);
uddiNode.updateValueSets(valueSets);
loadValueSet
uddiNode.loadValueSet(
"C:/valuesets/myvalueset.txt",
"uddi:cell:node:server:myValueSet");
changeValueSetTModelKey
uddiNode.changeValueSetTModelKey( "uddi:cell:node:server:myValueSet", "uddi:cell:node:server:myNewValueSet");
unloadValueSet
uddiNode.unloadValueSet("uddi:myValueSet");
isExistingValueSet
boolean exists = uddiNode.isExistingValueSet( "uddi:uddi.org:ubr:categorization:naics:2002"); System.out.println("NAICS 2002 is a value set: " + exists);
Related information
UDDI Registry Management Interfaces