|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.graph.commands.executor.AbstractCommandExecutor
org.jboss.dna.connector.federation.executor.FederatingCommandExecutor
@NotThreadSafe public class FederatingCommandExecutor
| Constructor Summary | |
|---|---|
FederatingCommandExecutor(org.jboss.dna.graph.ExecutionContext context,
String sourceName,
List<Projection> sourceProjections,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory connectionFactory)
Create a command executor that federates (merges) the information from multiple sources described by the source projections. |
|
FederatingCommandExecutor(org.jboss.dna.graph.ExecutionContext context,
String sourceName,
Projection cacheProjection,
org.jboss.dna.graph.cache.CachePolicy defaultCachePolicy,
List<Projection> sourceProjections,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory connectionFactory)
Create a command executor that federates (merges) the information from multiple sources described by the source projections. |
|
| Method Summary | |
|---|---|
void |
close()
|
protected FederatedNode |
createFederatedNode(org.jboss.dna.graph.commands.basic.BasicGetNodeCommand fromCache,
org.jboss.dna.graph.properties.Path path,
List<Contribution> contributions,
boolean updateCache)
|
void |
execute(org.jboss.dna.graph.commands.GetChildrenCommand command)
|
void |
execute(org.jboss.dna.graph.commands.GetNodeCommand command)
This class overrides the default behavior and instead processes the
command in a more efficient manner. |
void |
execute(org.jboss.dna.graph.commands.GetPropertiesCommand command)
|
Projection |
getCacheProjection()
Get the projection defining the cache. |
protected org.jboss.dna.graph.connectors.RepositoryConnection |
getConnection(Projection projection)
|
protected org.jboss.dna.graph.connectors.RepositoryConnection |
getConnectionToCache()
|
protected MergePlan |
getMergePlan(org.jboss.dna.graph.commands.basic.BasicGetNodeCommand command)
|
protected org.jboss.dna.graph.commands.basic.BasicGetNodeCommand |
getNode(org.jboss.dna.graph.properties.Path path)
Get the node information from the underlying sources or, if possible, from the cache. |
protected Set<String> |
getOpenConnections()
|
List<Projection> |
getSourceProjections()
Get an unmodifiable list of the immutable source projections. |
protected void |
loadContributionsFromSources(org.jboss.dna.graph.properties.Path path,
Set<String> sourceNames,
List<Contribution> contributions)
Load the node at the supplied path from the sources with the supplied name, returning the information. |
void |
setMergingStrategy(MergeStrategy mergingStrategy)
|
protected void |
updateCache(FederatedNode mergedNode)
|
| Methods inherited from class org.jboss.dna.graph.commands.executor.AbstractCommandExecutor |
|---|
execute, execute, execute, execute, execute, execute, execute, execute, execute, getCurrentTimeInUtc, getExecutionContext, getSourceName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FederatingCommandExecutor(org.jboss.dna.graph.ExecutionContext context,
String sourceName,
List<Projection> sourceProjections,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory connectionFactory)
constructor that takes a cache projection.
context - the execution context in which the executor will be run; may not be nullsourceName - the name of the RepositorySource that is making use of this executor; may not be null or emptysourceProjections - the source projections; may not be nullconnectionFactory - the factory for RepositoryConnection instances
public FederatingCommandExecutor(org.jboss.dna.graph.ExecutionContext context,
String sourceName,
Projection cacheProjection,
org.jboss.dna.graph.cache.CachePolicy defaultCachePolicy,
List<Projection> sourceProjections,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory connectionFactory)
cache projection to identify the
repository source for the cache as well as the rules for
how the paths are mapped in the cache. This cache will be consulted first for the requested information, and will be kept
up to date as changes are made to the federated information.
context - the execution context in which the executor will be run; may not be nullsourceName - the name of the RepositorySource that is making use of this executor; may not be null or emptycacheProjection - the projection used for the cached information; may be null if there is no cachedefaultCachePolicy - the default caching policy that outlines the length of time that information should be cached, or
null if there is no cache or no specific cache policysourceProjections - the source projections; may not be nullconnectionFactory - the factory for RepositoryConnection instances| Method Detail |
|---|
public void setMergingStrategy(MergeStrategy mergingStrategy)
mergingStrategy - Sets mergingStrategy to the specified value.public List<Projection> getSourceProjections()
public Projection getCacheProjection()
public void close()
close in interface org.jboss.dna.graph.commands.executor.CommandExecutorclose in class org.jboss.dna.graph.commands.executor.AbstractCommandExecutorAbstractCommandExecutor.close()
protected org.jboss.dna.graph.connectors.RepositoryConnection getConnectionToCache()
throws org.jboss.dna.graph.connectors.RepositorySourceException
org.jboss.dna.graph.connectors.RepositorySourceException
protected org.jboss.dna.graph.connectors.RepositoryConnection getConnection(Projection projection)
throws org.jboss.dna.graph.connectors.RepositorySourceException
org.jboss.dna.graph.connectors.RepositorySourceExceptionprotected Set<String> getOpenConnections()
public void execute(org.jboss.dna.graph.commands.GetNodeCommand command)
throws org.jboss.dna.graph.connectors.RepositorySourceException
This class overrides the default behavior and instead processes the
command in a more efficient manner.
execute in interface org.jboss.dna.graph.commands.executor.CommandExecutorexecute in class org.jboss.dna.graph.commands.executor.AbstractCommandExecutororg.jboss.dna.graph.connectors.RepositorySourceExceptionAbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetNodeCommand)
public void execute(org.jboss.dna.graph.commands.GetPropertiesCommand command)
throws org.jboss.dna.graph.connectors.RepositorySourceException
execute in interface org.jboss.dna.graph.commands.executor.CommandExecutorexecute in class org.jboss.dna.graph.commands.executor.AbstractCommandExecutororg.jboss.dna.graph.connectors.RepositorySourceExceptionAbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetPropertiesCommand)
public void execute(org.jboss.dna.graph.commands.GetChildrenCommand command)
throws org.jboss.dna.graph.connectors.RepositorySourceException
execute in interface org.jboss.dna.graph.commands.executor.CommandExecutorexecute in class org.jboss.dna.graph.commands.executor.AbstractCommandExecutororg.jboss.dna.graph.connectors.RepositorySourceExceptionAbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetChildrenCommand)
protected org.jboss.dna.graph.commands.basic.BasicGetNodeCommand getNode(org.jboss.dna.graph.properties.Path path)
throws org.jboss.dna.graph.connectors.RepositorySourceException
path - the path of the node to be returned
org.jboss.dna.graph.connectors.RepositorySourceException
protected FederatedNode createFederatedNode(org.jboss.dna.graph.commands.basic.BasicGetNodeCommand fromCache,
org.jboss.dna.graph.properties.Path path,
List<Contribution> contributions,
boolean updateCache)
throws org.jboss.dna.graph.connectors.RepositorySourceException
org.jboss.dna.graph.connectors.RepositorySourceException
protected void loadContributionsFromSources(org.jboss.dna.graph.properties.Path path,
Set<String> sourceNames,
List<Contribution> contributions)
throws org.jboss.dna.graph.connectors.RepositorySourceException
path - the path of the node that is to be loadedsourceNames - the names of the sources from which contributions are to be loaded; may be empty or null if all
contributions from all sources are to be loadedcontributions - the list into which the contributions are to be placed
org.jboss.dna.graph.connectors.RepositorySourceExceptionprotected MergePlan getMergePlan(org.jboss.dna.graph.commands.basic.BasicGetNodeCommand command)
protected void updateCache(FederatedNode mergedNode)
throws org.jboss.dna.graph.connectors.RepositorySourceException
org.jboss.dna.graph.connectors.RepositorySourceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||