Class LdapConnection

java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.ldap.LdapConnection
All Implemented Interfaces:
Connection

public class LdapConnection extends AbstractConnection
Represents a connection to a directory context.

For configuration details and examples see overview page.

Version:
1.0
Author:
Fyodor Kupolov
  • Field Details

  • Constructor Details

    • LdapConnection

      public LdapConnection()
    • LdapConnection

      public LdapConnection(ConnectionParameters parameters)
      Creates a connnection to a directory.
      Parameters:
      parameters - parameters to establish connection.
  • Method Details

    • getProgressCounter

      public AbstractConnection.StatementCounter getProgressCounter()
      Description copied from interface: Connection
      Optional live progress counter. Called on the execution thread only. Return a stable in-memory counter updated with the same semantics as Connection.getExecutedStatementsCount(), or null if unavailable. The reporter reads only its volatile value, never this connection. The counter must remain valid after close. Existing providers need not implement this method.
    • initializeContext

      protected void initializeContext(Hashtable<String,Object> env)
      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: Connection
      Executes 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 resources can 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: Connection
      Executes 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

      public void close() throws ProviderException
      Description copied from interface: Connection
      Closes the connection and releases all related resources.
      Throws:
      ProviderException - if a critical failure occured.