001    /*
002     * Copyright 2015-2016 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2015-2016 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldif;
022    
023    
024    
025    import com.unboundid.util.Extensible;
026    import com.unboundid.util.ThreadSafety;
027    import com.unboundid.util.ThreadSafetyLevel;
028    
029    
030    
031    /**
032     * This interface is used by the LDIFWriter to translate or exclude change
033     * records before they are written.
034     */
035    @Extensible()
036    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
037    public interface LDIFWriterChangeRecordTranslator
038    {
039      /**
040       * Applies some special transformation or filtering to the original change
041       * record.
042       *
043       * @param  original  The original change record that was to be written.
044       *
045       * @return  The change record that should be written.  This can be the
046       *          original parameter change record, a newly-constructed change
047       *          record, or {@code null} to signal that the change record should
048       *          not be written.  Note, however, that if the original record
049       *          provided as a parameter is altered, then the change will be
050       *          visible to anything that references that change record.  If you
051       *          are not sure about whether changes to the original change record
052       *          are acceptable, it is recommended that you use the
053       *          {@code duplicate()} method to create a copy of the original and
054       *          make the necessary changes to that duplicate.
055       */
056      LDIFChangeRecord translateChangeRecordToWrite(LDIFChangeRecord original);
057    }