@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class FlattenSubtreeTransformation extends java.lang.Object implements EntryTransformation, java.io.Serializable
Constructor and Description |
---|
FlattenSubtreeTransformation(Schema schema,
DN flattenBaseDN,
boolean addOmittedRDNAttributesToEntry,
boolean addOmittedRDNAttributesToRDN,
Filter excludeFilter)
Creates a new instance of this transformation with the provided
information.
|
Modifier and Type | Method and Description |
---|---|
Entry |
transformEntry(Entry e)
Applies an appropriate transformation to the provided entry.
|
Entry |
translate(Entry original,
long firstLineNumber)
Applies some special transformation or filtering to the original Entry.
|
Entry |
translateEntryToWrite(Entry original)
Applies some special transformation or filtering to the original Entry.
|
public FlattenSubtreeTransformation(@Nullable Schema schema, @NotNull DN flattenBaseDN, boolean addOmittedRDNAttributesToEntry, boolean addOmittedRDNAttributesToRDN, @Nullable Filter excludeFilter)
schema
- The schema to use in processing.
It may be null
if a default
standard schema should be used.flattenBaseDN
- The base DN below which any
flattening will be performed. In
the transformed data, all entries
below this base DN will be exactly
one level below this base DN. It
must not be null
.addOmittedRDNAttributesToEntry
- Indicates whether to add the
attribute-value pairs of any RDNs
stripped out of DNs during the
course of flattening the DIT should
be added as attribute values in the
target entry.addOmittedRDNAttributesToRDN
- Indicates whether to add the
attribute-value pairs of any RDNs
stripped out of DNs during the
course of flattening the DIT should
be added as additional values in
the RDN of the target entry (so the
resulting DN will have a
multivalued RDN with all of the
attribute-value pairs of the
original RDN, plus all
attribute-value pairs from any
omitted RDNs).excludeFilter
- An optional filter that may be used
to exclude entries during the
flattening process. If this is
non-null
, then any entry
below the flatten base DN that
matches this filter will be
excluded from the results rather
than flattened. This can be used
to strip out "container" entries
that were simply used to add levels
of hierarchy in the previous
branched DN that are no longer
needed in the flattened
representation of the DIT.@Nullable public Entry transformEntry(@NotNull Entry e)
transformEntry
in interface EntryTransformation
e
- The entry to transform.null
if the entry should be suppressed.@Nullable public Entry translate(@NotNull Entry original, long firstLineNumber)
translate
in interface LDIFReaderEntryTranslator
original
- The original Entry that was read and parsed from
the input file.firstLineNumber
- The first line number of the LDIF record
corresponding to the read Entry. This is most
useful when throwing an LDIFException.LDIFReader.readEntry()
. This can be the original parameter
Entry, a newly constructed Entry, or null
to signal that
the provided Entry should be skipped.@Nullable public Entry translateEntryToWrite(@NotNull Entry original)
translateEntryToWrite
in interface LDIFWriterEntryTranslator
original
- The original Entry that was to be written.null
to
signal that this Entry should not be written. Note, however, that
if the original entry provided as a parameter is altered, then
the change will be visible to anything that references that entry.
If you are not sure about whether changes to the original entry
are acceptable, it is recommended that you use the
duplicate()
method to create a copy of the original and
make the necessary changes to that duplicate.