01: /*
02: * Jython Database Specification API 2.0
03: *
04: * $Id: Sink.java 2414 2005-02-23 04:26:23Z bzimmer $
05: *
06: * Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
07: *
08: */
09: package com.ziclix.python.sql.pipe;
10:
11: import org.python.core.PyObject;
12:
13: /**
14: * A Sink acts as a data consumer. The Pipe is responsible for pushing data
15: * to the Sink as generated by the Source.
16: *
17: * @author brian zimmer
18: * @version $Revision: 2414 $
19: */
20: public interface Sink {
21:
22: /**
23: * Invoked at the start of the data pipelining session.
24: */
25: public void start();
26:
27: /**
28: * Invoked for each row of data. In general, the first row of data will
29: * consist of header information in the format:<br/>
30: * [(colName, colType), ...]
31: * and in the format:<br/>
32: * (colData, colData, ...)
33: * for all other data.
34: */
35: public void row(PyObject row);
36:
37: /**
38: * Invoked at the end of the data pipelining session. This is useful for
39: * flushing any buffers or handling any cleanup. This method is guaranteed
40: * to be called.
41: */
42: public void end();
43: }
|