01: /*
02: * Copyright (C) 2005 Rob Manning
03: * manningr@users.sourceforge.net
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * as published by the Free Software Foundation; either version 2
08: * of the License, or any later version.
09: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU General Public License for more details.
14: *
15: * You should have received a copy of the GNU General Public License
16: * along with this program; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package net.sourceforge.squirrel_sql.plugins.dbcopy.event;
20:
21: import net.sourceforge.squirrel_sql.plugins.dbcopy.SessionInfoProvider;
22:
23: public class ErrorEvent extends AbstractCopyEvent {
24:
25: public static final int SETUP_AUTO_COMMIT_TYPE = 0;
26:
27: public static final int RESTORE_AUTO_COMMIT_TYPE = 1;
28:
29: public static final int SQL_EXCEPTION_TYPE = 2;
30:
31: public static final int MAPPING_EXCEPTION_TYPE = 3;
32:
33: public static final int USER_CANCELLED_EXCEPTION_TYPE = 4;
34:
35: public static final int GENERIC_EXCEPTION = 5;
36:
37: private int type = -1;
38:
39: private Exception exception = null;
40:
41: public ErrorEvent(SessionInfoProvider provider, int aType) {
42: super (provider);
43: type = aType;
44: }
45:
46: /**
47: * @param type The type to set.
48: */
49: public void setType(int type) {
50: this .type = type;
51: }
52:
53: /**
54: * @return Returns the type.
55: */
56: public int getType() {
57: return type;
58: }
59:
60: /**
61: * @param exception The exception to set.
62: */
63: public void setException(Exception exception) {
64: this .exception = exception;
65: }
66:
67: /**
68: * @return Returns the exception.
69: */
70: public Exception getException() {
71: return exception;
72: }
73:
74: }
|