KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > database > TriggerEvent


1 /**
2  * com.mckoi.database.TriggerEvent 16 Feb 2001
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * Version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License Version 2 for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * Version 2 along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * Change Log:
21  *
22  *
23  */

24
25 package com.mckoi.database;
26
27 /**
28  * A trigger event represents a high level action that occured in the
29  * database. A trigger event is generated by the SQL interpreter on evaluation
30  * of curtain types of queries.
31  *
32  * @author Tobias Downer
33  */

34
35 public class TriggerEvent {
36
37   /**
38    * Statics that represent the different types of high layer trigger events.
39    */

40   public static final int INSERT = 1;
41   public static final int DELETE = 2;
42   public static final int UPDATE = 3;
43
44   /**
45    * The type of this event.
46    */

47   private int type;
48
49   /**
50    * The source of the trigger (eg. the table name).
51    */

52   private String JavaDoc source;
53
54   /**
55    * The number of times this event was fired.
56    */

57   private int count;
58
59   /**
60    * Constructs the trigger event.
61    */

62   public TriggerEvent(int type, String JavaDoc source, int count) {
63     this.type = type;
64     this.source = source;
65     this.count = count;
66   }
67
68   public TriggerEvent(int type, String JavaDoc source) {
69     this(type, source, 1);
70   }
71
72   /**
73    * Returns the type of this event.
74    */

75   public int getType() {
76     return type;
77   }
78
79   /**
80    * Returns the source of this event.
81    */

82   public String JavaDoc getSource() {
83     return source;
84   }
85
86   /**
87    * Returns the number of times this event was fired.
88    */

89   public int getCount() {
90     return count;
91   }
92
93 }
94
Popular Tags