1 package com.atlassian.dbexporter.node;
2
3 import com.atlassian.activeobjects.spi.ImportExportException;
4
5 import java.io.Closeable;
6
7 /**
8 * Provides streaming read access to a node graph.
9 *
10 * @author Erik van Zijst
11 */
12 public interface NodeStreamReader extends Closeable {
13
14 /**
15 * Returns the root node of the object tree. The method can only be invoked
16 * once. Subsequent calls will raise an {@link IllegalStateException}.
17 *
18 * @return the root node of the graph.
19 * @throws IllegalStateException when the root node has already been
20 * returned.
21 * @throws ImportExportException when the document could not be parsed.
22 */
23 NodeParser getRootNode() throws IllegalStateException;
24
25 /**
26 * Closes all resources of the underlying document.
27 *
28 * @throws ImportExportException if the reader could not be closed
29 */
30 void close();
31 }