Skip navigation links
ModeShape Distribution 5.0.0.Final

Package org.modeshape.jcr.spi.federation

This package provides a Service Provider Interface (SPI) for connectors to external systems.

See: Description

Package org.modeshape.jcr.spi.federation Description

This package provides a Service Provider Interface (SPI) for connectors to external systems. The ModeShape federation system uses these Connector implementations to enable a repository to access external systems and project the external information as structured nodes within the repository. External sources are configured in the repository configuration JSON file to use a specific Connector implementation (including connector-specific configuration properties), while the projections that define how and where the external content is bound into the repository content are created using the FederationManager:
 javax.jcr.Session jcrSession = ...
 Session session = (org.modeshape.jcr.api.Session)jcrSession;
 FederationManager fedMgr = session.getWorkspace().getFederationManager();
 
 javax.jcr.Node parentNode = ... // the parent of the federated content
 String parentPath = parentNode.getPath();
 String sourceName = ... // the name of the external source
 String externalPath = ... // the path of the node in the external source that is to appear as a child of 'parentNode'
 String alias = ... // Optional alias for the external node
 fedMgr.createExternalProjection(parentPath, sourceName, externalPath, alias);
 

To create a custom connector, simply create a Connector subclass and implement the necessary methods. If your connector is only to read information and never will update any external content, you can instead subclass the ReadOnlyConnector class, which implements the methods used to create/update/delete content by throwing the proper exception.

Skip navigation links
ModeShape Distribution 5.0.0.Final

Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.