001/*
002 * Copyright 2016-2017 UnboundID Corp.
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2016-2017 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 */
021package com.unboundid.ldap.sdk.transformations;
022
023
024
025import com.unboundid.ldif.LDIFChangeRecord;
026import com.unboundid.ldif.LDIFReaderChangeRecordTranslator;
027import com.unboundid.ldif.LDIFWriterChangeRecordTranslator;
028import com.unboundid.util.Extensible;
029import com.unboundid.util.ThreadSafety;
030import com.unboundid.util.ThreadSafetyLevel;
031
032
033
034/**
035 * This class defines an API that may be used to apply some kind of
036 * transformation to an LDIF change record to alter its contents or suppress it
037 * from further processing.
038 */
039@Extensible()
040@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
041public interface LDIFChangeRecordTransformation
042       extends LDIFReaderChangeRecordTranslator,
043               LDIFWriterChangeRecordTranslator
044{
045  /**
046   * Applies an appropriate transformation to the provided LDIF change record.
047   *
048   * @param  changeRecord  The LDIF change record to transform.
049   *
050   * @return  A copy of the change record with any appropriate transformation
051   *          applied, the original change record if no transformations were
052   *          necessary, or {@code null} if the change record should be
053   *          suppressed.
054   */
055  LDIFChangeRecord transformChangeRecord(final LDIFChangeRecord changeRecord);
056}