Package org.opends.server.types
Class LDIFExportConfig
java.lang.Object
org.opends.server.types.Cancellable
org.opends.server.types.LDIFExportConfig
- All Implemented Interfaces:
Closeable,AutoCloseable
This class defines a data structure for holding configuration information to use when performing an LDIF export.
-
Constructor Summary
ConstructorsConstructorDescriptionLDIFExportConfig(OutputStream ldifOutputStream) Creates a new LDIF export configuration that will write to the provided output stream.LDIFExportConfig(Path ldifFile, ExistingFileBehavior existingFileBehavior) Creates a new LDIF export configuration that will write to the specified LDIF file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes any resources that this export config might have open.Creates an LDIF entry writer from using the configuration held in this object.Retrieves the set of base DNs that specify the set of entries to include in the export.Retrieves the output stream that should be used to write the LDIF data.intRetrieves the column at which long lines should be wrapped.voidsetCompressData(boolean compressData) Specifies whether the LDIF data should be compressed as it is written.voidsetEncryptData(boolean encryptData) Specifies whether the LDIF data should be encrypted as it is written.voidsetExcludeAttributes(Set<AttributeType> excludeAttributes) Specifies the set of attributes that should be excluded from the entries written to LDIF.voidsetExcludeBranches(Set<Dn> excludeBranches) Specifies the set of base DNs that specify the set of entries to exclude from the export.voidsetHashData(boolean hashData) Specifies whether to generate a cryptographic hash of the data that is written.voidsetIncludeAttributes(Set<AttributeType> includeAttributes) Specifies the set of attributes that should be included in the entries written to LDIF.voidsetIncludeBranches(Set<Dn> includeBranches) Specifies the set of base DNs that specify the set of entries to include in the export.voidsetIncludeExcludeFilters(Set<Filter> includeFilters, Set<Filter> excludeFilters) Specifies the search filters that should be used to determine which entries to include / exclude in the LDIF.voidsetIncludeOperationalAttributes(boolean includeOperationalAttributes) Specifies whether the set of operational attributes should be included in the export.voidsetSignHash(boolean signHash) Specifies whether to sign the cryptographic hash of the data that is written when the export is complete.voidsetWrapColumn(int wrapColumn) Specifies the column at which long lines should be wrapped.Methods inherited from class org.opends.server.types.Cancellable
cancel, getCancelReason, isCancelled, toString
-
Constructor Details
-
LDIFExportConfig
Creates a new LDIF export configuration that will write to the specified LDIF file.- Parameters:
ldifFile- The path to the LDIF file to export.existingFileBehavior- Indicates how to proceed if the specified file already exists.
-
LDIFExportConfig
Creates a new LDIF export configuration that will write to the provided output stream.- Parameters:
ldifOutputStream- The output stream to which the LDIF data should be written.
-
-
Method Details
-
getOutputStream
Retrieves the output stream that should be used to write the LDIF data. If compression or encryption are to be used, then they must be enabled before the first call to this method.- Returns:
- The output stream that should be used to write the LDIF data.
- Throws:
IOException- If a problem occurs while preparing the writer.
-
setCompressData
public void setCompressData(boolean compressData) Specifies whether the LDIF data should be compressed as it is written. If compression should be used, then this must be set before callinggetWriterfor the first time.- Parameters:
compressData- Indicates whether the LDIF data should be compressed as it is written.
-
setEncryptData
public void setEncryptData(boolean encryptData) Specifies whether the LDIF data should be encrypted as it is written. If encryption should be used, then this must be set before callinggetWriterfor the first time.- Parameters:
encryptData- Indicates whether the LDIF data should be encrypted as it is written.
-
setHashData
public void setHashData(boolean hashData) Specifies whether to generate a cryptographic hash of the data that is written. If hashing is to be used, then this must be set before callinggetWriterfor the first time.- Parameters:
hashData- Indicates whether to generate a hash of the data as it is written.
-
setSignHash
public void setSignHash(boolean signHash) Specifies whether to sign the cryptographic hash of the data that is written when the export is complete. If the export is not configured to generate a hash, then this will be ignored. If hashing is to be used and the hash should be signed, then this must be set before callinggetWriterfor the first time.- Parameters:
signHash- Indicates whether to generate a hash of the data as it is written.
-
getWrapColumn
public int getWrapColumn()Retrieves the column at which long lines should be wrapped.- Returns:
- The column at which long lines should be wrapped, or a value less than or equal to zero to indicate that no wrapping should be performed.
-
setWrapColumn
public void setWrapColumn(int wrapColumn) Specifies the column at which long lines should be wrapped. A value less than or equal to zero indicates that no wrapping should be performed.- Parameters:
wrapColumn- The column at which long lines should be wrapped.
-
setExcludeBranches
Specifies the set of base DNs that specify the set of entries to exclude from the export.- Parameters:
excludeBranches- The set of base DNs that specify the set of entries to exclude from the export.
-
getIncludeBranches
Retrieves the set of base DNs that specify the set of entries to include in the export. The list that is returned may be altered by the caller.- Returns:
- The set of base DNs that specify the set of entries to include in the export.
-
setIncludeBranches
Specifies the set of base DNs that specify the set of entries to include in the export.- Parameters:
includeBranches- The set of base DNs that specify the set of entries to include in the export.
-
setIncludeOperationalAttributes
public void setIncludeOperationalAttributes(boolean includeOperationalAttributes) Specifies whether the set of operational attributes should be included in the export.- Parameters:
includeOperationalAttributes- Specifies whether the set of operational attributes should be included in the export.
-
setExcludeAttributes
Specifies the set of attributes that should be excluded from the entries written to LDIF.- Parameters:
excludeAttributes- The set of attributes that should be excluded from the entries written to LDIF.
-
setIncludeAttributes
Specifies the set of attributes that should be included in the entries written to LDIF.- Parameters:
includeAttributes- The set of attributes that should be included in the entries written to LDIF.
-
setIncludeExcludeFilters
Specifies the search filters that should be used to determine which entries to include / exclude in the LDIF.- Parameters:
includeFilters- The search filters that should be used to determine which entries to include in the LDIF.excludeFilters- The search filters that should be used to determine which entries to exclude from the LDIF.
-
createLdifEntryWriter
Creates an LDIF entry writer from using the configuration held in this object.- Returns:
- a new LDIF entry writer
- Throws:
IOException- If a problem occurs while opening the writer.
-
close
public void close()Closes any resources that this export config might have open.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-