Package com.tietoenator.trip.jxp.ccl

# Class TdbCclCommand

java.lang.Object
com.tietoenator.trip.jxp.session.TdbSessionObject
com.tietoenator.trip.jxp.TdbMessageProvider
com.tietoenator.trip.jxp.ccl.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

  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(String command)`
  Execute a CCL command.
  `void`
  `execXPath(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.
  `String`
  `getCurrentBase()`
  Retrieve the currently open database name
  `String`
  `getCurrentThesaurusDef()`
  Returns the definition string used for the currently defined thesaurus, or an empty string if no thesaurus is defined.
  `String`
  `getCurrentThesaurusName()`
  Returns the name of the currently defined thesaurus, or an empty string if no thesaurus is defined.
  `String`
  `getDidYouMean()`
  Returns a "did-you-mean" suggestion for the command just executed.
  `boolean`
  `getHistoryDelta()`
  For commands that may result in more than one search set, indicates if all resulting sets are returned as TdbHistoryDetail instances instead of just the latest one.
  `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.
  `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`
  `setHistoryDelta(boolean enable)`
  For commands that may result in more than one search set, request that all resulting sets are returned as TdbHistoryDetail instances instead of just the latest one.
  `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 com.tietoenator.trip.jxp.TdbMessageProvider

  `codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages`

  ### Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject

  `cancel, getSession, isCancelable, setCancelable`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TdbCclCommand

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

- ## Method Details

  - ### 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 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 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 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`

  - ### setUseOnDemandTermLists

    public void setUseOnDemandTermLists(boolean enable) throws TdbException
    Enable or disable the use of the on-demand term list feature.
    Parameters:
      `enable` - True to use on-demand term lists
    Throws:
      `TdbException` - If on-demand term lists cannot be enabled
    See Also:
      - `TdbTripFeature.OnDemandTermLists`
      - `setTermListTimeout(int)`

  - ### 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 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 String getCurrentBase()
    Retrieve the currently open database name
    Returns:
      Most recently opened database

  - ### getParsedCcl

    public 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

  - ### setHistoryDelta

    public void setHistoryDelta(boolean enable)
    For commands that may result in more than one search set, request that all resulting sets are returned as TdbHistoryDetail instances instead of just the latest one.

    Requires TRIPsystem 8.2-3 or later

    Parameters:
      `enable` - Enable or disable retrieval of search history deltas.
    Since:
      8.2-2

  - ### getHistoryDelta

    public boolean getHistoryDelta()
    For commands that may result in more than one search set, indicates if all resulting sets are returned as TdbHistoryDetail instances instead of just the latest one.

    Requires TRIPsystem 8.2-3 or later

    Returns:
      True if history deltas are to be returned and false otherwise.
    Since:
      8.2-2

  - ### 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(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(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`