Use the GraphRelationAccessor Interface from DataProvider to handle Resource graph manipulations in all systems.
The GraphRelationAccessor was created to aid in testing the Resource core and utilities. It should now be incorporated into the Resource utilities. This will have several benefits:
Trac #412.
Diff:
Commit 238. Ticket [Trac] #412 (in support of [Trac] #419). Extracted the breadth first graph traversal from ResourceUtils into BreadthFirstGraphTraverser. Calling that traverser strategy from ResourceUtils.visitResourceGraphBreadthFirst. Added GraphTraverser interface. Based GraphVisitor interface on ResourceUtils.ResourceVisitor. Moved Pair from orm.testutils.generate to util package and updated references to it. Added Range class in util package.
Commit 239. Ticket [Trac] #412. Removed commented code and removed unnecessary final classifiers on the Integer parameters to ResourceUtils.visitResourceGraphBreadthFirst.
Commit 240. Ticket [Trac] #412. Moved the start and end index calculations from ResourceUtils and BreadthFirstGraphTraverser to Range so that it wouldn't be duplicated.
Commit 241. Ticket [Trac] #412. Added tests for the range start and end index calculations. Updated the start and end index calculations to be more robust."
Commit 242. Ticket [Trac] #412. Added ensureNotRelated to the GraphRelationAccessor interface. Implemented the method in AbstractGraphRelationAccessor and SuperResourceRelationAccessor. Added tests for the method, including total removal of duplicated relations for sub, source, and target resource relationships.
Commit 243. Ticket [Trac] #412. Added replace*End methods in GraphRelationAccessor and added implementation and tests. Updated ResourceUtils.replaceResourceInGraph to use the ResourceRelationAccessors.
Commit 244. Ticket [Trac] #412 (in service of [Trac] #419). Added code to DataProviderRS.getSuperResources to try to replace all of the super Resource proxies with their implementations. What does not appear to work is serializing a Resource and its super. This needs to be tested out.
Commit 245. Ticket [Trac] #412 (in service of [Trac] #419). Added code to try and explore what is being returned by getSuperResources.
Last edit: Kevin Black 2014-06-25