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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Driver
getDriver()
Gets the driver associated with this management context.static ManagementContext
newLdifManagementContext(Path ldifPath)
Returns a management context for the provided LDIF configuration file anddefault schema
.static ManagementContext
newLdifManagementContext(Path ldifPath, Schema schema)
Returns a management context for the provided LDIF configuration file and schema.static ManagementContext
newManagementContext(Connection connection, LdapProfile profile)
Creates a new LDAP management context using the provided LDAP connection anddefault schema
.static ManagementContext
newUnsafeManagementContext(Connection connection, LdapProfile profile)
Creates a new LDAP management context using the provided connection and profile.-
Methods inherited from class org.forgerock.opendj.config.client.DriverBasedManagementContext
close, deleteManagedObject, deleteManagedObject, deleteManagedObject, getManagedObject, getPropertyValue, getPropertyValues, getRootConfiguration, getRootConfigurationManagedObject, listManagedObjects, listManagedObjects, listManagedObjects, managedObjectExists
-
-
-
-
Method Detail
-
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 anddefault 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 returnedManagementContext
is considered unsafe because this method does not verify that the target configuration version is compatible with theManagementContext
version, hence calls on the returnedManagementContext
object may result inRuntimeException
.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 anddefault schema
.- Parameters:
ldifPath
- The path to the LDIF file- Returns:
- The new management context
- Throws:
IOException
- If problems occur while reading the filecom.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 fileschema
- The schema- Returns:
- The new management context
- Throws:
IOException
- If problems occur while reading the filecom.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 classDriverBasedManagementContext
- Returns:
- Returns the driver associated with this management context.
-
-