The objective of this lesson is to learn the basics of UDDI key manipulation with Ruddi such as to determine the UDDI version of a key, transform a key to another UDDI version, etc.
Instances of many data structures in UDDI, including all of the core data structures are kept separately, and are accessed individually by way of unique identifiers called keys. Prior to UDDI 3.0, keys were defined using UUIDs. Starting from UDDI 3.0, URIs are used. Ruddi comes with utilities allowing determining the UDDI specification level of a key, as well as transforming a key from one format to another. Ruddi implements the algorithms recommended by the UDDI 3.0 specification.
Creating a UUID-based UDDI key with Ruddi is as simple as instantiating it. For example, for a business key:
BusinessKey businessKey = new BusinessKey();
The business key value obtained after invoking toString() on the BusinessKey instance could be:
a02da70f-fe2f-37ee-46af-b40458e9dec8
The UUID object corresponding to the business key can be obtained by invoking the getUUID() method:
UUID uuid = businessKey.getUUID();
The URI, UDDI 3.0-compliant form of the UDDI key can be obtained via the getURI() method. Ruddi automatically converts the UDDI key appropriately:
URI uri = businessKey.getURI();
The business key value obtained after invoking toString() on the URI instance would be, in the present case:
uddi:a02da70f-fe2f-37ee-46af-b40458e9dec8
In order to determine the UDDI version of a key, the isV1() , isV2() and isV3() methods of KeysUtil . For example:
if (KeysUtil.isV2(businessKey)) {
System.out.println("This key is UDDI 2.0-compliant");
If the original UDDI key is UDDI 3.0-compliant, for example uddi:tempuri.org , the getUUID() method automatically generates the UUID form using the algorithm described in the UDDI 3.0 specification. For uddi:tempuri.org , the value would be:
|
|
(c) INSPIRE IT, 2003 | Send us your feedback: developers@ruddi.biz