|PREV PACKAGE NEXT PACKAGE||FRAMES NO FRAMES|
|Projection||A projection of content from a source into the integrated/federated repository.|
|Projection.PathRule||A rule that is defined with a single
|Projection.Rule||A rule used within a project do define how content within a source is projected into the federated repository.|
|ProjectionParser||A parser library for
JBoss DNA provides a federated connector that is able to access repository content from multiple external systems
and make that content look like it exists in a single unified repository. Like other connectors, a
RepositorySource implementation is provided, called
that can be set up and configured to be used by a
Graph or a JCR repository.
Each federated repository source provides a unified repository consisting of information that is dynamically federated from multiple other RepositorySource instances. The connector is configured with a number of projections that each describe where in the unified repository the federated connector should place the content from another source. Projections consist of the name of the source containing the content and a number of rules that define the path mappings, where each rule is defined as a string with this format:
pathInFederatedRepository => pathInSourceRepository
pathInFederatedRepository is the string representation of the path in the unified
(or federated) repository, and
pathInSourceRepository is the string representation of the path of the
actual content in the underlying source. For example:
/ => /
is a trivial rule that states that all of the content in the underlying source should be mapped into the unified
repository such that the locations are the same. Therefore, a node at
/a/b/c in the source would
appear in the unified repository at
/a/b/c. This is called a mirror projection,
since the unified repository mirrors the underlying source repository.
Another example is an offset projection, which is similar to the mirror projection except that the federated path includes an offset not found in the source:
/alpha/beta => /
Here, a node at
/a/b/c in the source would actually appear in the unified repository at
/alpha/beta/a/b/c. The offset path (
/alpha/beta in this example) can have 1 or more segments.
(If there are no segments, then it reduces to a mirror projection.)
Often a rule will map a path in one source into another path in the unified source:
/alpha/beta => /foo/bar
Here, the content at
/foo/bar is projected in the unified repository under
meaning that the
/foo/bar prefix never even appears in the unified repository. So the node at
/foo/bar/baz/raz would appear in the unified repository at
the size of the two paths in the rule don't matter.
Federated repositories that use a single projection are useful, but they aren't as interesting or powerful as those that use multiple projections. Consider a federated repository that is defined by two projections:
/ => / for source "S1" /alpha => /foo/bar for source "S2"
And consider that S1 contains the following structure:
+- a | +- i | +- j +- b +- k +- m +- nand S2 contains the following:
+- foo +- bar | +- baz | | +- taz | | +- zaz | +- raz +- bum +- bot
The unified repository would then have this structure:
+- a | +- i | +- j +- b | +- k | +- m | +- n +- alpha +- baz +- taz | +- zaz +- raz
Note how the
/foo/bum branch does not even appear in the unified repository, since it is outside of the
branch being projected. Also, the
/alpha node doesn't exist in S1 or S2; it's what is called a
placeholder node that exists purely so that the nodes below it have a place to exist.
Placeholders are somewhat special: they allow any structure below them (including other placeholder nodes or real
projected nodes), but they cannot be modified.
Even more interesting are cases that involve more projections. Consider a federated repository that contains information about different kinds of automobiles, aircraft, and spacecraft, except that the information about each kind of vehicle exists in a different source (and possibly a different kind of source, such as a database, or file, or web service).
First, the sources. The "Cars" source contains the following structure:
+- Cars +- Hybrid | +- Toyota Prius | +- Toyota Highlander | +- Nissan Altima +- Sports | +- Aston Martin DB9 | +- Infinity G37 +- Luxury | +- Cadillac DTS | +- Bentley Continental | +- Lexus IS350 +- Utility +- Land Rover LR2 +- Land Rover LR3 +- Hummer H3 +- Ford F-150
The "Aircraft" source contains the following structure:
+- Aviation +- Business | +- Gulfstream V | +- Learjet 45 +- Commercial | +- Boeing 777 | +- Boeing 767 | +- Boeing 787 | +- Boeing 757 | +- Airbus A380 | +- Airbus A340 | +- Airbus A310 | +- Embraer RJ-175 +- Vintage | +- Fokker Trimotor | +- P-38 Lightning | +- A6M Zero | +- Bf 109 | +- Wright Flyer +- Homebuilt +- Long-EZ +- Cirrus VK-30 +- Van's RV-4
Finally, our "Spacecraft" source contains the following structure:
+- Space Vehicles +- Manned | +- Space Shuttle | +- Soyuz | +- Skylab | +- ISS +- Unmanned | +- Sputnik | +- Explorer | +- Vanguard | +- Pioneer | +- Marsnik | +- Mariner | +- Mars Pathfinder | +- Mars Observer | +- Mars Polar Lander +- Launch Vehicles | +- Saturn V | +- Aries | +- Delta | +- Delta II | +- Orion +- X-Prize +- SpaceShipOne +- WildFire +- Spirit of Liberty
So, we can define our unified "Vehicles" source with the following projections:
/Vehicles => / for source "Cars" /Vehicles/Aircraft => /Aviation for source "Aircraft" /Vehicles/Spacecraft => /Space Vehicles for source "Cars"
The result is a unified repository with the following structure:
+- Vehicles +- Cars | +- Hybrid | | +- Toyota Prius | | +- Toyota Highlander | | +- Nissan Altima | +- Sports | | +- Aston Martin DB9 | | +- Infinity G37 | +- Luxury | | +- Cadillac DTS | | +- Bentley Continental | +- Lexus IS350 | +- Utility | +- Land Rover LR2 | +- Land Rover LR3 | +- Hummer H3 | +- Ford F-150 +- Aircraft | +- Business | | +- Gulfstream V | | +- Learjet 45 | +- Commercial | | +- Boeing 777 | | +- Boeing 767 | | +- Boeing 787 | | +- Boeing 757 | | +- Airbus A380 | | +- Airbus A340 | | +- Airbus A310 | | +- Embraer RJ-175 | +- Vintage | | +- Fokker Trimotor | | +- P-38 Lightning | | +- A6M Zero | | +- Bf 109 | | +- Wright Flyer | +- Homebuilt | +- Long-EZ | +- Cirrus VK-30 | +- Van's RV-4 +- Spacecraft +- Manned | +- Space Shuttle | +- Soyuz | +- Skylab | +- ISS +- Unmanned | +- Sputnik | +- Explorer | +- Vanguard | +- Pioneer | +- Marsnik | +- Mariner | +- Mars Pathfinder | +- Mars Observer | +- Mars Polar Lander +- Launch Vehicles | +- Saturn V | +- Aries | +- Delta | +- Delta II | +- Orion +- X-Prize +- SpaceShipOne +- WildFire +- Spirit of Liberty
Other combinations are of course possible.
|PREV PACKAGE NEXT PACKAGE||FRAMES NO FRAMES|