com.tibco.datagrid

## Class DataGrid

- java.lang.Object
- - com.tibco.datagrid.DataGrid

-     public class DataGrid
      extends java.lang.Object

  The class DataGrid is the first entry point of an ActiveSpaces client program. This class initializes an ActiveSpaces client within your program, including threads and global data structures

  Programs use it to create `Connection` and to set log levels.

  Programs do not instantiate this class.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `TIB_LOG_LEVEL_DEBUG` Debug -- output trace entries for all events (debug, verbose, information, warning and severe events).
    `static java.lang.String` | `TIB_LOG_LEVEL_INFO` Info -- output trace entries for information, warning and severe events.
    `static java.lang.String` | `TIB_LOG_LEVEL_OFF` Off -- disable all tracing.
    `static java.lang.String` | `TIB_LOG_LEVEL_SEVERE` Severe -- output trace entries only for severe events.
    `static java.lang.String` | `TIB_LOG_LEVEL_VERBOSE` Verbose -- output trace entries for verbose, information, warning and severe events.
    `static java.lang.String` | `TIB_LOG_LEVEL_WARN` Warn -- output trace entries for warning and severe events.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Connection` | `connect(java.lang.String realmURL, java.lang.String gridName, java.util.Properties props)` Connect to a ActiveSpaces data grid, and create a Connection object.
    `static java.lang.String` | `getVersionInformation()` Version of the ActiveSpaces Java client library (Java archive file).
    `static void` | `setLogFiles(java.lang.String filePrefix, long maxFileSize, int maxFiles, java.util.Properties properties)` Arrange rotating log files.
    `static void` | `setLogHandler(LogHandler handler, java.util.Properties properties)` Register a global log handler.
    `static void` | `setLogLevel(java.lang.String level)` Set the ActiveSpaces log trace level.

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

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

- - ### Field Detail

    - #### TIB_LOG_LEVEL_OFF

          public static final java.lang.String TIB_LOG_LEVEL_OFF

      Off -- disable all tracing.
      See Also:
        `setLogLevel`, Constant Field Values

    - #### TIB_LOG_LEVEL_SEVERE

          public static final java.lang.String TIB_LOG_LEVEL_SEVERE

      Severe -- output trace entries only for severe events.
      See Also:
        `setLogLevel`, Constant Field Values

    - #### TIB_LOG_LEVEL_WARN

          public static final java.lang.String TIB_LOG_LEVEL_WARN

      Warn -- output trace entries for warning and severe events.
      See Also:
        `setLogLevel`, Constant Field Values

    - #### TIB_LOG_LEVEL_INFO

          public static final java.lang.String TIB_LOG_LEVEL_INFO

      Info -- output trace entries for information, warning and severe events.
      See Also:
        `setLogLevel`, Constant Field Values

    - #### TIB_LOG_LEVEL_VERBOSE

          public static final java.lang.String TIB_LOG_LEVEL_VERBOSE

      Verbose -- output trace entries for verbose, information, warning and severe events.
      See Also:
        `setLogLevel`, Constant Field Values

    - #### TIB_LOG_LEVEL_DEBUG

          public static final java.lang.String TIB_LOG_LEVEL_DEBUG

      Debug -- output trace entries for all events (debug, verbose, information, warning and severe events).
      See Also:
        `setLogLevel`, Constant Field Values

  - ### Method Detail

    - #### connect

          public static Connection connect(java.lang.String realmURL,
                                           java.lang.String gridName,
                                           java.util.Properties props)
                                    throws DataGridException

      Connect to a ActiveSpaces data grid, and create a Connection object.
      Parameters:
        `realmURL` - The URL to use for getting FTL realm server information.
        `gridName` - The gridName identifies the data grid to which this call connects. Passing \c NULL selects the default data grid (which is named "_default").
        `props` - Optional, null to omit
        - `Connection.TIBDG_CONNECTION_PROPERTY_DOUBLE_TIMEOUT`
        - `Connection.TIBDG_CONNECTION_PROPERTY_DOUBLE_CONNECT_WAIT_TIME`
        - `Connection.TIBDG_CONNECTION_PROPERTY_LONG_TRANSPORT_TYPE`
        - `Connection.TIBDG_CONNECTION_PROPERTY_LONG_REALM_CONNECT_RETRIES`
        - `Connection.TIBDG_CONNECTION_PROPERTY_STRING_USERNAME`
        - `Connection.TIBDG_CONNECTION_PROPERTY_STRING_USERPASSWORD`
      Returns:
        On success, this call returns a new connection object.
      Throws:
        `DataGridException` - in case of failures

    - #### getVersionInformation

          public static java.lang.String getVersionInformation()

      Version of the ActiveSpaces Java client library (Java archive file).

      Programs can use this string to output the ActiveSpaces version in a start banner or in debug output.

      Returns:
        The version of ActiveSpaces client library

    - #### setLogLevel

          public static void setLogLevel(java.lang.String level)
                                  throws DataGridException

      Set the ActiveSpaces log trace level.

      This call sets the global log trace level for low-level DataGrid internal calls.

      For information about tuning the log level separately for individual elements, see the topic Log Levels in the book TIBCO ActiveSpaces Development.

      Parameters:
        `level` - The call sets the level to this value.
      Throws:
        `DataGridException` - in case of failures
      See Also:
        `TIB_LOG_LEVEL_OFF`, `TIB_LOG_LEVEL_SEVERE`, `TIB_LOG_LEVEL_WARN`, `TIB_LOG_LEVEL_INFO`, `TIB_LOG_LEVEL_VERBOSE`, `TIB_LOG_LEVEL_DEBUG`

    - #### setLogFiles

          public static void setLogFiles(java.lang.String filePrefix,
                                         long maxFileSize,
                                         int maxFiles,
                                         java.util.Properties properties)
                                  throws DataGridException

      Arrange rotating log files.

      The filename extension .0 indicates the current log file. Rotation shifts each file by incrementing its numeric extension. If the number of files would exceed the maximum, rotation deletes the oldest file.

      Parameters:
        `filePrefix` - All log files begin with this filename prefix.
        `maxFileSize` - ActiveSpaces rotates the log files when the current log file exceeds this limit (in bytes). This value must be greater than 102400 (100 kilobytes).
        `maxFiles` - ActiveSpaces limits the number of log files to this maximum.
        `properties` - Reserved for future use. To ensure forward compatibility, programmers must supply null.
      Throws:
        `DataGridException` - in case of failures

    - #### setLogHandler

          public static void setLogHandler(LogHandler handler,
                                           java.util.Properties properties)
                                    throws DataGridException

      Register a global log handler.

      If you register a log handler (at most one), then ActiveSpaces directs all log statements to that handler.

      Parameters:
        `handler` - ActiveSpaces invokes this handler to process all log statements.
        `properties` - Reserved for future use. To ensure forward compatibility, programmers must supply null.
      Throws:
        `DataGridException` - in case of failures