+

Search Tips   |   Advanced Search

 

UDDI registry Administrative (JMX) Interface

 

You can use the UDDI registry Administrative Interface to inspect and manage the runtime configuration of a UDDI application. You 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 Using administrative programs (JMX).

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 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 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 which 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

  1. 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]  (Timeier 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.

 

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:

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, 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. Each node state value is in fact a message key which can be looked up in the messages.properties resource bundle. The attribute value can be retrieved using the getNodeState method of UddiNodeProxy:

  1. Invoke getNodeState:

          String nodeStateKey = uddiNode.getNodeState();
    

  2. 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 You can get the administrator assigned description for the UDDI node using the getNodeDescription method of UddiNodeProxy:

  1. 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:

  1. 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.

  1. . Invoke activateNode:

          uddiNode.activateNode();
    

deactivateNode Changes the state of the UDDI node to deactivated, if the UDDI node was previously activated.

  1. Invoke deactivateNode:

          uddiNode.deactivateNode();
    

initNode Causes UDDI node initialization, and when this completes the state of the UDDI node is ‘activated’.

  1. 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.

  1. Invoke getProperties:

          List properties = uddiNode.getProperties();
    

  2. 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);
            }
         }
    
    

Once you have the ConfigurationProperty objects you 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: none

You can use 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.

  1. Invoke getProperty:

          ConfigurationProperty property = 
        uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);
    
    

  2. To retrieve the value of the property you could use the getValue method which returns an Object, but in this case, the property is of type integer, so it’s 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 you 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:

  1. Create a ConfigurationProperty object and set its ID:

          ConfigurationProperty defaultLanguage = new ConfigurationProperty();
      defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);
    
    

  2. Set the value:

          defaultLanguage.setStringValue("ja");
    

  3. Invoke updateProperty:

          uddiNode.updateProperty(defaultLanguage);
    

updateProperties Updates several ConfigurationProperty objects in a single request. Set up the ConfigurationProperty objects as for the updateProperty operation.

  1. Add updated properties to a List:

          List updatedProperties = new ArrayList();
                    
          updatedProperties.add(updatedProperty1);
          updatedProperties.add(updatedProperty2);
    
    

  2. 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.

  1. Invoke getPolicyGroups:

          List policyGroups = uddiNode.getPolicyGroups();
    

  2. 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 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 within a policy group, use the getPolicyGroup operation.

getPolicyGroup Returns the PolicyGroup object with the supplied ID.

  1. Convert policy group ID to a String:

          String groupId = Integer.toString(PolicyConstants.REG_APIS_GROUP);
    

  2. 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.

  1. Convert policy ID to a String:

          String policyId = Integer.toString( 
                      PolicyConstants.REG_AUTHORIZATION_FOR_INQUIRY_API);
    
    

  2. 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 you 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:

  1. Create a Policy object and set its ID:

          Policy updatedPolicy = new Policy();
          String policyId = 
                Integer.toString(PolicyConstants.REG_SUPPORTS_UUID_KEYS); 
          updatedPolicy.setId(policyId);
    
    

  2. Set the value:

          updatedPolicy.setBooleanValue(true);
    

  3. Invoke updatePolicy:

          uddiNode.updatePolicy(updatedPolicy);
    

updatePolicies Updates several Policy objects in a single request. Set up the Policy objects as for the updatePolicy operation.

  1. Add updated policies to a List:

          List updatedPolicies = new ArrayList();
                    
          updatedPolicies.add(updatedPolicy1);
          updatedPolicies.add(updatedPolicy2);
    
    

  2. 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.

  1. 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);
    
    

  2. 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);
    
    

  3. Create Tier object:

          Tier tier = new Tier(tierInfo, limits);
    

  4. Invoke create Tier and retrieve created tier:

        Tier createdTier = uddiNode.createTier(tier);
    

  5. 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 may 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.

  1. Invoke getTierDetail:

         Tier tier = uddiNode.getTierDetail("2");
    

updateTier Updates tier contents with the supplied Tier object.

  1. Update an existing Tier object (which may 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);
    
    

  2. Invoke updateTier:

         uddiNode.updateTier(modifiedTier);
    

getTierInfos Returns collection of lightweight tier descriptor objects (TierInfo) which contain the tier ID, and tier name and description values, and whether the tier is the default tier.

  1. Invoke getTierInfos:

        List tierInfos = uddiNode.getTierInfos();
    

  2. 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 Timeier 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 this would be set to a tier with low publish limits to prevent casual users publishing too many entities.

  1. 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.

  1. Invoke deleteTier:

         uddiNode.deleteTier("4");
    

getUserCount Returns the number of UDDI publishers assigned to tier specified by the tier ID.

  1. 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.

  1. Invoke getLimitInfos:

         List limits = uddiNode.getLimitInfos();
    

  2. 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 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.

to allocate the UDDI publisher default entitlements, set the entitlements parameter to null.

  1. Create the UddiUser object:

          UddiUser user = new UddiUser("user1", new TierInfo("3"), null);
    

  2. 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.

  1. Create TierInfo objects for tiers that publishers will be allocated to:

          TierInfo tier1 = new TierInfo("1");
          TierInfo tier4 = new TierInfo("4");
    
    

  2. 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);
    
    

  3. 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);
    
    

  4. 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.

only supply the entitlements you want to update – the remainder of available entitlements will retain their existing value.

  1. 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);
    
    

  2. Add Entitlement objects to a List:

          List entitlements = new ArrayList();
          entitlements.add(publishUuiDKeyGenerator);
          entitlements.add(publishWithUuidKey);
    
    

  3. Update a UddiUser object with the updated entitlements:

          user.setEntitlements(entitlements);
    

  4. 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.

  1. Invoke getUddiUser:

          UddiUser user1 = uddiNode.getUddiUser("user1");
    

  2. 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.

  1. Invoke getUserInfos:

          List registeredUsers = uddiNode.getUserInfos();
    

  2. 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.

  1. Invoke getEntitlementInfos:

          List entitlementInfos = uddiNode.getEntitlementInfos();
    

  2. Specify where to find message resources:

          String messages = "com.ibm.uddi.v3.management.messages";
          ResourceBundle bundle = ResourceBundle.getBundle(
                                               messages, Locale.ENGLISH);
    
    

  3. 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.

  1. 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.

  1. 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");
    
    

  2. 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.

  1. Invoke getUserTier:

          TierInfo tierInfo = getUserTier("Publisher3");
    

  2. 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.

  1. Invoke getValueSets:

          List valueSets = uddiNode.getValueSets();
    

  2. 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.

  1. Invoke getValueSetDetail:

          uddiNode.getValueSetDetail(
                         "uddi:uddi.org:ubr:categorization:naics:2002");
    
    

  2. 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);
    
    

  3. 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 administrative 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.

  1. Invoke getValueSetProperty:

           uddiNode.getValueSetProperty(
                          "uddi:uddi.org:ubr:categorization:naics:2002", 
                          ValueSetPropertyConstants.VS_CHECKED);
    
    

  2. 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).

  1. 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);
    
    

  2. 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.

  1. 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);
    
    

  2. 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.

  1. 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.

  1. 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.

  1. Invoke unloadValueSet:

         uddiNode.unloadValueSet("uddi:myValueSet");
    

isExistingValueSet Determines if value set data exists for the given tModel key.

  1. 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

 

Reference topic