Class AbstractStatement

    • Constructor Detail

      • AbstractStatement

        public AbstractStatement()
    • Method Detail

      • sanityCheck

        public void sanityCheck​(ExecutionContext ctx)
        Description copied from interface: Statement
        Perform sanity checks on the statement that will be executed.

        Implementations can fail sanity checking by throwing an unchecked exception (RuntimeException).

        Specified by:
        sanityCheck in interface Statement
        Parameters:
        ctx - the context to use
      • getExecutionConfirmation

        public String getExecutionConfirmation​(ExecutionContext ctx)
        Description copied from interface: Statement
        Return a string that will be used as a question to confirm execution of a statement. If null is returned then no confirmation is required.
        Specified by:
        getExecutionConfirmation in interface Statement
        Parameters:
        ctx - the context to use
        Returns:
        a String that will be used to confirm execution of a statement
      • assertCacheName

        protected void assertCacheName​(String sName,
                                       ExecutionContext ctx)
        Test to see whether the given String is a known cache name.
        Parameters:
        sName - the cache name
        ctx - the execution context of the CohQL query
        Throws:
        AssertionError - if a cache with the given name does not exist.