Source code: evt/gui/JspmEvtDb.java
1 /*-----------------------------------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (C) */
4 /* */
5 /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU */
6 /* General Public License as published by the Free Software Foundation; either version 2 of the */
7 /* License, or (at your option) any later version. */
8 /* */
9 /* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; */
10 /* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
11 /* PURPOSE. See the GNU General Public License for more details. */
12 /* */
13 /* You should have received a copy of the GNU General Public License along with this program; if */
14 /* not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
15 /* 02111-1307 USA */
16 /* */
17 /*-----------------------------------------------------------------------------------------------------*/
18 /* */
19 /* $Author: strand01 $ $Revision: 1.3 $ $Date: 2001/12/20 14:23:03 $ */
20 /* */
21 /*-----------------------------------------------------------------------------------------------------*/
22
23 package evt.gui;
24
25 // Java classes
26 import java.io.*;
27 import java.util.*;
28 import java.sql.*;
29 import java.net.*;
30
31 // JSPM classes
32 import com.jdk.*;
33
34 /**
35 * This class defines the connection to the event management database. It
36 * includes all the methods to create/delete/update events in the JSPM event
37 * management database.
38 *
39 * @author Steve Randall (strand012001@yahoo.com)
40 * @version 0.0.8
41 * @date 31/10/2001
42 */
43 public interface JspmEvtDb
44 {
45 /**
46 * Connect to a database using the login dialog box
47 */
48 public boolean connect();
49
50 /**
51 * Connect to a specified database.
52 *
53 * @param host (String) database host.
54 * @param user (String) database user.
55 * @param passwd (String) database password.
56 */
57 public boolean connect(String host, String user, String passwd);
58
59 /**
60 * Returns the connection.
61 *
62 * @return dbConnection (Connection) database connection.
63 */
64 public Connection getConnection();
65
66 /**
67 * Closes the database connection.
68 */
69 public void close();
70
71 /**
72 * Returns a vector of server records.
73 *
74 * Each record is a hashtable.
75 *
76 * @return server (Vector) server records as hashtables.
77 */
78 public Vector getServer();
79
80 /**
81 * Returns the database type.
82 *
83 * @return dbType (int) database type (1=MySQL)
84 */
85 public int getDbType();
86
87 /**
88 * Adds an event to the database.
89 */
90 public void addEvent(String source, String node, int type, String data);
91
92 /**
93 * Deletes ans event from the database.
94 *
95 * @param id (int) event ID.
96 */
97 public void deleteEvent(int id);
98
99 /**
100 * Finds a message.
101 */
102 public Vector findMessage( String data );
103
104 public Vector findAction( int msgid );
105
106 public void setAttributes( int id, int bcolor, int fcolor, int attr, int sev );
107
108 public void sendKeep( int id, boolean keep );
109
110 public void delKeep( String text );
111
112 public int getLastEventId();
113
114 public int getLastMessageId();
115
116 public void addMessage( int msgid, String msg, String text, String dsc, String group, String owner, String node, String source );
117
118 public int deleteMessageById(int msgid);
119
120 public int deleteMessageByToken(String token);
121
122 public int deleteMessageByGroup(String group);
123
124 public void addAction(int msgid, String group, int sequence, int fore_color, int back_color, int attribute, int severity,
125 int action, String text);
126
127 public int deleteActionByMsgid(int msgid);
128
129 public int deleteActionByGroup(String group);
130 }
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159