Service Registry 3 2005Q4 Developer's Guide

Finding Objects by Type

To find all objects of a specified type, specify only the first argument of the BusinessQueryManagerImpl.findObjects method and, optionally, a collection of FindQualifier objects. For example, if typeString is a string whose value is either "Service" or "service", the following code fragment finds all services in the Registry and sorts them in alphabetical order.

Collection findQualifiers = new ArrayList();
findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);

BulkResponse response = bqm.findObjects(typeString,
     findQualifiers, null, null, null, null, null);

You cannot use wildcards in the first argument to findObjects.

Finding Objects by Type: Example

For an example of finding objects by type, see JAXRSearchByObjectType.java in the directory <INSTALL>/registry/samples/search-object-type/src.

ProcedureTo Run the JAXRSearchByObjectType Example

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

  2. Type the following command, specifying a string value:


    asant run -Dtype=type_name
    

    The program performs a case-insensitive search, returning all objects whose type is type_name and displaying their names, descriptions, and unique identifiers. Specify the exact name of the type, not a wildcard, as in the following command line:


    asant run -Dtype=federation