Class SourceStatementBuilder.SourceStatement

    • Field Detail

      • f_sFileName

        protected final String f_sFileName
        The file name to be used in the CohQL "source" command.
    • Constructor Detail

      • SourceStatement

        public SourceStatement​(String sFileName)
        Construct a SourceStatement that will execute commands from the specified file.
        Parameters:
        sFileName - the file of commands to execute
    • Method Detail

      • execute

        public StatementResult execute​(ExecutionContext ctx)
        Description copied from interface: Statement
        Execute a CohQL query or command and return the relevant result.
        Parameters:
        ctx - the context to use
        Returns:
        a StatementResult containing the results of executing the statement
      • showPlan

        public void showPlan​(PrintWriter out)
        Description copied from interface: Statement
        Output to the provided PrintWriter a human readable trace of the actions that will be taken by this statement if or when executed.
        Parameters:
        out - the PrintWriter to write the trace to
      • isManagingTimeout

        public boolean isManagingTimeout()
        Description copied from interface: Statement
        Obtain a flag indicating whether this Statement will manage its own timeout handling.
        Returns:
        true if this Statement manages timeout handling or false if the StatementExecutor should manage timeouts.
      • source

        public StatementResult source​(String sFileName,
                                      ExecutionContext ctx)
        Attempt to parse, build, and execute from the given file of statements tracing on the given PrintWriter if the given flag indicates the need to trace.
        Parameters:
        sFileName - a String representing a filename to process
        ctx - the ExecutionContext to use to execute statements
        Returns:
        the StatementResult resulting form the last statement to be processed in the set of statements from the file
      • traceout

        protected void traceout​(String sLine,
                                PrintWriter writer,
                                boolean fTrace)
        Write the given line on the give PrintWriter if the trace flag is true.
        Parameters:
        sLine - a String to be displayed
        writer - a PrintWriter to write upon
        fTrace - a flag indicating whether to trace