Network Deployment (Distributed operating systems), v8.0 > Reference > Developer detailed usage information
Manage UDDI publishers
Overview
The UddiNode MBean provides the following operations to manage UDDI publishers:
- createUddiUser
- createUddiUsers
- updateUddiUser
- deleteUddiUser
- getUddiUser
- getUserInfos
- getEntitlementInfos
- assignTier
- getUserTier
The ManagePublishersSample class in the UDDI registry samples demonstrates each of these operations.
createUddiUser
Register a single UDDI publisher. The UddiUser class represents the UDDI publisher, and is constructed using...
- User ID
- TierInfo object that specifies the tier ID to allocate the UDDI publisher to
- Collection of Entitlement objects that specify what the UDDI publisher is permitted to do
To allocate the UDDI publisher default entitlements, set the entitlements parameter to null.
Create the UddiUser object and invoke the createUddiUser operation...
UddiUser user = new UddiUser("user1", new TierInfo("3"), null);
uddiNode.createUddiUser(user);
createUddiUsers
Register multiple UDDI publishers. The following example shows how to register seven UDDI publishers with default entitlements in one call.
- Create TierInfo objects for the tiers that the publishers are allocated to:
TierInfo tier1 = new TierInfo("1"); TierInfo tier4 = new TierInfo("4");
- 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);
- 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 the createUddiUsers operation:
uddiNode.createUddiUsers(uddiUsers);
updateUddiUser
Update a UDDI publisher with details in supplied UddiUser object...
- change the tier
- update the entitlements
Supply only the entitlements update; other available entitlements retain their existing values.
- 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);
- Add the 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 the updateUddiUser operation:
uddiNode.updateUddiUser(user);
getUddiUser
Retrieve details about a UDDI publisher in the form of a UddiUser object by specifying...
- UDDI publisher ID
- information about the tier the UDDI publisher is assigned to
- entitlements of the UDDI publisher
Invoke the getUddiUser operation:
UddiUser user1 = uddiNode.getUddiUser("user1");
.println("retrieved user: " + user1);
getUserInfos
Return a collection of UserInfo objects representing UDDI publishers known to the UDDI node, and the tier that the UDDI publisher is allocated to.
To get details about a specific UDDI publisher, including the tier ID and entitlements, use the getUddiUser operation.
Invoke the getUserInfos operation:
List registeredUsers = uddiNode.getUserInfos();
.println("retrieved registered users: ");
.println(registeredUsers);
getEntitlementInfos
Return a collection of Entitlement objects. Each entitlement is a property that controls whether a UDDI publisher has permission to undertake a specified action.
Invoke the getEntitlementInfos operation:
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);
.println(entitlementOutput.toString());
}
deleteUddiUser
Remove the UDDI publisher with the specified user ID from the UDDI registry.
uddiNode.deleteUddiUser("user1");
assignTier
Assign the UDDI publishers with the supplied IDs. Useful for restricting UDDI publishers, for example by assigning them to a tier that does not allow publishing of any entities.
- Create a list of publisher IDs and then invoke the assignTier operation...
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
Return information about the tier that a UDDI publisher is assigned to. The returned TierInfo has getter methods for retrieving...
- tier ID
- tier name
- tier description
- whether the tier is the default tier
Invoke the getUserTier operation:
TierInfo tierInfo = getUserTier("Publisher3");
.println(tierInfo);
Related
Manage the UDDI registry
Use the UDDI registry
Use administrative programs (JMX)
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
Samples for WAS