com.tietoenator.trip.jxp.session

## Class TdbControlCacheManager

- java.lang.Object
- - com.tietoenator.trip.jxp.session.TdbSessionObject
  - - com.tietoenator.trip.jxp.session.TdbControlCacheManager

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

      public class TdbControlCacheManager
      extends TdbSessionObject
      implements com.tietoenator.trip.jxp.internal.utils.DOMSink

  Manager class for locally cached CONTROL database objects such as database designs.

  Applicatons will normally request database design information with a high frequency, either explicitly or implicitly. The cache manager keeps such information locally when possible in order to keep network I/O to a minimum, boosting performance over time.

  Since:
    TRIPjxp 8.2-3

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears the cache so that any subsequent retrieval of objects via this TdbControlCacheManager instance will result in requesting fresh versions from the server.
    `boolean` | `getCacheThesaurusDesigns()` Checks if thesaurus designs should be cached.
    `TdbDatabaseClusterDesign` | `getClusterDesign(java.lang.String name)` Get the design for the named database cluster.
    `java.util.List<java.lang.String>` | `getClusterNames()` Get a read-only list with the names of the database clusters the current user has some kind of access to.
    `TdbDatabaseAccess` | `getDatabaseAccess(java.lang.String database)` Get the current user's access rights to the named database.
    `TdbControlObject` | `getDatabaseControlObject(java.lang.String database)` Get the TdbControlObject that briefly describe the named database.
    `TdbDatabaseDesign` | `getDatabaseDesign(java.lang.String name)` Get the design for the named database.
    `TdbDatabaseList` | `getDatabaseList()` Get the list of databases that the current user has some access to.
    `java.util.List<java.lang.String>` | `getDatabaseNames()` Get a read-only list with the names of the databases the current user has some kind of access to.
    `TdbOutputFormatList` | `getOutputFormats(java.lang.String database)` Get a list of the output formats associated with the specified datbase.
    `TdbProcedureList` | `getProcedureList()` Get a list of procedures owned by the currently logged on user.
    `TdbProcedureList` | `getProcedureList(boolean reload)` Get a list of procedures owned by the currently logged on user.
    `boolean` | `getResolveClusters()` Checks if database cluster designs with nested clusters will be fully be resolved into their constituent member databases when retrieved.
    `java.util.List<java.lang.String>` | `getThesaurusNames()` Get a read-only list with the names of the thesauri the current user has some kind of access to.
    `void` | `load()` Loads data into the cache using bulk loading when available.
    `void` | `load(boolean bulkload)` LOads data into the cache with optional bulk loading behavior.
    `void` | `setCacheThesaurusDesigns(boolean enable)` Determines if thesaurus designs should be cached.
    `void` | `setResolveClusters(boolean resolve)` Determines if database cluster designs with nested clusters should be fully be resolved into their constituent member databases when retrieved.

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

    - ### Methods inherited from interface com.tietoenator.trip.jxp.internal.utils.DOMSink

      `sinkNode`

