Hi,

I have implemented the support for dependency management between resources. Now it is possible to set dependencies and dependents of resources when the resources are added to the registry.

For example you can set current version of /projects/esb/config.xml as a dependency of /projects/design.doc and version 2 of /projects/docs/rules.xml as a dependent of /projects/design.doc as follows.

Resource r1 = new Resource();
r1.addDependency("/projects/esb/config.xml");
r1.addDependent("/projects/docs/rules.xml?v=2");
registry.put("/projects/design.doc");

You can also set dependencies using the Registry API between any version of resources.

registry.addDependencies("/projects/esb/config.xml?v=3", new String[] {"/projects/esb/endpoint1.xml", "/projects/esb/sequence2.xml?v=5"});

Above code sets current version of /projects/esb/endpoint1.xml and version 5 of /projects/esb/sequence2.xml as dependencies of version 3 of /projects/esb/config.xml.

Dependencies of resources can be browsed using two methods. First level dependencies and dependents of resources can be viewed from the resource object.

Resource r1 = registry.get("/projects/design.doc");
String[] dependencies = r1.getDependencies();
String[] dependents = r1.getDependents();

Entire dependency and dependent chains of resources can be analyzed using the Registry API.

DependencyChain[] dependencies = registry.getAllDependencies("/projects/design.doc"); DependentChain[] dependents = registry.getAllDependents("/projects/design.doc");

I added a test case org.wso2.registry.jdbc.DependencyTest which demonstrates the use of dependency handling functionality of the registry.

There is more left on providing UI controls for dependency management and integrating notifications for dependency changes.

Thanks,
Chathura


_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to