Management of UDDI publishers

You can use the UDDI registry administrative interface to register UDDI publishers.

Managing UDDI publishers

The UddiNode MBean provides the following operations to manage UDDI publishers:
  • createUddiUser
  • createUddiUsers
  • updateUddiUser
  • deleteUddiUser
  • getUddiUser
  • getUserInfos
  • getEntitlementInfos
  • assignTier
  • getUserTier

In the samples for WebSphere® Application Server, the ManagePublishersSample class in the UDDI registry samples demonstrates these operations. An example is provided for each, making use of the UddiNodeProxy client class.

createUddiUser
Registers a single UDDI publisher in a specified tier with specified entitlements. The UddiUser class represents the UDDI publisher, and 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.
  1. Create the UddiUser object:
    UddiUser user = new UddiUser("user1", new TierInfo("3"), null);
  2. Invoke the createUddiUser operation:
    uddiNode.createUddiUser(user);
createUddiUsers
Registers multiple UDDI publishers. The following example shows how to register seven UDDI publishers with default entitlements in one call.
  1. Create TierInfo objects for the tiers that the publishers are allocated to:
    TierInfo tier1 = new TierInfo("1");
    TierInfo tier4 = new TierInfo("4");
    
  2. Create UddiUser objects for each UDDI publisher, specifying the tier for each publisher:
    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 the createUddiUsers operation:
    uddiNode.createUddiUsers(uddiUsers);
updateUddiUser
Updates a UDDI publisher with the details in the supplied UddiUser object. Typically, you use this operation to change the tier of one UDDI publisher or to update the entitlements of a UDDI publisher. Supply only the entitlements that you want to update; other available entitlements retain their existing values.
  1. Create Entitlement objects with the 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 the 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 the updateUddiUser operation:
    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 the UDDI publisher is assigned to and the entitlements of the UDDI publisher.
  1. Invoke the getUddiUser operation:
    UddiUser user1 = uddiNode.getUddiUser("user1");
  2. Output the contents of the UddiUser object:
    System.out.println("retrieved user: " + user1);
getUserInfos
Returns a collection of UserInfo objects. Each UserInfo object represents a UDDI publisher that is known to the UDDI node, and the tier that the UDDI publisher is allocated to. To get more details about a specific UDDI publisher, including the tier ID and entitlements, use the getUddiUser operation.
  1. Invoke the getUserInfos operation:
    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 a UDDI publisher has permission to undertake a specified action.
  1. Invoke the getEntitlementInfos operation:
    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 ID from the UDDI registry.
  • Invoke the deleteUddiUser operation:
    uddiNode.deleteUddiUser("user1");
assignTier
Assigns the UDDI publishers with the supplied IDs to the specified tier. This operationis useful when you want to restrict several UDDI publishers, for example by assigning them to a tier that does not allow publishing of any entities.
  1. Create a 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 the assignTier operation:
    uddiNode.assignTier(uddiUserIds, "0");
getUserTier
Returns information about the tier that a UDDI publisher is assigned to. The returned TierInfo has getter methods for retrieving the tier ID, tier name, tier description, and whether the tier is the default tier.
  1. Invoke the getUserTier operation:
    TierInfo tierInfo = getUserTier("Publisher3");
  2. Output the contents of the TierInfo object:
    System.out.println(tierInfo);



Related tasks
Managing the UDDI registry
Using the UDDI registry
Using administrative programs (JMX)
Related reference
Management of UDDI node states and attributes
Management of UDDI node configuration properties
Management of UDDI node policies
Management of UDDI node tiers
Management of UDDI node value sets
UDDI registry administrative (JMX) interface
Related information
Samples for Websphere Application Server
Reference topic    

Terms of Use | Feedback

Last updated: Oct 22, 2010 12:21:29 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-zos&topic=rwsu_ai_up
File name: rwsu_ai_up.html