- - ### Method Detail

    - #### clear

          public void clear()

      Clears the cache so that any subsequent retrieval of objects via this TdbControlCacheManager instance will result in requesting fresh versions from the server.

    - #### load

          public void load(boolean bulkload)
                    throws TdbException

      LOads data into the cache with optional bulk loading behavior.

      Applications that use CONTROL database objects intensively should preload the cache. When using TRIPsystem 8.2-4 or later, preloading is more effcient due to support for bulk retrieval of database designs instead of requesting each design individually.

      When calling this method more than once in the same session, additional calls will result in a full reload. Such reloads are generally only needed if new CONTROL objects have been created during the course of the session that must be used immediatey by the application. For applications that do not manipulate CONTROL object such as database designs, calling this method once per session is enough.

      Parameters:
        `bulkload` - Set to true to use bulk loading of designs if available.
      Throws:
        `TdbException` - If the preload operation failed to retrieve data from the server.

    - #### load

          public void load()
                    throws TdbException

      Loads data into the cache using bulk loading when available.

      Applications that use CONTROL database objects intensively should preload the cache. When using TRIPsystem 8.2-4 or later, preloading is more effcient due to support for bulk retrieval of database designs instead of requesting each design individually.

      When calling this method more than once in the same session, additional calls will result in a full reload. Such reloads are generally only needed if new CONTROL objects have been created during the course of the session that must be used immediatey by the application. For applications that do not manipulate CONTROL object such as database designs, calling this method once per session is enough.

      Throws:
        `TdbException` - If the preload operation failed to retrieve data from the server.

    - #### setResolveClusters

          public void setResolveClusters(boolean resolve)

      Determines if database cluster designs with nested clusters should be fully be resolved into their constituent member databases when retrieved.

      A fully resolved cluster that contains other clusters as members is not usable for cluster administration. However, for applications that need to know what all indivdual databases in a cluster are, using resolved clusters is highly recommended.

      The default setting is true, i.e. to fetch cluster designs as fully resolved.

    - #### getResolveClusters

          public boolean getResolveClusters()

      Checks if database cluster designs with nested clusters will be fully be resolved into their constituent member databases when retrieved.

      A fully resolved cluster that contains other clusters as members is not usable for cluster administration. However, for applications that need to know what all indivdual databases in a cluster are, using resolved clusters is highly recommended.

      The default setting is true, i.e. to fetch cluster designs as fully resolved.

    - #### setCacheThesaurusDesigns

          public void setCacheThesaurusDesigns(boolean enable)

      Determines if thesaurus designs should be cached.

      Default is false. If enabled, the database designs of thesauri are available as database designs.

    - #### getCacheThesaurusDesigns

          public boolean getCacheThesaurusDesigns()

      Checks if thesaurus designs should be cached.

      Default is false. If enabled, the database designs of thesauri are available as database designs.

    - #### getDatabaseList

          public TdbDatabaseList getDatabaseList()
                                          throws TdbException

      Get the list of databases that the current user has some access to.

      The list will be returned from the cache if it is already loaded. If the database list isn't found in the cache, it will first be retrieved from the server into the cache.

      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getDatabaseNames

          public java.util.List<java.lang.String> getDatabaseNames()
                                                            throws TdbException

      Get a read-only list with the names of the databases the current user has some kind of access to.

      The list will be returned from the cache if the database list is already loaded. If the database list isn't found in the cache, it will first be retrieved from the server into the cache.

      Returns:
        List of database names
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getThesaurusNames

          public java.util.List<java.lang.String> getThesaurusNames()
                                                             throws TdbException

      Get a read-only list with the names of the thesauri the current user has some kind of access to.

      The list will be returned from the cache if the database list is already loaded. If the database list isn't found in the cache, it will first be retrieved from the server into the cache.

      Returns:
        List of thesaurus names
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getClusterNames

          public java.util.List<java.lang.String> getClusterNames()
                                                           throws TdbException

      Get a read-only list with the names of the database clusters the current user has some kind of access to.

      The list will be returned from the cache if the database list is already loaded. If the database list isn't found in the cache, it will first be retrieved from the server into the cache.

      Returns:
        List of cluster names
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getDatabaseControlObject

          public TdbControlObject getDatabaseControlObject(java.lang.String database)
                                                    throws TdbException

      Get the TdbControlObject that briefly describe the named database.

      This operation will only result in a request to TRIPsystem if the database list has not yet been cached.

      Returns:
        A TdbControlObject matching the named database, or null if not found.
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getDatabaseAccess

          public TdbDatabaseAccess getDatabaseAccess(java.lang.String database)
                                              throws TdbException

      Get the current user's access rights to the named database.

      This operation will only result in a request to TRIPsystem if the database list or the access rights for the database has not yet been cached.

      Returns:
        A TdbDatabaseAccess object, or null if user has no access to the database.
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getDatabaseDesign

          public TdbDatabaseDesign getDatabaseDesign(java.lang.String name)
                                              throws TdbException

      Get the design for the named database.

      This operation will only result in a request to TRIPsystem if the database list or the design for database has not yet been cached.

      Returns:
        A TdbDatabaseDesign object, or null if the design does not exist or the user has no access to the database.
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.

    - #### getClusterDesign

          public TdbDatabaseClusterDesign getClusterDesign(java.lang.String name)
                                                    throws TdbException

      Get the design for the named database cluster.

      This operation will only result in a request to TRIPsystem if the database list or the design for database has not yet been cached.

      Returns:
        A TdbDatabaseClusterDesign object, or null if the design does not exist or the user has no access to the database.
      Throws:
        `TdbException` - If the operation failed to retrieve data from the server.
      See Also:
        `TdbControlCacheManager.getResolveClusters()`, `TdbControlCacheManager.setResolveClusters(boolean)`

    - #### getOutputFormats

          public TdbOutputFormatList getOutputFormats(java.lang.String database)
                                               throws TdbException

      Get a list of the output formats associated with the specified datbase. Returns the list from the cache if found there, otherwise the list is retrieved from the server.
      Returns:
        A TdbOutputFormatList object
      Throws:
        `TdbException` - If the operation failed to retrieve the list from the server

    - #### getProcedureList

          public TdbProcedureList getProcedureList(boolean reload)
                                            throws TdbException

      Get a list of procedures owned by the currently logged on user.

      The list will be retrieved from the server if not already cached or if the reload parameter is set to true. Otherwise, the list will be returned from the cache.

      Setting the reload parameter to true will force the cache manager to reload the list, even if previously cached. Reloading can be useful in a scenario where a procedure has been created for the user in the same session, and that procedure must immediately become available in the procedure list.

      Parameters:
        `reload` - Pass true to reload the list from the server
      Returns:
        A TdbProcedureList object
      Throws:
        `TdbException` - If the operation failed to retrieve the list from the server

    - #### getProcedureList

          public TdbProcedureList getProcedureList()
                                            throws TdbException

      Get a list of procedures owned by the currently logged on user. Returns the list from the cache if found there, otherwise the list is retrieved from the server.
      Returns:
        A TdbProcedureList object
      Throws:
        `TdbException` - If the operation failed to retrieve the list from the server