Class DBTable

java.lang.Object
overit.geocall.sql.DBTable
All Implemented Interfaces:
Serializable

public class DBTable extends Object implements Serializable
This class implements the object that defines a DataBase table.
See Also:
  • Field Details

  • Constructor Details

    • DBTable

      public DBTable(String pool, String table, Long factory)
      Main constructor for DBTable
      Parameters:
      pool - The pool
      table - The table
      factory - The factory
  • Method Details

    • usingCache

      public static boolean usingCache()
      Returns true if is using the cache, false otherwise
      Returns:
      true if is using the cache, false otherwise
    • useCache

      public static void useCache(boolean usecache)
      Sets the use cache capability
      Parameters:
      usecache - Boolean value indicating if use cache capability should be enabled
    • getTableKey

      protected static String getTableKey(String pool, String table, Long factory)
      Returns the table key
      Parameters:
      pool - The pool
      table - The table
      factory - The factory
      Returns:
      A string containing the table key
    • getDBTable

      public static DBTable getDBTable(String pool, String table, Long factory)
      Returns the DBTable
      Parameters:
      pool - The pool
      table - The table
      factory - The factory
      Returns:
      The DBTable
    • clearTables

      public static void clearTables(boolean forward)
      Clears all the tables
      Parameters:
      forward - Boolean values that indicate if the Invalidation message should be sent to all the tables and Nodes of the Cluster
    • clearTables

      public static void clearTables(String pool, String table, Long factory)
      Clears all the tables and send the Invalidation message to all the tables and Nodes of the Cluster
      Parameters:
      pool - The pool
      table - The table
      factory - The factory
    • clearTables

      public static void clearTables(String pool, String table, Long factory, boolean forward)
      Clears all the tables
      Parameters:
      pool - The pool
      table - The table
      factory - The factory
      forward - Boolean values that indicate if the Invalidation message should be sent to all the tables and Nodes of the Cluster
    • clearCache

      protected void clearCache()
    • getTablesDBView

      public static DBView getTablesDBView()
      Returns the tables DBView
      Returns:
      The tables DBView
    • getLoadAfter

      public long getLoadAfter()
      Returns the load after value
      Returns:
      The load after value
    • getTableName

      public String getTableName()
      Returns the table name
      Returns:
      The table name
    • getPoolName

      public String getPoolName()
      Returns the pool name
      Returns:
      The pool name
    • getFactory

      public Long getFactory()
      Returns the factory
      Returns:
      The factory
    • getCacheElement

      public DBView getCacheElement(String key, BiFunction<? super String,? super DBView,? extends DBView> computation)
      Returns the chache element associated to the key
      Parameters:
      key - The key used to get the cache element
      computation - the function used to test and accept or test and recreate the correct map value to be returned
      Returns:
      THe cache element
    • getCacheElement

      public DBView getCacheElement(String key)
      Returns the chache element associated to the key
      Parameters:
      key - The key used to get the cache element
      Returns:
      THe cache element
    • setCacheElement

      @Deprecated public void setCacheElement(String key, Object object)
      Deprecated.
      Sets the cache element
      Parameters:
      key - The key associated to the object
      object - The object
    • getCacheSize

      public int getCacheSize()
      Returns the cache size
      Returns:
      The cache size
    • getCacheDBView

      public DBView getCacheDBView()
      Returns the cache DBView
      Returns:
      The DBView