Service Registry 3 2005Q4 Developer's Guide

Finding Objects by External Link

Finding objects by external link does not require the use of a classification scheme, but it does require you to specify a valid URI. The arguments to the createExternalLink method are a URI and a description.

If the link you specify is outside your firewall, you must also specify the system properties http.proxyHost and http.proxyPort when you run the program so that JAXR can determine the validity of the URI.

The following code fragment finds all organizations that have a specified ExternalLink object.

ExternalLink extLink =
     blcm.createExternalLink("http://java.sun.com/",
         "Sun Java site");

Collection extLinks = new ArrayList();
extLinks.add(extLink);
BulkResponse response = bqm.findObjects("Organization",
     null, null, null, null, null, extLinks);
Collection objects = response.getCollection();

Finding Objects by External Link: Example

For an example of finding objects by external link, see JAXRSearchByExternalLink.java in the directory<INSTALL>/registry/samples/search-external-link/src, which searches for objects that have a specified external link. The http.proxyHost and http.proxyPort properties are specified in the run target in the build.xml file.

ProcedureTo Run the JAXRSearchByExternalLink Example

Before You Begin

To obtain results from this example, first run the publish-object example described in Adding Classifications: Example.

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

  2. Type the following command:


    asant run