Service Registry 3 2005Q4 Developer's Guide

Finding Objects by Unique Identifier

Every object in the Registry has two identifiers, a unique identifier (also called a Key) and a logical identifier. Often, the unique identifier is the same as the logical identifier. However, when an object exists in more than one version, the unique identifiers are different for each version, but the logical identifier remains the same. (See Retrieving the Version of an Object.)

If you know the value of the unique identifier for an object, you can retrieve the object by calling the QueryManager.getRegistryObject method with the String value as an argument. For example, if bqm is your BusinessQueryManager instance and idString is the String value, the following line of code retrieves the object:

RegistryObject obj = bqm.getRegistryObject(idString);

After you have the object, you can obtain its type, name, description, and other attributes.

Finding Objects by Unique Identifier: Example

For an example of finding objects by unique identifier, see JAXRSearchById.java in the directory <INSTALL>/registry/samples/search-id/src, which searches for objects that have a specified unique identifier.

ProcedureTo Run the JAXRSearchById Example

Steps
  1. Go to the directory <INSTALL>/registry/samples/search-id.

  2. Type the following command:


    asant run -Did=urn_value
    

    For example, if you specify the following ID, you retrieve information on the ObjectType classification scheme.


    urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType