@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class LDIFImportConfig extends OperationConfig implements Closeable
Constructor and Description |
---|
LDIFImportConfig(InputStream ldifInputStream)
Creates a new LDIF import configuration that will read from the
provided input stream.
|
LDIFImportConfig(List<String> ldifFiles)
Creates a new LDIF import configuration that will read from the
specified LDIF files.
|
LDIFImportConfig(Reader ldifInputReader)
Creates a new LDIF import configuration that will read from the
provided reader.
|
LDIFImportConfig(String ldifFile)
Creates a new LDIF import configuration that will read from the
specified LDIF file.
|
LDIFImportConfig(TemplateFile templateFile)
Creates a new LDIF import configuration that will generate
entries using the given MakeLDIF template file rather than
reading them from an existing LDIF file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
clearBackend()
Indicates whether to clear the entire backend if importing to a
backend with more than one base DNs.
|
void |
close()
Closes any resources that this import config might have open.
|
int |
getBufferSize()
Retrieves the buffer size that should be used when reading LDIF
data.
|
Set<org.forgerock.opendj.ldap.schema.AttributeType> |
getExcludeAttributes()
Retrieves the set of attributes that should be excluded from the
entries read from the LDIF.
|
Set<org.forgerock.opendj.ldap.Dn> |
getExcludeBranches()
Retrieves the set of base DNs that specify the set of entries to
exclude from the import.
|
List<SearchFilter> |
getExcludeFilters()
Retrieves the set of search filters that should be used to
determine which entries to exclude from the LDIF.
|
Set<org.forgerock.opendj.ldap.schema.AttributeType> |
getIncludeAttributes()
Retrieves the set of attributes that should be included in the
entries read from the LDIF.
|
Set<org.forgerock.opendj.ldap.Dn> |
getIncludeBranches()
Retrieves the set of base DNs that specify the set of entries to
include in the import.
|
List<SearchFilter> |
getIncludeFilters()
Retrieves the set of search filters that should be used to
determine which entries to include in the LDIF.
|
BufferedReader |
getReader()
Retrieves the reader that should be used to read the LDIF data.
|
BufferedWriter |
getRejectWriter()
Retrieves the writer that should be used to write entries that
are rejected rather than imported for some reason.
|
BufferedWriter |
getSkipWriter()
Retrieves the writer that should be used to write entries that
are skipped because they don't match the criteria.
|
int |
getThreadCount()
Return the specified thread count.
|
String |
getTmpDirectory()
Return the temporary directory path.
|
boolean |
includeAttribute(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
Indicates whether the specified attribute should be included in
the entries read from the LDIF.
|
org.forgerock.util.Pair<Boolean,LocalizableMessage> |
includeEntry(org.forgerock.opendj.ldap.Dn dn)
Indicates whether to include the entry with the specified DN in the import.
|
org.forgerock.util.Pair<Boolean,LocalizableMessage> |
includeEntry(Entry entry)
Indicates whether the specified entry should be included in the
import based on the configured set of include and exclude filters.
|
boolean |
includeObjectClasses()
Indicates whether the set of objectclasses should be included in
the entries read from the LDIF.
|
boolean |
invokeImportPlugins()
Indicates whether any LDIF import plugins registered with the
server should be invoked during the import operation.
|
boolean |
isCompressed()
Indicates whether the input LDIF source is expected to be
compressed.
|
boolean |
isEncrypted()
Indicates whether the input LDIF source is expected to be
encrypted.
|
BufferedReader |
nextReader()
Retrieves the LDIF reader configured to read from the next LDIF
file in the list.
|
void |
setBufferSize(int bufferSize)
Specifies the buffer size that should be used when reading LDIF
data.
|
void |
setClearBackend(boolean clearBackend)
Specifies whether to clear the entire backend if importing to a
backend.
|
void |
setCompressed(boolean isCompressed)
Specifies whether the input LDIF source is expected to be
compressed.
|
void |
setEncrypted(boolean isEncrypted)
Specifies whether the input LDIF source is expected to be
encrypted.
|
void |
setExcludeAllOperationalAttributes(boolean excludeAllOpAttrs)
Specifies whether all the operational attributes should be
excluded.
|
void |
setExcludeAllUserAttributes(boolean excludeAllUserAttrs)
Specifies whether all the user attributes should be excluded.
|
void |
setExcludeAttributes(Set<org.forgerock.opendj.ldap.schema.AttributeType> excludeAttributes)
Specifies the set of attributes that should be excluded from the
entries read from the LDIF.
|
void |
setExcludeBranches(Set<org.forgerock.opendj.ldap.Dn> excludeBranches)
Specifies the set of base DNs that specify the set of entries to
exclude from the import.
|
void |
setExcludeFilters(List<SearchFilter> excludeFilters)
Specifies the set of search filters that should be used to
determine which entries to exclude from the LDIF.
|
void |
setIncludeAllOpAttributes(boolean includeAllOpAttrs)
Specifies whether all the operational attributes should be
included.
|
void |
setIncludeAllUserAttributes(boolean includeAllUserAttrs)
Specifies whether all the user attributes should be included.
|
void |
setIncludeAttributes(Set<org.forgerock.opendj.ldap.schema.AttributeType> includeAttributes)
Specifies the set of attributes that should be included in the
entries read from the LDIF.
|
void |
setIncludeBranches(Set<org.forgerock.opendj.ldap.Dn> includeBranches)
Specifies the set of base DNs that specify the set of entries to
include in the import.
|
void |
setIncludeFilters(List<SearchFilter> includeFilters)
Specifies the set of search filters that should be used to
determine which entries to include in the LDIF.
|
void |
setIncludeObjectClasses(boolean includeObjectClasses)
Specifies whether the set of objectclasses should be included in
the entries read from the LDIF.
|
void |
setInvokeImportPlugins(boolean invokeImportPlugins)
Specifies whether any LDIF import plugins registered with the
server should be invoked during the import operation.
|
void |
setThreadCount(int c)
Set the thread count.
|
void |
setTmpDirectory(String path)
Set the temporary directory to the specified path.
|
void |
setValidateSchema(boolean validateSchema)
Specifies whether to perform schema validation on entries as they
are read.
|
boolean |
validateSchema()
Indicates whether to perform schema validation on entries as they
are read.
|
void |
writeRejectedEntries(OutputStream outputStream)
Indicates that rejected entries should be written to the provided
output stream.
|
void |
writeRejectedEntries(String rejectFile,
ExistingFileBehavior existingFileBehavior)
Indicates that rejected entries should be written to the
specified file.
|
void |
writeSkippedEntries(String skipFile,
ExistingFileBehavior existingFileBehavior)
Indicates that skipped entries should be written to the
specified file.
|
cancel, isCancelled
public LDIFImportConfig(String ldifFile)
ldifFile
- The path to the LDIF file with the data to
import.public LDIFImportConfig(List<String> ldifFiles)
ldifFiles
- The paths to the LDIF files with the data to
import.public LDIFImportConfig(InputStream ldifInputStream)
ldifInputStream
- The input stream from which to read the
LDIF data.public LDIFImportConfig(Reader ldifInputReader)
ldifInputReader
- The input stream from which to read the
LDIF data.public LDIFImportConfig(TemplateFile templateFile)
templateFile
- The template file to use to generate the
entries.public BufferedReader getReader() throws IOException
IOException
- If a problem occurs while obtaining the
reader.public BufferedReader nextReader() throws IOException
null
if there are no more files to read.IOException
- If a problem occurs while obtaining the reader.public BufferedWriter getRejectWriter()
null
if none is to be used.public BufferedWriter getSkipWriter()
null
if none is to be used.public void writeRejectedEntries(String rejectFile, ExistingFileBehavior existingFileBehavior) throws IOException
rejectFile
- The path to the file to which
reject information should be written.existingFileBehavior
- Indicates how to treat an existing file.IOException
- If a problem occurs while opening the
reject file for writing.public void writeRejectedEntries(OutputStream outputStream)
outputStream
- The output stream to which rejected entries
should be written.public void writeSkippedEntries(String skipFile, ExistingFileBehavior existingFileBehavior) throws IOException
skipFile
- The path to the file to which
skipped information should be written.existingFileBehavior
- Indicates how to treat an existing file.IOException
- If a problem occurs while opening the
skip file for writing.public boolean invokeImportPlugins()
true
if registered LDIF import plugins
should be invoked during the import operation, or
false
if they should not be invoked.public void setInvokeImportPlugins(boolean invokeImportPlugins)
invokeImportPlugins
- Specifies whether any LDIF import
plugins registered with the server
should be invoked during the import
operation.public boolean isCompressed()
true
if the LDIF source is expected to be
compressed, or false
if not.public void setCompressed(boolean isCompressed)
getReader
.isCompressed
- Indicates whether the input LDIF source is
expected to be compressed.public boolean isEncrypted()
true
if the LDIF source is expected to be
encrypted, or false
if not.public void setEncrypted(boolean isEncrypted)
getReader
.isEncrypted
- Indicates whether the input LDIF source is
expected to be encrypted.public boolean clearBackend()
true
if the entire backend should be
cleared or false
if not.public void setClearBackend(boolean clearBackend)
clearBackend
- Indicates whether to clear the entire
backend.public boolean validateSchema()
true
if schema validation should be
performed on the entries as they are read, or
false
if not.public void setValidateSchema(boolean validateSchema)
validateSchema
- Indicates whether to perform schema
validation on entries as they are read.public Set<org.forgerock.opendj.ldap.Dn> getExcludeBranches()
public void setExcludeBranches(Set<org.forgerock.opendj.ldap.Dn> excludeBranches)
excludeBranches
- The set of base DNs that specify the set
of entries to exclude from the import.public Set<org.forgerock.opendj.ldap.Dn> getIncludeBranches()
public void setIncludeBranches(Set<org.forgerock.opendj.ldap.Dn> includeBranches)
includeBranches
- The set of base DNs that specify the set
of entries to include in the import.public org.forgerock.util.Pair<Boolean,LocalizableMessage> includeEntry(org.forgerock.opendj.ldap.Dn dn)
dn
- The DN of the entry for which to make the determination.null
when the
entry is included in the import).public boolean includeObjectClasses()
true
if the set of objectclasses should be
included in the entries read from the LDIF, or
false
if not.public void setIncludeObjectClasses(boolean includeObjectClasses)
includeObjectClasses
- Indicates whether the set of
objectclasses should be included in
the entries read from the LDIF.public Set<org.forgerock.opendj.ldap.schema.AttributeType> getExcludeAttributes()
public void setExcludeAttributes(Set<org.forgerock.opendj.ldap.schema.AttributeType> excludeAttributes)
excludeAttributes
- The set of attributes that should be
excluded from the entries read from
the LDIF.public Set<org.forgerock.opendj.ldap.schema.AttributeType> getIncludeAttributes()
public void setIncludeAttributes(Set<org.forgerock.opendj.ldap.schema.AttributeType> includeAttributes)
includeAttributes
- The set of attributes that should be
included in the entries read from the
LDIF.public boolean includeAttribute(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
attributeType
- The attribute type for which to make the
determination.true
if the specified attribute should be
included in the entries read from the LDIF, or
false
if not.public List<SearchFilter> getExcludeFilters()
public void setExcludeFilters(List<SearchFilter> excludeFilters)
excludeFilters
- The set of search filters that should be
used to determine which entries to
exclude from the LDIF.public List<SearchFilter> getIncludeFilters()
public void setIncludeFilters(List<SearchFilter> includeFilters)
includeFilters
- The set of search filters that should be
used to determine which entries to
include in the LDIF.public org.forgerock.util.Pair<Boolean,LocalizableMessage> includeEntry(Entry entry) throws DirectoryException
entry
- The entry for which to make the determination.null
when the entry
is included in the import).DirectoryException
- If there is a problem with any of
the search filters used to make the
determination.public int getBufferSize()
public void setBufferSize(int bufferSize)
bufferSize
- The buffer size that should be used when
reading LDIF data.public void setExcludeAllUserAttributes(boolean excludeAllUserAttrs)
excludeAllUserAttrs
- Specifies all user attributes to
be excluded.public void setExcludeAllOperationalAttributes(boolean excludeAllOpAttrs)
excludeAllOpAttrs
- Specifies whether all the
operational attributes
should be excluded.public void setIncludeAllOpAttributes(boolean includeAllOpAttrs)
includeAllOpAttrs
- Specifies whether all
the operation attributes should be included.public void setIncludeAllUserAttributes(boolean includeAllUserAttrs)
includeAllUserAttrs
- Specifies whether all the
user attributes should be
included.public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void setTmpDirectory(String path)
path
- The path to set the temporary directory to.public String getTmpDirectory()
public void setThreadCount(int c)
c
- The thread count value.public int getThreadCount()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.