The objective of this lesson is to learn how to delete a technical model from an UDDI registry.
Lesson 9, "Saving a tModel", can be completed before this lesson to save a sample tModel to be deleted.
The UDDI Programmer's API defines the messages to be used to delete information from an UDDI registry. Among them, the delete_tModel message studied in this lesson allows deleting a technical model. The UDDI registry reply is a dispositionReport message that provides status on the success of the deletion.
We first create an UDDIProfile and set, in this example, the publishing URL to Microsoft's UBR. We will also use UDDI 2.0 for the interactions with the UDDI registry:
UDDIProfile profile = new UDDIProfile();
profile.setProperty("inspireit.uddi.publishing.url","http://uddi.microsoft.com/publish");
profile.setProperty("inspireit.uddi.version","2.0");
An UDDIPublisher to publish to the UDDI registry can be instantiated using the static getPublisher( UDDIProfile ) method:
UDDIPublisher publisher = UDDIPublisher.getPublisher(profile);
UDDIPublisher comes with a set of methods to delete information from UDDI registries. To delete a technical model, we use one of the available deleteTModel() methods. For example:
TModelKey tModelKey = ... // the technical model key of the technical model to delete
DispositionReport dispositionReport = publisher.deleteTModel(tModelKey);
The UDDIPublisher methods all throw RemoteException and UDDIException , not catched here for clarity. The returned DispositionReport provides information on the status of the deletion:
Results results = dispositionReport.getResults();
Result _results[] = results.toArray();
for(int i=0; i< _results.length; i++) {
if (result.getErrNo() == Result.E_success) {
System.out.println("Technical model successfully deleted");
|
|
(c) INSPIRE IT, 2003 | Send us your feedback: developers@ruddi.biz