@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class RenameAttributeTransformation extends java.lang.Object implements EntryTransformation, LDIFChangeRecordTransformation
| Constructor and Description |
|---|
RenameAttributeTransformation(Schema schema,
java.lang.String sourceAttribute,
java.lang.String targetAttribute,
boolean renameInDNs)
Creates a new rename attribute transformation with the provided
information.
|
| Modifier and Type | Method and Description |
|---|---|
LDIFChangeRecord |
transformChangeRecord(LDIFChangeRecord r)
Applies an appropriate transformation to the provided LDIF change record.
|
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.
|
LDIFChangeRecord |
translate(LDIFChangeRecord original,
long firstLineNumber)
Applies some special transformation or filtering to the original change
record.
|
LDIFChangeRecord |
translateChangeRecordToWrite(LDIFChangeRecord original)
Applies some special transformation or filtering to the original change
record.
|
Entry |
translateEntryToWrite(Entry original)
Applies some special transformation or filtering to the original Entry.
|
public RenameAttributeTransformation(Schema schema, java.lang.String sourceAttribute, java.lang.String targetAttribute, boolean renameInDNs)
schema - The schema to use in processing. If this is
null, a default standard schema will be
used.sourceAttribute - The name of the source attribute to be replaced
with the name of the target attribute. It must
not be null.targetAttribute - The name of the target attribute to use in place
of the source attribute. It must not be
null.renameInDNs - Indicates whether to rename attributes contained
in DNs. This includes both in the DN of an entry
to be transformed, but also in the values of
attributes with a DN syntax.public Entry transformEntry(Entry e)
transformEntry in interface EntryTransformatione - The entry to transform.null if the entry should be suppressed.public LDIFChangeRecord transformChangeRecord(LDIFChangeRecord r)
transformChangeRecord in interface LDIFChangeRecordTransformationr - The LDIF change record to transform.null if the change record should be
suppressed.public Entry translate(Entry original, long firstLineNumber)
translate in interface LDIFReaderEntryTranslatororiginal - 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.public LDIFChangeRecord translate(LDIFChangeRecord original, long firstLineNumber)
translate in interface LDIFReaderChangeRecordTranslatororiginal - The original change record that was read and
parsed from the input file.firstLineNumber - The first line number of the LDIF change record.
This is most useful when throwing an
LDIFException.LDIFReader.readChangeRecord(). This can be the original
parameter change record, a newly constructed change record, or
null to signal that the provided change record should be
skipped.public Entry translateEntryToWrite(Entry original)
translateEntryToWrite in interface LDIFWriterEntryTranslatororiginal - 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.public LDIFChangeRecord translateChangeRecordToWrite(LDIFChangeRecord original)
translateChangeRecordToWrite in interface LDIFWriterChangeRecordTranslatororiginal - The original change record that was to be written.null to signal that the change record should
not be written. Note, however, that if the original record
provided as a parameter is altered, then the change will be
visible to anything that references that change record. If you
are not sure about whether changes to the original change record
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.