Package scriptella.driver.ldap
Class LdapConnection
java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.ldap.LdapConnection
- All Implemented Interfaces:
Connection
Represents a connection to a directory context.
For configuration details and examples see overview page.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Nested Class Summary
Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection
AbstractConnection.StatementCounter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNames of the Max File Length connection property.static final StringName of the Search base DN connection property.static final StringName of the Count Limit(maximum number of entries to be returned) connection property.static final StringName of the Search scope connection property.static final StringName of the Time Limit connection property.Fields inherited from class scriptella.spi.AbstractConnection
counter -
Constructor Summary
ConstructorsConstructorDescriptionLdapConnection(ConnectionParameters parameters) Creates a connnection to a directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection and releases all related resources.voidexecuteQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) Executes a query specified by its content.voidexecuteScript(Resource scriptContent, ParametersCallback parametersCallback) Executes a script specified by its content.protected voidCreates a directory context.Methods inherited from class scriptella.spi.AbstractConnection
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString
-
Field Details
-
SEARCH_SCOPE_KEY
Name of the Search scope connection property.The value must be one of the: object, onelevel, subtree
-
SEARCH_BASEDN_KEY
Name of the Search base DN connection property. -
SEARCH_TIMELIMIT_KEY
Name of the Time Limit connection property.The value must be integer.
-
SEARCH_COUNTLIMIT_KEY
Name of the Count Limit(maximum number of entries to be returned) connection property.The value must be integer.
-
FILE_MAXLENGTH_KEY
Names of the Max File Length connection property.This property specifies the maximum size in Kb of the external files referenced from LDIFs. The default value is 10000 (10MB)
- See Also:
-
-
Constructor Details
-
LdapConnection
public LdapConnection() -
LdapConnection
Creates a connnection to a directory.- Parameters:
parameters- parameters to establish connection.
-
-
Method Details
-
initializeContext
Creates a directory context.- Parameters:
env- environment to create initial context.
-
executeScript
public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException Description copied from interface:ConnectionExecutes a script specified by its content.scriptContent may be used as a key for caching purposes, i.e. provider may precompile scripts and use compiled versions for subsequent executions. Please note that only inline
text resourcescan be safely cached.- Parameters:
scriptContent- script content. Cannot be null.parametersCallback- callback to get parameter values. Cannot be null.- Throws:
ProviderException- if script execution failed.
-
executeQuery
public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ProviderException Description copied from interface:ConnectionExecutes a query specified by its content.- Parameters:
queryContent- query content. Cannot be null.parametersCallback- callback to get parameter values. Cannot be null.queryCallback- callback to call for each result set element produced by this query. Cannot be null.- Throws:
ProviderException- if query execution failed.- See Also:
-
close
Description copied from interface:ConnectionCloses the connection and releases all related resources.- Throws:
ProviderException- if a critical failure occured.
-