View Javadoc
1   /*
2    * Copyright 2013-2016 Brian Thomas Matthews
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.btmatthews.maven.plugins.ldap;
18  
19  import com.unboundid.ldap.sdk.Entry;
20  
21  import java.io.IOException;
22  
23  /**
24   * Implemented by objects that write directory entries to DSML or LDIF files.
25   *
26   * @author <a href="mailto:brian@btmatthews.com">Brian Matthews</a>
27   * @since 1.2.0
28   */
29  public interface FormatWriter {
30  
31      /**
32       * Write the directory entry to the underlying output stream in the appropriate format.
33       *
34       * @param entry The directory entry.
35       * @throws IOException If there was an error writing to the underlying output stream.
36       */
37      void printEntry(Entry entry) throws IOException;
38  
39      /**
40       * Close the writer but not the underlying output stream.
41       *
42       * @throws IOException If there was a problem closing the writer.
43       */
44      void close() throws IOException;
45  }