class ScriptExecutionCommand extends AbstractCclCommand {

    @Override
    public void run(final CclCommandTerminal terminal) {
        final EtmPoint point = PointFactory.getPoint(getClass(), "run");
        try {
            final Collection<String> declarations = getRecordStructureDeclarations();
            final Collection<String> setters = getRecordStructureSetterCommands();
            final Collection<String> executionCommands = builder.build();
            final Collection<RecordDataExtractor> extractors = getDataExtractors();

            /*
             * Create a command queue that is the sum of all objects to be executed
             */
            final List<String> commandQueue = new ArrayList<String>(executionCommands.size() + 3 * extractors.size());
            commandQueue.addAll(declarations);
            commandQueue.addAll(setters);
            commandQueue.addAll(executionCommands);
            for (final RecordDataExtractor extractor : extractors)
                commandQueue.addAll(extractor.getExtractionCommands());

            try {
                terminal.executeCommands(new JSchSshTerminal(), commandQueue, authenticate);
            } catch (final SshException e) {
                throw new CclCommandException("Execution of script " + builder.getScriptName() + " failed.", e);
            }

            for (final RecordDataExtractor extractor : extractors)
                try {
                    extractor.extractRecordData();
                } catch (final IOException e) {
                    throw new CclCommandException(String.format("Failed to extract record data for record %s.",
                            extractor.getRecord().getName()), e);
                }
        } finally {
            point.collect();
        }
    }

    public  ScriptExecutionCommand(final String scriptName, final List<Argument> arguments, final boolean authenticate);
    public  ScriptExecutionCommand(final ScriptExecutionBuilder executionBuilder, final boolean authenticate);

}