Class LdapManagementContext

java.lang.Object
org.forgerock.opendj.config.client.DriverBasedManagementContext
org.forgerock.opendj.config.client.ldap.LdapManagementContext
All Implemented Interfaces:
Closeable, AutoCloseable, ManagementContext

public final class LdapManagementContext extends DriverBasedManagementContext
An LDAP management connection context.
  • Method Details

    • newManagementContext

      public static ManagementContext newManagementContext(Connection connection, LdapProfile profile) throws com.forgerock.opendj.util.VersionMismatchException
      Creates a new LDAP management context using the provided LDAP connection and default schema.
      Parameters:
      connection - The LDAP connection.
      profile - The LDAP profile.
      Returns:
      The new management context.
      Throws:
      com.forgerock.opendj.util.VersionMismatchException - If the target configuration version is different from this binary version.
    • newUnsafeManagementContext

      public static ManagementContext newUnsafeManagementContext(Connection connection, LdapProfile profile)
      Creates a new LDAP management context using the provided connection and profile. The returned ManagementContext is considered unsafe because this method does not verify that the target configuration version is compatible with the ManagementContext version, hence calls on the returned ManagementContext object may result in RuntimeException.

      This method should only be used when it is necessary to work with arbitrary configuration versions. Otherwise it is recommended to use newManagementContext(Connection, LdapProfile).

      Parameters:
      connection - The connection.
      profile - The LDAP profile.
      Returns:
      A new management context.
    • newLdifManagementContext

      public static ManagementContext newLdifManagementContext(Path ldifPath) throws IOException, com.forgerock.opendj.util.VersionMismatchException
      Returns a management context for the provided LDIF configuration file and default schema.
      Parameters:
      ldifPath - The path to the LDIF file
      Returns:
      The new management context
      Throws:
      IOException - If problems occur while reading the file
      com.forgerock.opendj.util.VersionMismatchException - If the configuration file version is different from this binary version
    • newLdifManagementContext

      public static ManagementContext newLdifManagementContext(Path ldifPath, Schema schema) throws IOException, com.forgerock.opendj.util.VersionMismatchException
      Returns a management context for the provided LDIF configuration file and schema.
      Parameters:
      ldifPath - The path to the LDIF file
      schema - The schema
      Returns:
      The new management context
      Throws:
      IOException - If problems occur while reading the file
      com.forgerock.opendj.util.VersionMismatchException - If the target configuration version is different from this binary version
    • getDriver

      protected Driver getDriver()
      Description copied from class: DriverBasedManagementContext
      Gets the driver associated with this management context.
      Specified by:
      getDriver in class DriverBasedManagementContext
      Returns:
      Returns the driver associated with this management context.