Service Registry 3.1 Developer's Guide

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

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

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


    Ant-base/ant run -Dtype=type-name
    

    Specify the exact name of the type, not a wildcard, as in the following command line:


    Ant-base/ant run -Dtype=federation
    

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

    The program performs a case-insensitive search, returning all objects whose type is type-nameand displaying their names, descriptions, and unique identifiers. At the end, it displays the number of objects found.