com.marklogic.xcc

## Interface ContentbaseMetaData

-     public interface ContentbaseMetaData

  Meta-data about a contentbase as represented by a `Session` instance. The methods of this class that throw `RequestException` may make one or more calls the server to obtain needed information. Those which don't throw exceptions return local information.

  All server-query methods are lazy and do temporary caching. That is, no server calls are made until you invoke a method that needs information from the server. And once some information is fetched from the server, local copies will be returned on subsequent calls, until the data ages out. The time-to-live for cached information is about 60 seconds.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.math.BigInteger` | `getContentBaseId()` Return the numeric database ID of the contentbase.
    `java.lang.String` | `getContentBaseName()` Return the name of the contentbase associated with the `Session`.
    `int` | `getDriverMajorVersion()` The driver (XCC) major release version.
    `int` | `getDriverMinorVersion()` The driver (XCC) minor release version.
    `int` | `getDriverPatchVersion()` The driver (XCC) patch release version.
    `java.lang.String` | `getDriverVersionString()` The driver (XCC) release version, as a String.
    `java.math.BigInteger[]` | `getForestIds()` Return the IDs of forests attached to the contentbase associated with the `Session`.
    `java.util.Map<java.lang.String,java.math.BigInteger>` | `getForestMap()` Returns a `Map` of forest names to forest IDs.
    `java.lang.String[]` | `getForestNames()` Return the names of the forests attached to the contnetbase associated with the `Session`.
    `int` | `getServerMajorVersion()` Return the server major release version number.
    `int` | `getServerMinorVersion()` Return ther server minor release version number.
    `int` | `getServerPatchVersion()` Return ther server patch release version number.
    `java.lang.String` | `getServerVersionString()` Return a String version of the MarkLogic Server.
    `Session` | `getSession()` The `Session` object that created this object.
    `java.lang.String` | `getUser()` Returns the user identity associated with the `Session` from which this object was obtained.

- - ### Method Detail

    - #### getDriverVersionString

          java.lang.String getDriverVersionString()

      The driver (XCC) release version, as a String.
      Returns:
        The String form (M.m-p) of the release version.

    - #### getDriverMajorVersion

          int getDriverMajorVersion()

      The driver (XCC) major release version.
      Returns:
        The major release number, as an integer.

    - #### getDriverMinorVersion

          int getDriverMinorVersion()

      The driver (XCC) minor release version.
      Returns:
        The minor release number, as an integer.

    - #### getDriverPatchVersion

          int getDriverPatchVersion()

      The driver (XCC) patch release version.
      Returns:
        The minor release number, as an integer.

    - #### getUser

          java.lang.String getUser()

      Returns the user identity associated with the `Session` from which this object was obtained.

      This property may also be obtained directly from the `Session` object via the `UserCredentials` object returned by the `Session.getUserCredentials()` method. It is included here for completeness.

      Returns:
        The user identity as a String.

    - #### getContentBaseName

          java.lang.String getContentBaseName()
                                       throws RequestException

      Return the name of the contentbase associated with the `Session`. Unlike the similar method `Session.getContentBaseName()`, this method makes a call to the server to obtain the name. `Session` instances may be created without an explicit contentbase name (use a default) or with a numeric ID. This method determines the actual alphanumeric name of the contentbase.
      Returns:
        The contentbase name as a String.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getContentBaseId

          java.math.BigInteger getContentBaseId()
                                         throws RequestException

      Return the numeric database ID of the contentbase. Similar to `getContentBaseName()`, this method makes a call to the server to obtain the ID, regardless of how the `Session` was created.
      Returns:
        The server's numeric (unsigned long) database ID.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getForestIds

          java.math.BigInteger[] getForestIds()
                                       throws RequestException

      Return the IDs of forests attached to the contentbase associated with the `Session`.
      Returns:
        An array of `BigInteger` values.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getForestNames

          java.lang.String[] getForestNames()
                                     throws RequestException

      Return the names of the forests attached to the contnetbase associated with the `Session`.
      Returns:
        An array of forest names as `String`s.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getForestMap

          java.util.Map<java.lang.String,java.math.BigInteger> getForestMap()
                                                                     throws RequestException

      Returns a `Map` of forest names to forest IDs. The keys of the `Map` are the forest names and the values are `BigInteger` values that represent the forest IDs.
      Returns:
        A `Map`, keyed by forest name, of the forest IDs.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getServerVersionString

          java.lang.String getServerVersionString()
                                           throws RequestException

      Return a String version of the MarkLogic Server.
      Returns:
        The full server version as a String.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getServerMajorVersion

          int getServerMajorVersion()
                             throws RequestException

      Return the server major release version number.
      Returns:
        The server major release number as an integer.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getServerMinorVersion

          int getServerMinorVersion()
                             throws RequestException

      Return ther server minor release version number.
      Returns:
        The server minor release number as an integer.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getServerPatchVersion

          int getServerPatchVersion()
                             throws RequestException

      Return ther server patch release version number.
      Returns:
        The server patch release number as an integer.
      Throws:
        `RequestException` - If there is a problem communicating with the server.

    - #### getSession

          Session getSession()

      The `Session` object that created this object.
      Returns:
        A `Session` instance.

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com