org.apache.directory.server.protocol.shared.store
Class LdifFileLoader

java.lang.Object
  extended by org.apache.directory.server.protocol.shared.store.LdifFileLoader

public class LdifFileLoader
extends java.lang.Object

Support for commands to load an LDIF file into a DirContext.

Version:
$Rev: 542104 $, $Date: 2007-05-28 00:18:59 -0400 (Mon, 28 May 2007) $
Author:
Apache Directory Project

Field Summary
protected  javax.naming.directory.DirContext ctx
          a handle on the top initial context: get new context from this
protected  java.util.List<LdifLoadFilter> filters
          the filters to use while loading entries into the server
protected  java.io.File ldif
          the LDIF file or directory containing LDIFs to load
protected  java.lang.ClassLoader loader
          the class loader to use if we cannot file the file as a path
 
Constructor Summary
LdifFileLoader(javax.naming.directory.DirContext ctx, java.io.File ldif, java.util.List<LdifLoadFilter> filters)
          Creates a new instance of LdifFileLoader.
LdifFileLoader(javax.naming.directory.DirContext ctx, java.io.File ldif, java.util.List<LdifLoadFilter> filters, java.lang.ClassLoader loader)
          Creates a new instance of LdifFileLoader.
LdifFileLoader(javax.naming.directory.DirContext ctx, java.lang.String ldif)
          Creates a new instance of LdifFileLoader.
 
Method Summary
 int execute()
          Opens the LDIF file and loads the entries into the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

protected javax.naming.directory.DirContext ctx
a handle on the top initial context: get new context from this


ldif

protected java.io.File ldif
the LDIF file or directory containing LDIFs to load


filters

protected final java.util.List<LdifLoadFilter> filters
the filters to use while loading entries into the server


loader

protected final java.lang.ClassLoader loader
the class loader to use if we cannot file the file as a path

Constructor Detail

LdifFileLoader

public LdifFileLoader(javax.naming.directory.DirContext ctx,
                      java.lang.String ldif)
Creates a new instance of LdifFileLoader.

Parameters:
ctx - the context to load the entries into.
ldif - the file of LDIF entries to load.

LdifFileLoader

public LdifFileLoader(javax.naming.directory.DirContext ctx,
                      java.io.File ldif,
                      java.util.List<LdifLoadFilter> filters)
Creates a new instance of LdifFileLoader.

Parameters:
ctx -
ldif -
filters -

LdifFileLoader

public LdifFileLoader(javax.naming.directory.DirContext ctx,
                      java.io.File ldif,
                      java.util.List<LdifLoadFilter> filters,
                      java.lang.ClassLoader loader)
Creates a new instance of LdifFileLoader.

Parameters:
ctx -
ldif -
filters -
loader -
Method Detail

execute

public int execute()
Opens the LDIF file and loads the entries into the context.

Returns:
The count of entries created.


Copyright © 2003-2007 The Apache Software Foundation. All Rights Reserved.