Service Registry 3.1 Developer's Guide

Finding Objects You Published

You can retrieve all objects that you published to the Registry. Alternatively, you can narrow the search to retrieve only the objects that you published that are of a particular object type. To retrieve all the objects that you have published, use the no-argument version of the QueryManager.getRegistryObjects method. The name of this method is misleading, because the method returns only objects that you have published, not all registry objects.

For example, if bqm is your BusinessQueryManager instance, use the following line of code:

BulkResponse response = bqm.getRegistryObjects();

To retrieve all the objects of a particular type that you published, use QueryManager.getRegistryObjects with a constant argument that specifies the type:

BulkResponse response = bqm.getRegistryObjects(LifeCycleManager.SERVICE);

The QueryManager.getRegistryObjects method is case-sensitive.

The sample programs JAXRGetMyObjects and JAXRGetMyObjectsByType show how to use these methods.

Finding Objects You Published: Examples

For examples of finding objects you published, see JAXRGetMyObjects.java and JAXRGetMyObjectsByType.java in the directory INSTALL/registry-samples/get-objects/src. The first example, JAXRGetMyObjects.java, retrieves all objects you have published. The second example, JAXRGetMyObjectsByType.java, retrieves all the objects you have published of a specified type.

ProcedureTo Run the JAXRGetMyObjects and JAXRGetMyObjectsByType Examples

  1. Go to the directory INSTALL/registry-samples/get-objects.

  2. To find all the objects that you have published, type the following command:


    Ant-base/ant get-obj
    
  3. To find all the objects that you have published of a specified type, type the following command, where type-name is case-sensitive:


    Ant-base/ant get-obj-type -Dtype=type-name
    

    The JAXRGetMyObjectsByType program passes the object type as a string argument to QueryManager.getRegistryObjects in order to accept user input as simply as possible. However, developers should use the constants defined by the LifeCycleManager interface.