Service Registry 3 2005Q4 Developer's Guide

Adding External Links to Objects

To add an external link to an object, you call the LifeCycleManager.createExternalLink method, which takes two arguments: the URI of the link, and a description of the link. Then you add the external link to the object.

String eiURI = "http://java.sun.com/";
String eiDescription = "Java Technology";
ExternalLink extLink =
     blcm.createExternalLink(eiURI, eiDescription);
object.addExternalLink(extLink);

The URI must be a valid URI, and the JAXR provider checks its validity. If the link that you specify is outside your firewall, you need to specify the system properties http.proxyHost and http.proxyPort when you run the program so that JAXR can determine the validity of the URI.

To disable URI validation (for example, if you want to specify a link that is not currently active), call the ExternalLink.setValidateURI method before you create the link.

extLink.setValidateURI(false);

The example <INSTALL>/registry/samples/publish-object/src/JAXRPublishObject.java, described in Adding Classifications: Example, also adds an external link to an object. The build.xml file for this example specifies the system properties http.proxyHost and http.proxyPort.