Class ExcludeAttributeTransformation
- java.lang.Object
-
- com.unboundid.ldap.sdk.transformations.ExcludeAttributeTransformation
-
- All Implemented Interfaces:
EntryTransformation,LDIFChangeRecordTransformation,LDIFReaderChangeRecordTranslator,LDIFReaderEntryTranslator,LDIFWriterChangeRecordTranslator,LDIFWriterEntryTranslator
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ExcludeAttributeTransformation extends java.lang.Object implements EntryTransformation, LDIFChangeRecordTransformation
This class provides an implementation of an entry and LDIF change record transformation that will remove a specified set of attributes from entries or change records. Note that this transformation will not alter entry DNs, so if an attribute to exclude is included in an entry's DN, that value will still be visible in the DN even if it is removed from the set of attributes in the entry.
-
-
Constructor Summary
Constructors Constructor Description ExcludeAttributeTransformation(Schema schema, java.lang.String... attributes)Creates a new exclude attribute transformation that will strip the specified attributes out of entries and change records.ExcludeAttributeTransformation(Schema schema, java.util.Collection<java.lang.String> attributes)Creates a new exclude attribute transformation that will strip the specified attributes out of entries and change records.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LDIFChangeRecordtransformChangeRecord(LDIFChangeRecord r)Applies an appropriate transformation to the provided LDIF change record.EntrytransformEntry(Entry e)Applies an appropriate transformation to the provided entry.Entrytranslate(Entry original, long firstLineNumber)Applies some special transformation or filtering to the original Entry.LDIFChangeRecordtranslate(LDIFChangeRecord original, long firstLineNumber)Applies some special transformation or filtering to the original change record.LDIFChangeRecordtranslateChangeRecordToWrite(LDIFChangeRecord original)Applies some special transformation or filtering to the original change record.EntrytranslateEntryToWrite(Entry original)Applies some special transformation or filtering to the original Entry.
-
-
-
Constructor Detail
-
ExcludeAttributeTransformation
public ExcludeAttributeTransformation(@Nullable Schema schema, @NotNull java.lang.String... attributes)
Creates a new exclude attribute transformation that will strip the specified attributes out of entries and change records.- Parameters:
schema- The scheme to use to identify alternate names that may be used to reference the attributes to exclude from entries. It may benullto use a default standard schema.attributes- The names of the attributes to strip from entries and change records. It must not benullor empty.
-
ExcludeAttributeTransformation
public ExcludeAttributeTransformation(@Nullable Schema schema, @NotNull java.util.Collection<java.lang.String> attributes)
Creates a new exclude attribute transformation that will strip the specified attributes out of entries and change records.- Parameters:
schema- The scheme to use to identify alternate names that may be used to reference the attributes to exclude from entries. It may benullto use a default standard schema.attributes- The names of the attributes to strip from entries and change records. It must not benullor empty.
-
-
Method Detail
-
transformEntry
@Nullable public Entry transformEntry(@NotNull Entry e)
Applies an appropriate transformation to the provided entry.- Specified by:
transformEntryin interfaceEntryTransformation- Parameters:
e- The entry to transform.- Returns:
- A copy of the entry with any appropriate transformation applied,
the original entry if no transformations were necessary, or
nullif the entry should be suppressed.
-
transformChangeRecord
@Nullable public LDIFChangeRecord transformChangeRecord(@NotNull LDIFChangeRecord r)
Applies an appropriate transformation to the provided LDIF change record.- Specified by:
transformChangeRecordin interfaceLDIFChangeRecordTransformation- Parameters:
r- The LDIF change record to transform.- Returns:
- A copy of the change record with any appropriate transformation
applied, the original change record if no transformations were
necessary, or
nullif the change record should be suppressed.
-
translate
@Nullable public Entry translate(@NotNull Entry original, long firstLineNumber)
Applies some special transformation or filtering to the original Entry.- Specified by:
translatein interfaceLDIFReaderEntryTranslator- Parameters:
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.- Returns:
- The Entry that should be returned in the call to
LDIFReader.readEntry(). This can be the original parameter Entry, a newly constructed Entry, ornullto signal that the provided Entry should be skipped.
-
translate
@Nullable public LDIFChangeRecord translate(@NotNull LDIFChangeRecord original, long firstLineNumber)
Applies some special transformation or filtering to the original change record.- Specified by:
translatein interfaceLDIFReaderChangeRecordTranslator- Parameters:
original- 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 anLDIFException.- Returns:
- The LDIF change record that should be returned in the call to
LDIFReader.readChangeRecord(). This can be the original parameter change record, a newly constructed change record, ornullto signal that the provided change record should be skipped.
-
translateEntryToWrite
@Nullable public Entry translateEntryToWrite(@NotNull Entry original)
Applies some special transformation or filtering to the original Entry.- Specified by:
translateEntryToWritein interfaceLDIFWriterEntryTranslator- Parameters:
original- The original Entry that was to be written.- Returns:
- The Entry that should be written. This can be the original
parameter Entry, a newly-constructed Entry, or
nullto 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 theduplicate()method to create a copy of the original and make the necessary changes to that duplicate.
-
translateChangeRecordToWrite
@Nullable public LDIFChangeRecord translateChangeRecordToWrite(@NotNull LDIFChangeRecord original)
Applies some special transformation or filtering to the original change record.- Specified by:
translateChangeRecordToWritein interfaceLDIFWriterChangeRecordTranslator- Parameters:
original- The original change record that was to be written.- Returns:
- The change record that should be written. This can be the
original parameter change record, a newly-constructed change
record, or
nullto 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 theduplicate()method to create a copy of the original and make the necessary changes to that duplicate.
-
-