public class LdapConnection extends AbstractConnection
For configuration details and examples see overview page.
AbstractConnection.StatementCounter| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FILE_MAXLENGTH_KEY
Names of the Max File Length connection property.
|
static java.lang.String |
SEARCH_BASEDN_KEY
Name of the Search base DN connection property.
|
static java.lang.String |
SEARCH_COUNTLIMIT_KEY
Name of the Count Limit(maximum number of entries to be returned)
connection property.
|
static java.lang.String |
SEARCH_SCOPE_KEY
Name of the Search scope connection property.
|
static java.lang.String |
SEARCH_TIMELIMIT_KEY
Name of the Time Limit connection property.
|
counter| Constructor and Description |
|---|
LdapConnection() |
LdapConnection(ConnectionParameters parameters)
Creates a connnection to a directory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection and releases all related resources.
|
void |
executeQuery(Resource queryContent,
ParametersCallback parametersCallback,
QueryCallback queryCallback)
Executes a query specified by its content.
|
void |
executeScript(Resource scriptContent,
ParametersCallback parametersCallback)
Executes a script specified by its content.
|
protected void |
initializeContext(java.util.Hashtable<java.lang.String,java.lang.Object> env)
Creates a directory context.
|
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toStringpublic static final java.lang.String SEARCH_SCOPE_KEY
The value must be one of the: object, onelevel, subtree
SearchControls.setSearchScope(int),
Constant Field Valuespublic static final java.lang.String SEARCH_BASEDN_KEY
DirContext.search(String,javax.naming.directory.Attributes),
Constant Field Valuespublic static final java.lang.String SEARCH_TIMELIMIT_KEY
The value must be integer.
SearchControls.setTimeLimit(int),
Constant Field Valuespublic static final java.lang.String SEARCH_COUNTLIMIT_KEY
The value must be integer.
SearchControls.setCountLimit(long),
Constant Field Valuespublic static final java.lang.String FILE_MAXLENGTH_KEY
This property specifies the maximum size in Kb of the external files referenced from LDIFs. The default value is 10000 (10MB)
public LdapConnection()
public LdapConnection(ConnectionParameters parameters)
parameters - parameters to establish connection.protected void initializeContext(java.util.Hashtable<java.lang.String,java.lang.Object> env)
env - environment to create initial context.public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException
ConnectionscriptContent 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 resources
can be safely cached.
scriptContent - script content. Cannot be null.parametersCallback - callback to get parameter values. Cannot be null.ProviderException - if script execution failed.public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ProviderException
ConnectionqueryContent - 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.ProviderException - if query execution failed.Connection.executeScript(scriptella.spi.Resource,scriptella.spi.ParametersCallback)public void close()
throws ProviderException
ConnectionProviderException - if a critical failure occured.Copyright © Copyright 2006-2019 The Scriptella Project Team.