001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2009 Sun Microsystems, Inc.
015 * Portions Copyright 2015 ForgeRock AS.
016 */
017package org.opends.server.tools.makeldif;
018
019
020
021import java.io.IOException;
022
023
024
025/**
026 * This interface defines a method that may be used to write entries generated
027 * through the MakeLDIF utility.
028 */
029public interface EntryWriter
030{
031  /**
032   * Writes the provided entry to the appropriate target.
033   *
034   * @param  entry  The entry to be written.
035   *
036   * @return  <CODE>true</CODE> if the entry writer will accept additional
037   *          entries, or <CODE>false</CODE> if no more entries should be
038   *         written.
039   *
040   * @throws  IOException  If a problem occurs while writing the entry to its
041   *                       intended destination.
042   *
043   * @throws  MakeLDIFException  If some other problem occurs.
044   */
045  boolean writeEntry(TemplateEntry entry)
046         throws IOException, MakeLDIFException;
047
048
049
050  /**
051   * Notifies the entry writer that no more entries will be provided and that
052   * any associated cleanup may be performed.
053   */
054  void closeEntryWriter();
055}
056