Class TdbCclCommand

  • All Implemented Interfaces:
    com.tietoenator.trip.jxp.internal.utils.DOMSink

    public class TdbCclCommand
    extends TdbMessageProvider
    implements com.tietoenator.trip.jxp.internal.utils.DOMSink
    CCL command executor and post processor
    • Constructor Summary

      Constructors 
      Constructor Description
      TdbCclCommand​(TdbSession session)
      Constructor, creates a blank instance ready for command execution
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkPoint()
      Set a checkpoint in the execution sequence to which the session can later be rolled-back.
      void execDirect​(java.lang.String command)
      Execute a CCL command.
      void execXPath​(java.lang.String xpathStatement)
      Execute a query in XPath syntax.
      TdbKernelWindow getAffectedWindow()
      If the command executed resulted in one of the kernel buffers being updated, this method will return the kernel window structure appropriate.
      TdbCclCommandType getCommandType()
      Retrieve the type of command executed, at a very broad level.
      java.lang.String getCurrentBase()
      Retrieve the currently open database name
      java.lang.String getCurrentThesaurusDef()
      Returns the definition string used for the currently defined thesaurus, or an empty string if no thesaurus is defined.
      java.lang.String getCurrentThesaurusName()
      Returns the name of the currently defined thesaurus, or an empty string if no thesaurus is defined.
      java.lang.String getDidYouMean()
      Returns a "did-you-mean" suggestion for the command just executed.
      java.lang.String getParsedCcl()
      Retrieve the parsed version of the command submitted
      TdbTermList getTermList()
      Retrieve the instance of TdbTermList that is being used to handle the results of non-hierarchical Display commands
      int getTermListTimeout()
      Get timeout for on-demand term lists generated by future DISPLAY commands..
      TdbTermTree getTermTree()
      Retrieve the instance of TdbTermTree that is being used to handle the results of hierarchical (i.e. thesaurus) Display commands
      boolean getUseOnDemandTermLists()
      Returns true if term lists created via this TdbCclCommand instance have values that are fetched on demand and are possible to use concurrently.
      java.util.List<TdbHistoryDetail> historyUpdates()
      If the command executed resulted in one or more history updates, this method will return an Iterator over a collection of detailed information, one entry for each history update.
      void mapKernelWindow​(TdbKernelWindow window)
      Maps a kernel window buffer to a local window structure, so that results generated by a CCL command are intercepted by the appropriate class instance.
      void rollbackToCheckPoint()
      Rollback the query session to a previously established check point Invoking this method causes network I/O.
      void setTermList​(TdbTermList terms)
      Establish the instance of TdbTermList that should be used to handle the results of non-hierarchical Display commands
      void setTermListTimeout​(int seconds)
      Set timeout for on-demand term lists generated by future DISPLAY commands.
      void setTermTree​(TdbTermTree tree)
      Establish the instance of TdbTermTree that should be used to handle the results of hierarchical (i.e. thesaurus) Display commands
      void setUseOnDemandTermLists​(boolean enable)
      Enable or disable the use of the on-demand term list feature.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TdbCclCommand

        public TdbCclCommand​(TdbSession session)
                      throws TdbException
        Constructor, creates a blank instance ready for command execution
        Parameters:
        session - Active session
        Throws:
        TdbException
    • Method Detail

      • getCommandType

        public TdbCclCommandType getCommandType()
        Retrieve the type of command executed, at a very broad level. The return code from this method is one of the manifest constants exposed by this class, e.g. CommandTypeHistory, etc. From this, the calling application can determine what further methods are appropriate to call in response to the execution of the command.
        Returns:
        The type of command executed
      • getDidYouMean

        public java.lang.String getDidYouMean()
        Returns a "did-you-mean" suggestion for the command just executed. This is an alternative CCL command that will yield a greater amount of hits. Only the FUZZ command can result in a did-you-mean suggestion, and requires TRIPsystem v6.2 or later in order to do so.
        Returns:
        An alternative CCL command or an empty string.
      • getCurrentThesaurusName

        public java.lang.String getCurrentThesaurusName()
        Returns the name of the currently defined thesaurus, or an empty string if no thesaurus is defined.

        At least one CCL command that has caused the thesaurus definition to change or generated a search set must have been issued using this TdbCclCommand instance before thesaurus information is available.

        This method requires TRIPsystem 8.0-2 or later.

      • getCurrentThesaurusDef

        public java.lang.String getCurrentThesaurusDef()
        Returns the definition string used for the currently defined thesaurus, or an empty string if no thesaurus is defined.

        At least one CCL command that has caused the thesaurus definition to change or generated a search set must have been issued using this TdbCclCommand instance before thesaurus information is available.

        This method requires TRIPsystem 8.0-2 or later.

      • getUseOnDemandTermLists

        public boolean getUseOnDemandTermLists()
        Returns true if term lists created via this TdbCclCommand instance have values that are fetched on demand and are possible to use concurrently.
        Returns:
        True if on-demand term lists are used.
        See Also:
        TdbTripFeature.OnDemandTermLists
      • setTermListTimeout

        public void setTermListTimeout​(int seconds)
        Set timeout for on-demand term lists generated by future DISPLAY commands.

        On-demand term lists requires resources on the server to keep alive. By default, they will time out in 120 seconds. After an on-demand term list has timed out, terms from it will no longer be possible to retrieve by the application without executing the DISPLAY order again.

        Although it isn't always a good practise to do so, the timeout can be disabled by setting this value to zero.

        Parameters:
        seconds - Timeout to set
        See Also:
        setUseOnDemandTermLists(boolean)
      • getTermListTimeout

        public int getTermListTimeout()
        Get timeout for on-demand term lists generated by future DISPLAY commands..

        On-demand term lists requires resources on the server to keep alive. By default, they will time out in 120 seconds. After an on-demand term list has timed out, terms from it will no longer be possible to retrieve by the application without executing the DISPLAY order again.

        Returns:
        Timeout in seconds, or zero if timeout has been disabled.
      • historyUpdates

        public java.util.List<TdbHistoryDetail> historyUpdates()
        If the command executed resulted in one or more history updates, this method will return an Iterator over a collection of detailed information, one entry for each history update.
        Returns:
        Collection of history updates
      • getAffectedWindow

        public TdbKernelWindow getAffectedWindow()
        If the command executed resulted in one of the kernel buffers being updated, this method will return the kernel window structure appropriate. If not, the last updated kernel window will be returned (or null if none such exists)
        Returns:
        The most recently affected output window
      • getCurrentBase

        public java.lang.String getCurrentBase()
        Retrieve the currently open database name
        Returns:
        Most recently opened database
      • getParsedCcl

        public java.lang.String getParsedCcl()
        Retrieve the parsed version of the command submitted
        Returns:
        The parsed version of the most recently submitted command; note that this may or may not be legal, as TRIPxpi will make an attempt to "reverse engineer" commands that have no specific parsed form
      • getTermList

        public TdbTermList getTermList()
        Retrieve the instance of TdbTermList that is being used to handle the results of non-hierarchical Display commands
        Returns:
        Term list handler
      • setTermList

        public void setTermList​(TdbTermList terms)
        Establish the instance of TdbTermList that should be used to handle the results of non-hierarchical Display commands
        Parameters:
        terms - Term list handler
      • getTermTree

        public TdbTermTree getTermTree()
        Retrieve the instance of TdbTermTree that is being used to handle the results of hierarchical (i.e. thesaurus) Display commands
        Returns:
        Term tree handler
      • setTermTree

        public void setTermTree​(TdbTermTree tree)
        Establish the instance of TdbTermTree that should be used to handle the results of hierarchical (i.e. thesaurus) Display commands
        Parameters:
        tree - Term tree handler
      • checkPoint

        public void checkPoint()
                        throws TdbException
        Set a checkpoint in the execution sequence to which the session can later be rolled-back. Invoking this method causes network I/O.
        Throws:
        TdbException
      • rollbackToCheckPoint

        public void rollbackToCheckPoint()
                                  throws TdbException
        Rollback the query session to a previously established check point Invoking this method causes network I/O.
        Throws:
        TdbException
      • mapKernelWindow

        public void mapKernelWindow​(TdbKernelWindow window)
                             throws TdbException
        Maps a kernel window buffer to a local window structure, so that results generated by a CCL command are intercepted by the appropriate class instance. Calling applications can maintain a number of kernel window structures and map them at any time, as long as they're mapped before executing a CCL command that affects the window type in question. Only one window of a given type can be mapped at any one time. Invoking this method causes network I/O.
        Parameters:
        window - A valid TdbKernelWindow reference
        Throws:
        TdbException
      • execDirect

        public void execDirect​(java.lang.String command)
                        throws TdbException
        Execute a CCL command. Invoking this method causes network I/O.
        Parameters:
        command - The command to be executed
        Throws:
        TdbException
      • execXPath

        public void execXPath​(java.lang.String xpathStatement)
                       throws TdbException
        Execute a query in XPath syntax. Requires that the current database is an XML database. Please refer to the TRIPxml documentation for information on valid XPath syntax for TRIP.

        Successful use of this method requires that the currently open database is an XML database and that the server to which the current session is connected runs TRIPsystem 6.2-7 or later and TRIPxml 3.0 or later.

        Invoking this method causes network I/O.

        Parameters:
        xpathStatement - The XPath statement to be executed as a query.
        Throws:
        TdbException