~sgdg/stado/stado25

« back to all changes in this revision

Viewing changes to src/org/postgresql/driver/copy/CopyOperation.java

  • Committer: Jim Mlodgenski
  • Date: 2011-08-30 22:39:37 UTC
  • mfrom: (1.1.3 stado)
  • Revision ID: jim@cirrusql.com-20110830223937-25q231a31x0e08b4
Merge from Spatial branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * Copyright (C) 2008 EnterpriseDB Corporation.
 
3
 * Copyright (C) 2011 Stado Global Development Group.
 
4
 *
 
5
 * This file is part of Stado.
 
6
 *
 
7
 * Stado is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation, either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * Stado is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with Stado.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * You can find Stado at http://www.stado.us
 
21
 *
 
22
 ****************************************************************************/
 
23
package org.postgresql.driver.copy;
 
24
 
 
25
import java.sql.SQLException;
 
26
 
 
27
/**
 
28
 * Exchange bulk data between client and PostgreSQL database tables.
 
29
 * See CopyIn and CopyOut for full interfaces for corresponding copy directions.
 
30
 */
 
31
public interface CopyOperation {
 
32
 
 
33
    /**
 
34
     * @return number of fields in each row for this operation
 
35
     */
 
36
    int getFieldCount();
 
37
 
 
38
    /**
 
39
     * @return overall format of each row: 0 = textual, 1 = binary
 
40
     */
 
41
    int getFormat();
 
42
 
 
43
    /**
 
44
     * @param field number of field (0..fieldCount()-1)
 
45
     * @return format of requested field: 0 = textual, 1 = binary
 
46
     */
 
47
    int getFieldFormat(int field);
 
48
    
 
49
    /**
 
50
     * @return is connection reserved for this Copy operation?
 
51
     */
 
52
    boolean isActive();
 
53
    
 
54
    /**
 
55
     * Cancels this copy operation, discarding any exchanged data.
 
56
     * @throws SQLException if cancelling fails
 
57
     */
 
58
    void cancelCopy() throws SQLException;
 
59
 
 
60
    /**
 
61
     * After succesful end of copy, returns the number
 
62
     * of database records handled in that operation.
 
63
     * Only implemented in PostgreSQL server version 8.2 and up.
 
64
     * Otherwise, returns -1.
 
65
     * @return number of handled rows or -1
 
66
     */
 
67
    public long getHandledRowCount();
 
68
}