org.jboss.dna.connector.federation.executor
Class SingleProjectionCommandExecutor

java.lang.Object
  extended by org.jboss.dna.graph.commands.executor.AbstractCommandExecutor
      extended by org.jboss.dna.connector.federation.executor.SingleProjectionCommandExecutor
All Implemented Interfaces:
CommandExecutor

@NotThreadSafe
public class SingleProjectionCommandExecutor
extends AbstractCommandExecutor

Author:
Randall Hauch

Constructor Summary
SingleProjectionCommandExecutor(ExecutionContext context, String sourceName, DateTime now, Projection projection, RepositoryConnectionFactory connectionFactory)
           
SingleProjectionCommandExecutor(ExecutionContext context, String sourceName, Projection projection, RepositoryConnectionFactory connectionFactory)
           
 
Method Summary
 void close()
          Close this executor, allowing it to clean up any open resources.
 void execute(CopyBranchCommand command)
          Execute a command to copy an entire branch to a new location.
 void execute(CopyNodeCommand command)
          Execute a command to copy a node to a new location.
 void execute(CreateNodeCommand command)
          Execute a command to create a node and set the node's properties.
 void execute(DeleteBranchCommand command)
          Execute a command to delete an entire branch.
 void execute(GetChildrenCommand command)
          Execute a command to get the children of a node.
 void execute(GetNodeCommand command)
          Execute a command to get the properties and children of a node. GetNodeCommand is a subtype of both GetPropertiesCommand and GetChildrenCommand, so this method will be called in place of the CommandExecutor.execute(GetPropertiesCommand) and CommandExecutor.execute(GetChildrenCommand) methods.

This method implementation simply delegates to both the AbstractCommandExecutor.execute(GetPropertiesCommand) and AbstractCommandExecutor.execute(GetChildrenCommand) methods, and should be overridden by subclasses that can process GetNodeCommand more efficiently as a single command.

 void execute(GetPropertiesCommand command)
          Execute a command to get the properties of a node.
 void execute(MoveBranchCommand command)
          Execute a command to move a branch from one location to another.
 void execute(RecordBranchCommand command)
          Execute a command to record the structure of a branch.
 void execute(SetPropertiesCommand command)
          Execute a command to set some (or all) of the properties on a node.
 
Methods inherited from class org.jboss.dna.graph.commands.executor.AbstractCommandExecutor
execute, execute, getCurrentTimeInUtc, getExecutionContext, getSourceName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleProjectionCommandExecutor

public SingleProjectionCommandExecutor(ExecutionContext context,
                                       String sourceName,
                                       Projection projection,
                                       RepositoryConnectionFactory connectionFactory)
Parameters:
context - the execution context in which the executor will be run; may not be null
sourceName - the name of the RepositorySource that is making use of this executor; may not be null or empty
projection - the projection used for the cached information; may not be null and must have exactly one rule
connectionFactory - the factory for RepositoryConnection instances

SingleProjectionCommandExecutor

public SingleProjectionCommandExecutor(ExecutionContext context,
                                       String sourceName,
                                       DateTime now,
                                       Projection projection,
                                       RepositoryConnectionFactory connectionFactory)
Parameters:
context - the execution context in which the executor will be run; may not be null
sourceName - the name of the RepositorySource that is making use of this executor; may not be null or empty
now - the current time; may be null if the system time is to be used
projection - the projection used for the cached information; may not be null and must have exactly one rule
connectionFactory - the factory for RepositoryConnection instances
Method Detail

close

public void close()
Close this executor, allowing it to clean up any open resources.

Specified by:
close in interface CommandExecutor
Overrides:
close in class AbstractCommandExecutor
See Also:
AbstractCommandExecutor.close()

execute

public void execute(GetChildrenCommand command)
             throws RepositorySourceException
Execute a command to get the children of a node.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetChildrenCommand)

execute

public void execute(GetPropertiesCommand command)
             throws RepositorySourceException
Execute a command to get the properties of a node.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetPropertiesCommand)

execute

public void execute(GetNodeCommand command)
             throws RepositorySourceException
Execute a command to get the properties and children of a node. GetNodeCommand is a subtype of both GetPropertiesCommand and GetChildrenCommand, so this method will be called in place of the CommandExecutor.execute(GetPropertiesCommand) and CommandExecutor.execute(GetChildrenCommand) methods.

This method implementation simply delegates to both the AbstractCommandExecutor.execute(GetPropertiesCommand) and AbstractCommandExecutor.execute(GetChildrenCommand) methods, and should be overridden by subclasses that can process GetNodeCommand more efficiently as a single command.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.GetNodeCommand)

execute

public void execute(CreateNodeCommand command)
             throws RepositorySourceException
Execute a command to create a node and set the node's properties.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.CreateNodeCommand)

execute

public void execute(SetPropertiesCommand command)
             throws RepositorySourceException
Execute a command to set some (or all) of the properties on a node.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.SetPropertiesCommand)

execute

public void execute(DeleteBranchCommand command)
             throws RepositorySourceException
Execute a command to delete an entire branch.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.DeleteBranchCommand)

execute

public void execute(MoveBranchCommand command)
             throws RepositorySourceException
Execute a command to move a branch from one location to another.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.MoveBranchCommand)

execute

public void execute(RecordBranchCommand command)
             throws RepositorySourceException
Execute a command to record the structure of a branch.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.RecordBranchCommand)

execute

public void execute(CopyBranchCommand command)
             throws RepositorySourceException
Execute a command to copy an entire branch to a new location.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.CopyBranchCommand)

execute

public void execute(CopyNodeCommand command)
             throws RepositorySourceException
Execute a command to copy a node to a new location.

Specified by:
execute in interface CommandExecutor
Overrides:
execute in class AbstractCommandExecutor
Parameters:
command - the command to be executed; may not be null
Throws:
RepositorySourceException - if there is an error executing the command
See Also:
AbstractCommandExecutor.execute(org.jboss.dna.graph.commands.CopyNodeCommand)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.