KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > callflow > TableInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * TableInfo.java
26  *
27  * Created on July 13, 2005, 3:54 PM
28  */

29
30 package com.sun.enterprise.admin.monitor.callflow;
31 import com.sun.appserv.management.monitor.CallFlowMonitor;
32 /**
33  *
34  * @author Harpreet Singh
35  */

36 public interface TableInfo {
37     
38     /** Columns common across Tables */
39     public static final String JavaDoc REQUEST_ID = "REQUEST_ID";
40     public static final String JavaDoc REQUEST_ID_TYPE = " VARCHAR(255) ";
41
42     public static final String JavaDoc TIME_STAMP = "TIME_STAMP";
43     public static final String JavaDoc TIME_STAMP_TYPE = " BIGINT ";
44
45     //<editor-fold defaultstate="collapsed" desc="SQL Statements Keywords">
46
/**
47      * SQL Statements keywords
48      */

49     public static final String JavaDoc CREATE_TABLE = " create table ";
50     public static final String JavaDoc NOT_NULL = " NOT NULL ";
51     public static final String JavaDoc COMMA = " , ";
52     public static final String JavaDoc PRIMARY_KEY = " primary key ";
53     public static final String JavaDoc DROP_TABLE = "drop table ";
54     public static final String JavaDoc UPDATE = " UPDATE ";
55     public static final String JavaDoc INSERT_INTO = " INSERT INTO ";
56     public static final String JavaDoc VALUES = " VALUES ";
57     public static final String JavaDoc DOT = ".";
58     public static final String JavaDoc EQUALS = " = ";
59     public static final String JavaDoc HAVING = " HAVING ";
60     public static final String JavaDoc GROUP_BY = " GROUP BY ";
61     public static final String JavaDoc WHERE = " WHERE ";
62     public static final String JavaDoc AND = " AND ";
63     public static final String JavaDoc MIN = " MIN " ;
64     public static final String JavaDoc MAX = " MAX ";
65     public static final String JavaDoc SELECT = " SELECT ";
66     public static final String JavaDoc FROM = " FROM ";
67     public static final String JavaDoc AS = " AS ";
68     public static final String JavaDoc UNION = " UNION ";
69     public static final String JavaDoc ORDER_BY = " ORDER BY ";
70     public static final String JavaDoc SUM = " SUM ";
71     public static final String JavaDoc DELETE = " DELETE ";
72 //</editor-fold>
73

74     //<editor-fold defaultstate="collapsed" desc="Request Start Table Info">
75
/**
76      * RequestStart Table Information
77      */

78     public static final String JavaDoc REQUEST_START_TABLE_NAME = "REQUEST_START_TBL";
79     
80     public static final String JavaDoc REQUEST_TYPE = "REQUEST_TYPE";
81     public static final String JavaDoc REQUEST_TYPE_TYPE = " VARCHAR(25) ";
82     
83     public static final String JavaDoc TIME_STAMP_MILLIS = "TIME_STAMP_MILLIS";
84     
85     public static final String JavaDoc TIME_STAMP_MILLIS_TYPE = " BIGINT ";
86     
87     public static final String JavaDoc IP_ADDRESS = "IP_ADDRESS";
88     public static final String JavaDoc IP_ADDRESS_TYPE = " VARCHAR (15) ";
89     /*
90      * Create Statement to create RequestStart Table
91      * This does the following
92      * create table RequestStart (REQUEST_ID VARCHAR(255) NOT NULL,
93      * TIME_STAMP BIGINT, TIME_STAMP_MILLIS BIGINT, IP_ADDRESS VARCHAR (15),
94      * primary key (REQUEST_ID))
95      */

96     public static final String JavaDoc CREATE_TABLE_REQUEST_START_SQL =
97             CREATE_TABLE + REQUEST_START_TABLE_NAME + " ( " + REQUEST_ID +
98             REQUEST_ID_TYPE + NOT_NULL + COMMA + TIME_STAMP +TIME_STAMP_TYPE +
99             COMMA + TIME_STAMP_MILLIS + TIME_STAMP_MILLIS_TYPE +
100             COMMA + REQUEST_TYPE + REQUEST_TYPE_TYPE +
101             COMMA + IP_ADDRESS + IP_ADDRESS_TYPE + COMMA +
102             PRIMARY_KEY + "(" + REQUEST_ID + ")" +")";
103     
104     /**
105      * Drop table Request Start SQL
106      */

107     public static final String JavaDoc DROP_TABLE_REQUEST_START_SQL =
108             DROP_TABLE + REQUEST_START_TABLE_NAME;
109     
110     /**
111      * Update table Request Start SQL
112      */

113     public static final String JavaDoc INSERT_INTO_TABLE_REQUEST_START_SQL =
114             INSERT_INTO + REQUEST_START_TABLE_NAME +VALUES + " ( "+
115             " ?, ? , ? , ? , ?" + " ) ";
116     /**
117      * delete row from request start SQL
118      */

119     public static final String JavaDoc DELETE_FROM_TABLE_REQUEST_START_SQL =
120             DELETE + FROM + REQUEST_START_TABLE_NAME + WHERE +
121             REQUEST_ID + EQUALS + " ? ";
122 //</editor-fold>
123

124     //<editor-fold defaultstate="collapsed" desc="Request End Table Info">
125
/**
126      * RequestEnd Table Information
127      */

128     public static final String JavaDoc REQUEST_END_TABLE_NAME = "REQUEST_END_TBL";
129     
130     /*
131      * Create Statement to create RequestEnd Table
132      * This does the following
133      * create table RequestEnd (REQUEST_ID VARCHAR(255) NOT NULL,
134      * TIME_STAMP BIGINT, primary key (REQUEST_ID))
135      */

136     public static final String JavaDoc CREATE_TABLE_REQUEST_END_SQL =
137             CREATE_TABLE + REQUEST_END_TABLE_NAME + " ( " + REQUEST_ID +
138             REQUEST_ID_TYPE + NOT_NULL + COMMA + TIME_STAMP +TIME_STAMP_TYPE +
139             COMMA + PRIMARY_KEY + "(" + REQUEST_ID + ")" +")";
140     
141     /**
142      * Drop table Request End SQL
143      */

144     public static final String JavaDoc DROP_TABLE_REQUEST_END_SQL =
145             DROP_TABLE + REQUEST_END_TABLE_NAME;
146     
147     /**
148      * Update table Request End SQL
149      */

150     public static final String JavaDoc INSERT_INTO_TABLE_REQUEST_END_SQL =
151             INSERT_INTO + REQUEST_END_TABLE_NAME +VALUES + " ( "+
152             " ?, ? " + " ) ";
153     
154    public static final String JavaDoc DELETE_FROM_TABLE_REQUEST_END_SQL =
155             DELETE + FROM + REQUEST_END_TABLE_NAME + WHERE +
156             REQUEST_ID + EQUALS + " ? ";
157 //</editor-fold>
158

159     //<editor-fold defaultstate="collapsed" desc="Method Start Table Info">
160
/**
161      * Method Start Table Information
162      */

163     public static final String JavaDoc METHOD_START_TABLE_NAME = "METHOD_START_TBL";
164     
165     /**
166      * Column Names unique to Method Start Table
167      */

168     public static final String JavaDoc COMPONENT_TYPE = "COMPONENT_TYPE";
169     public static final String JavaDoc COMPONENT_TYPE_TYPE = " VARCHAR(30) ";
170     
171     public static final String JavaDoc COMPONENT_NAME = "COMPONENT_NAME";
172     public static final String JavaDoc COMPONENT_NAME_TYPE = " VARCHAR(255) ";
173     
174     public static final String JavaDoc APP_NAME = "APP_NAME";
175     public static final String JavaDoc APP_NAME_TYPE = " VARCHAR(255) ";
176     
177     public static final String JavaDoc METHOD_NAME = "METHOD_NAME";
178     public static final String JavaDoc METHOD_NAME_TYPE = " VARCHAR(255) ";
179     
180     public static final String JavaDoc MODULE_NAME = "MODULE_NAME";
181     public static final String JavaDoc MODULE_NAME_TYPE = " VARCHAR(255) ";
182     
183     public static final String JavaDoc THREAD_ID = "THREAD_ID";
184     public static final String JavaDoc THREAD_ID_TYPE = " VARCHAR(255) ";
185     
186     public static final String JavaDoc TRANSACTION_ID = "TRANSACTION_ID";
187     public static final String JavaDoc TRANSACTION_ID_TYPE = " VARCHAR(255) ";
188     
189     public static final String JavaDoc SECURITY_ID = "SECURITY_ID";
190     public static final String JavaDoc SECURITY_ID_TYPE = " VARCHAR(255) ";
191     public static final String JavaDoc MINUS = " - ";
192     /**
193      * Create Statement for Method Start Table
194      *
195      * create table MethodStart ( REQUEST_ID VARCHAR(255) NOT_NULL, TIME_STAMP BIGINT NOT_NULL,
196      * COMPONENT_TYPE VARCHAR(20), COMPONENT_NAME VARCHAR(255),
197      * APP_NAME VARCHAR(255), METHOD_NAME VARCHAR(255), MODULE_NAME VARCHAR (255),
198      * THREAD_ID VARCHAR(255), TRANSACTION_ID VARCHAR (255), SECURITY_ID VARCHAR(255),
199      * primary key (REQUEST_ID, TIME_STAMP))
200      *
201      */

202     public static final String JavaDoc CREATE_TABLE_METHOD_START_SQL =
203             CREATE_TABLE + METHOD_START_TABLE_NAME + " ( " + REQUEST_ID +
204             REQUEST_ID_TYPE + NOT_NULL + COMMA +
205             TIME_STAMP + TIME_STAMP_TYPE + NOT_NULL + COMMA +
206             COMPONENT_TYPE + COMPONENT_TYPE_TYPE + COMMA +
207             COMPONENT_NAME + COMPONENT_NAME_TYPE + COMMA +
208             APP_NAME + APP_NAME_TYPE + COMMA +
209             METHOD_NAME + METHOD_NAME_TYPE + COMMA +
210             MODULE_NAME + MODULE_NAME_TYPE + COMMA +
211             THREAD_ID + THREAD_ID_TYPE + COMMA +
212             TRANSACTION_ID + TRANSACTION_ID_TYPE + COMMA +
213             SECURITY_ID + SECURITY_ID_TYPE + COMMA +
214             PRIMARY_KEY + " ( " + REQUEST_ID + COMMA + TIME_STAMP + ")" + ")";
215     
216     public static final String JavaDoc DROP_TABLE_METHOD_START_SQL =
217             DROP_TABLE + METHOD_START_TABLE_NAME;
218     
219     /**
220      * Update table Method Start SQL
221      */

222     public static final String JavaDoc INSERT_INTO_TABLE_METHOD_START_SQL =
223             INSERT_INTO + METHOD_START_TABLE_NAME +VALUES + " ( "+
224             " ?, ?, ?, ?, ?, ?, ?, ?, ? ,?" + " ) ";
225
226    public static final String JavaDoc DELETE_FROM_TABLE_METHOD_START_SQL =
227             DELETE + FROM + METHOD_START_TABLE_NAME + WHERE +
228             REQUEST_ID + EQUALS + " ? ";
229 //</editor-fold>
230

231     //<editor-fold defaultstate="collapsed" desc="Method End Table Info">
232
/**
233      * Method End Table Information
234      */

235     public static final String JavaDoc METHOD_END_TABLE_NAME = "METHOD_END_TBL";
236     
237     /**
238      * Column Names unique to Method End Table
239      */

240     public static final String JavaDoc EXCEPTION_NAME = "EXCEPTION_NAME";
241     public static final String JavaDoc EXCEPTION_NAME_TYPE = " VARCHAR(4096) ";
242     
243     /*
244      * Create Statement to create MethodEnd Table
245      * This does the following
246      * create table MethodEnd (REQUEST_ID VARCHAR(255) NOT NULL,
247      * TIME_STAMP BIGINT, EXCEPTION VARCHAR(4096), primary key (REQUEST_ID, TIME_STAMP))
248      */

249     public static final String JavaDoc CREATE_TABLE_METHOD_END_SQL =
250             CREATE_TABLE + METHOD_END_TABLE_NAME + " ( " + REQUEST_ID +
251             REQUEST_ID_TYPE + NOT_NULL + COMMA + TIME_STAMP +TIME_STAMP_TYPE +
252             NOT_NULL +
253             COMMA + EXCEPTION_NAME + EXCEPTION_NAME_TYPE + COMMA +
254             PRIMARY_KEY + "(" + REQUEST_ID + COMMA + TIME_STAMP + ")" +")";
255     
256     /**
257      * Drop table Request End SQL
258      */

259     public static final String JavaDoc DROP_TABLE_METHOD_END_SQL =
260             DROP_TABLE + METHOD_END_TABLE_NAME;
261     /**
262      * Update table Method End SQL
263      */

264     public static final String JavaDoc INSERT_INTO_TABLE_METHOD_END_SQL =
265             INSERT_INTO + METHOD_END_TABLE_NAME +VALUES + " ( "+
266             " ?, ?, ? " + " ) ";
267     
268    public static final String JavaDoc DELETE_FROM_TABLE_METHOD_END_SQL =
269             DELETE + FROM + METHOD_END_TABLE_NAME + WHERE +
270             REQUEST_ID + EQUALS + " ? ";
271 //</editor-fold>
272

273     //<editor-fold defaultstate="collapsed" desc="Start Time Table Info">
274
/**
275      * Start Time Table Information
276      */

277     public static final String JavaDoc START_TIME_TABLE_NAME = "START_TIME_TBL";
278     
279     /**
280      * Column Names unique to Start Time Table
281      */

282     public static final String JavaDoc CONTAINER_TYPE = "CONT_TYPE_OR_APP_TYPE";
283     public static final String JavaDoc CONTAINER_TYPE_TYPE = " VARCHAR(20) ";
284     
285     /*
286      * Create Statement to create MethodEnd Table
287      * This does the following
288      * create table START_TIME (REQUEST_ID VARCHAR(255) NOT NULL,
289      * TIME_STAMP BIGINT, CONTAINER_TYPE VARCHAR(20), primary key (REQUEST_ID, TIME_STAMP))
290      */

291     public static final String JavaDoc CREATE_TABLE_START_TIME_SQL =
292             CREATE_TABLE + START_TIME_TABLE_NAME + " ( " + REQUEST_ID +
293             REQUEST_ID_TYPE + NOT_NULL + COMMA + TIME_STAMP +TIME_STAMP_TYPE +
294             NOT_NULL +
295             COMMA + CONTAINER_TYPE + CONTAINER_TYPE_TYPE + NOT_NULL + COMMA +
296             PRIMARY_KEY + "(" + REQUEST_ID + COMMA + TIME_STAMP + COMMA + CONTAINER_TYPE + ")" +")";
297     
298     /**
299      * Drop table start time SQL
300      */

301     public static final String JavaDoc DROP_TABLE_START_TIME_SQL =
302             DROP_TABLE + START_TIME_TABLE_NAME;
303     /**
304      * Update table Start Time SQL
305      */

306     public static final String JavaDoc INSERT_INTO_TABLE_START_TIME_SQL =
307             INSERT_INTO + START_TIME_TABLE_NAME +VALUES + " ( "+
308             " ?, ?, ? " + " ) ";
309     
310    public static final String JavaDoc DELETE_FROM_TABLE_START_TIME_SQL =
311             DELETE + FROM + START_TIME_TABLE_NAME + WHERE +
312             REQUEST_ID + EQUALS + " ? ";
313 //</editor-fold>
314

315     //<editor-fold defaultstate="collapsed" desc="End Time Table Info">
316
/**
317      * End Time Table Information
318      */

319     public static final String JavaDoc END_TIME_TABLE_NAME = "END_TIME_TBL";
320     /*
321      * Create Statement to create MethodEnd Table
322      * This does the following
323      * create table END_TIME (REQUEST_ID VARCHAR(255) NOT NULL,
324      * TIME_STAMP BIGINT, CONTAINER_TYPE VARCHAR(20), primary key (REQUEST_ID, TIME_STAMP))
325      */

326     public static final String JavaDoc CREATE_TABLE_END_TIME_SQL =
327             CREATE_TABLE + END_TIME_TABLE_NAME + " ( " + REQUEST_ID +
328             REQUEST_ID_TYPE + NOT_NULL + COMMA + TIME_STAMP +TIME_STAMP_TYPE +
329             NOT_NULL +
330             COMMA + CONTAINER_TYPE + CONTAINER_TYPE_TYPE + NOT_NULL + COMMA +
331             PRIMARY_KEY + "(" + REQUEST_ID + COMMA + TIME_STAMP + COMMA + CONTAINER_TYPE +")" +")";
332     
333     /**
334      * Drop table Request End SQL
335      */

336     public static final String JavaDoc DROP_TABLE_END_TIME_SQL =
337             DROP_TABLE + END_TIME_TABLE_NAME;
338     /**
339      * Update table Start Time SQL
340      */

341     public static final String JavaDoc INSERT_INTO_TABLE_END_TIME_SQL =
342             INSERT_INTO + END_TIME_TABLE_NAME +VALUES + " ( "+
343             " ?, ?, ? " + " ) ";
344     
345    public static final String JavaDoc DELETE_FROM_TABLE_END_TIME_SQL =
346             DELETE + FROM + END_TIME_TABLE_NAME + WHERE +
347             REQUEST_ID + EQUALS + " ? ";
348 //</editor-fold>
349

350     //<editor-fold defaultstate="collapsed" desc="Queries: getRequestInformation">
351
/**
352  * select
353  * REQUEST_START_TBL.REQUEST_ID, REQUEST_START_TBL.TIME_STAMP,
354  * REQUEST_START_TBL.TIME_STAMP_MILLIS,
355  * REQUEST_START_TBL.REQUEST_TYPE,
356  * REQUEST_START_TBL.IP_ADDRESS,
357  * METHOD_START_TBL.METHOD_NAME, METHOD_START_TBL.APP_NAME,
358  * METHOD_START_TBL.SECURITY_ID, METHOD_END_TBL.EXCEPTION_NAME,
359  * REQUEST_END_TBL.TIME_STAMP - REQUEST_START_TBL.TIME_STAMP
360  *
361  * from
362  * "APP"."REQUEST_START_TBL", "APP"."REQUEST_END_TBL",
363  * "APP"."METHOD_START_TBL", "APP"."METHOD_END_TBL"
364  *
365  * WHERE
366  * REQUEST_START_TBL.REQUEST_ID=REQUEST_END_TBL.REQUEST_ID
367  * AND
368  * REQUEST_START_TBL.REQUEST_ID=METHOD_START_TBL.REQUEST_ID
369  * AND
370  * REQUEST_START_TBL.REQUEST_ID=METHOD_END_TBL.REQUEST_ID
371  *
372  * GROUP BY
373  * REQUEST_START_TBL.REQUEST_ID, REQUEST_START_TBL.TIME_STAMP,
374  * REQUEST_START_TBL.REQUEST_TYPE, METHOD_START_TBL.TIME_STAMP,
375  * REQUEST_START_TBL.TIME_STAMP_MILLIS, REQUEST_START_TBL.IP_ADDRESS,
376  * METHOD_START_TBL.METHOD_NAME, METHOD_START_TBL.APP_NAME,
377  * METHOD_START_TBL.SECURITY_ID, METHOD_END_TBL.EXCEPTION_NAME,
378  * REQUEST_END_TBL.TIME_STAMP, METHOD_END_TBL.TIME_STAMP
379  *
380  * HAVING
381  * METHOD_START_TBL.TIME_STAMP =
382  * ( SELECT MIN (METHOD_START_TBL.TIME_STAMP)
383  * FROM METHOD_START_TBL
384  * WHERE
385  * METHOD_START_TBL.REQUEST_ID = REQUEST_START_TBL.REQUEST_ID)
386  * AND
387  * METHOD_END_TBL.TIME_STAMP =
388  * ( SELECT MAX (METHOD_END_TBL.TIME_STAMP)
389  * FROM METHOD_END_TBL
390  * WHERE
391  * METHOD_END_TBL.REQUEST_ID = REQUEST_START_TBL.REQUEST_ID)
392  */

393
394     public static final String JavaDoc COLUMN_NAMES_FOR_GET_REQUEST_INFORMATION =
395             REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + COMMA +
396             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP + COMMA +
397             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP_MILLIS + COMMA +
398             REQUEST_START_TABLE_NAME + DOT + IP_ADDRESS + COMMA +
399             REQUEST_START_TABLE_NAME + DOT + REQUEST_TYPE + COMMA +
400             
401             METHOD_START_TABLE_NAME + DOT + METHOD_NAME + COMMA +
402             METHOD_START_TABLE_NAME + DOT + APP_NAME + COMMA +
403             METHOD_START_TABLE_NAME + DOT + SECURITY_ID + COMMA +
404             
405             METHOD_END_TABLE_NAME + DOT + EXCEPTION_NAME;
406     
407    public static final String JavaDoc COLUMNS_FOR_GROUP_BY_FOR_GET_REQUEST_INFORMATION =
408             REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + COMMA +
409             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP + COMMA +
410             REQUEST_START_TABLE_NAME + DOT + REQUEST_TYPE + COMMA +
411             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP_MILLIS + COMMA +
412             REQUEST_START_TABLE_NAME + DOT + IP_ADDRESS + COMMA +
413
414             METHOD_START_TABLE_NAME + DOT + TIME_STAMP + COMMA +
415             METHOD_START_TABLE_NAME + DOT + METHOD_NAME + COMMA +
416             METHOD_START_TABLE_NAME + DOT + APP_NAME + COMMA +
417             METHOD_START_TABLE_NAME + DOT + SECURITY_ID + COMMA +
418             
419             METHOD_END_TABLE_NAME + DOT + EXCEPTION_NAME + COMMA +
420             REQUEST_END_TABLE_NAME + DOT + TIME_STAMP + COMMA +
421             METHOD_END_TABLE_NAME + DOT + TIME_STAMP ;
422            ;
423            
424     public static final String JavaDoc TIME_DIFF_RS_RE =
425             REQUEST_END_TABLE_NAME + DOT + TIME_STAMP + MINUS +
426             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP;
427             ;
428
429     public static final String JavaDoc GET_REQUEST_INFORMATION_SQL =
430             SELECT +
431                 COLUMN_NAMES_FOR_GET_REQUEST_INFORMATION + COMMA +
432                 TIME_DIFF_RS_RE +
433             FROM +
434                 REQUEST_START_TABLE_NAME + COMMA + REQUEST_END_TABLE_NAME + COMMA +
435                 METHOD_START_TABLE_NAME + COMMA + METHOD_END_TABLE_NAME +
436             WHERE +
437                 REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + EQUALS +
438                 REQUEST_END_TABLE_NAME + DOT + REQUEST_ID +
439                 AND +
440                 REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + EQUALS +
441                 METHOD_START_TABLE_NAME + DOT + REQUEST_ID +
442                 AND +
443                 REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + EQUALS +
444                 METHOD_END_TABLE_NAME + DOT + REQUEST_ID +
445             GROUP_BY +
446                 COLUMNS_FOR_GROUP_BY_FOR_GET_REQUEST_INFORMATION +
447             HAVING +
448                 METHOD_START_TABLE_NAME + DOT + TIME_STAMP + EQUALS +
449                     " ( " +
450                     SELECT + MIN + " ( " + METHOD_START_TABLE_NAME + DOT + TIME_STAMP + " ) "+
451                     FROM + METHOD_START_TABLE_NAME +
452                     WHERE +
453                         METHOD_START_TABLE_NAME + DOT + REQUEST_ID + EQUALS +
454                         REQUEST_START_TABLE_NAME + DOT + REQUEST_ID +
455                     " )" + AND +
456                 METHOD_END_TABLE_NAME + DOT + TIME_STAMP + EQUALS +
457                     " ( " +
458                     SELECT+ MAX + " ( " + METHOD_END_TABLE_NAME + DOT + TIME_STAMP + " ) "+
459                     FROM + METHOD_END_TABLE_NAME +
460                     WHERE +
461                         METHOD_END_TABLE_NAME + DOT + REQUEST_ID + EQUALS +
462                         REQUEST_START_TABLE_NAME + DOT + REQUEST_ID +
463                      " )";
464                 
465       // whew
466

467                 
468             
469             
470             
471 //</editor-fold>
472

473     //<editor-fold defaultstate="collapsed" desc="Queries: getCallStackInformation">
474
/**
475      * select
476      * 'RequestStart', REQUEST_START_TBL.REQUEST_ID,
477      * REQUEST_START_TBL.TIME_STAMP AS TIMESTAMP, REQUEST_START_TBL.TIME_STAMP_MILLIS,
478      * REQUEST_START_TBL.REQUEST_TYPE , '' , '', '', '', '', '', '' , '', ''
479      * from
480      * "APP"."REQUEST_START_TBL"
481      * WHERE
482      * REQUEST_START_TBL.REQUEST_ID='?'
483      * UNION
484      *
485      * (select
486      * 'MethodStart', METHOD_START_TBL.REQUEST_ID,
487      * METHOD_START_TBL.TIME_STAMP AS TIMESTAMP, '', '', '',
488      * METHOD_START_TBL.COMPONENT_TYPE, METHOD_START_TBL.COMPONENT_NAME,
489      * METHOD_START_TBL.APP_NAME, METHOD_START_TBL.METHOD_NAME,
490      * METHOD_START_TBL.MODULE_NAME, METHOD_START_TBL.THREAD_ID,
491      * METHOD_START_TBL.TRANSACTION_ID, METHOD_START_TBL.SECURITY_ID
492      * from
493      * METHOD_START_TBL WHERE METHOD_START_TBL.REQUEST_ID='?')
494      * UNION
495      *
496      * (select
497      * 'MethodEnd', METHOD_END_TBL.REQUEST_ID,
498      * METHOD_END_TBL.TIME_STAMP AS TIMESTAMP, '', '',
499      * METHOD_END_TBL.EXCEPTION_NAME, '', '', '', '', '', '' , '', ''
500      * from
501      * METHOD_END_TBL
502      * WHERE
503      * METHOD_END_TBL.REQUEST_ID='?')
504      * UNION
505      *
506      * (select
507      * 'RequestEnd', REQUEST_END_TBL.REQUEST_ID,
508      * REQUEST_END_TBL.TIME_STAMP AS TIMESTAMP, '',
509      * '', '', '', '', '', '', '', '' , '', ''
510      * from
511      * "APP"."REQUEST_END_TBL"
512      * WHERE
513      * REQUEST_END_TBL.REQUEST_ID='?')
514      *
515      * ORDER BY TIMESTAMP
516      */

517     public static final String JavaDoc TIMESTAMP_FOR_CALLSTACK_QUERY = " TIMESTAMP ";
518     
519     public static final String JavaDoc
520       REQUEST_START_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY
521             = "'"+CallFlowMonitor.CALL_STACK_REQUEST_START +"'" + COMMA +
522             REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + COMMA +
523             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP +
524             AS + TIMESTAMP_FOR_CALLSTACK_QUERY + COMMA +
525             REQUEST_START_TABLE_NAME + DOT + REQUEST_TYPE + COMMA +
526             "''" + COMMA + "''" + COMMA + "''" + COMMA +
527             "''" + COMMA + "''" + COMMA + "''" + COMMA +
528             "''" + COMMA + "''" + COMMA + "''" + COMMA +
529             REQUEST_START_TABLE_NAME + DOT + TIME_STAMP_MILLIS;
530     
531     public static final String JavaDoc CALLSTACK_REQUEST_START_TBL_SQL =
532             SELECT +
533                 REQUEST_START_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY +
534             FROM +
535                 REQUEST_START_TABLE_NAME +
536             WHERE +
537                 REQUEST_START_TABLE_NAME + DOT + REQUEST_ID + " =?";
538     
539     public static final String JavaDoc
540       METHOD_START_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY =
541            "'"+CallFlowMonitor.CALL_STACK_METHOD_START +"'" + COMMA +
542             METHOD_START_TABLE_NAME + DOT + REQUEST_ID + COMMA +
543             METHOD_START_TABLE_NAME + DOT + TIME_STAMP +
544             AS + TIMESTAMP_FOR_CALLSTACK_QUERY + COMMA +
545             // 'requestType', 'exceptionName'
546
"''" + COMMA + "''" + COMMA +
547             METHOD_START_TABLE_NAME + DOT + COMPONENT_TYPE + COMMA +
548             METHOD_START_TABLE_NAME + DOT + COMPONENT_NAME + COMMA +
549             METHOD_START_TABLE_NAME + DOT + APP_NAME + COMMA +
550             METHOD_START_TABLE_NAME + DOT + METHOD_NAME + COMMA +
551             METHOD_START_TABLE_NAME + DOT + MODULE_NAME + COMMA +
552             METHOD_START_TABLE_NAME + DOT + THREAD_ID + COMMA +
553             METHOD_START_TABLE_NAME + DOT + TRANSACTION_ID + COMMA +
554             METHOD_START_TABLE_NAME + DOT + SECURITY_ID + COMMA + "0";
555     
556     public static final String JavaDoc CALLSTACK_METHOD_START_TBL_SQL =
557             SELECT +
558                 METHOD_START_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY +
559             FROM +
560                 METHOD_START_TABLE_NAME +
561             WHERE +
562                 METHOD_START_TABLE_NAME + DOT + REQUEST_ID + " = ?";
563        
564     public static final String JavaDoc
565       METHOD_END_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY
566             = "'"+CallFlowMonitor.CALL_STACK_METHOD_END +"'" + COMMA +
567             METHOD_END_TABLE_NAME + DOT + REQUEST_ID + COMMA +
568             METHOD_END_TABLE_NAME + DOT + TIME_STAMP +
569             AS + TIMESTAMP_FOR_CALLSTACK_QUERY + COMMA +
570             // 'requestType'
571
"''" + COMMA +
572             METHOD_END_TABLE_NAME + DOT + EXCEPTION_NAME + COMMA +
573             // 'componentType', 'componentName', 'appname', 'methodname',
574
// 'modulename', 'threadid', 'transactionid','securityid'
575
"''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA +
576             "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + "0";
577
578     
579     
580     public static final String JavaDoc CALLSTACK_METHOD_END_TBL_SQL =
581             SELECT +
582                 METHOD_END_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY +
583             FROM +
584                 METHOD_END_TABLE_NAME +
585             WHERE +
586                 METHOD_END_TABLE_NAME + DOT + REQUEST_ID + " = ?";
587   
588     public static final String JavaDoc
589       REQUEST_END_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY
590             ="'"+CallFlowMonitor.CALL_STACK_REQUEST_END +"'" + COMMA +
591             REQUEST_END_TABLE_NAME + DOT + REQUEST_ID + COMMA +
592             REQUEST_END_TABLE_NAME + DOT + TIME_STAMP +
593             AS + TIMESTAMP_FOR_CALLSTACK_QUERY + COMMA +
594             // ''requestType' , 'exceptionName',
595
"''" + COMMA + "''" + COMMA +
596             // 'componentType', 'componentName', 'appname', 'methodname',
597
// 'modulename', 'threadid', 'transactionid','securityid'
598
"''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA +
599             "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + "0";
600     
601     public static final String JavaDoc CALLSTACK_REQUEST_END_TBL_SQL =
602             SELECT +
603                 REQUEST_END_COLUMNS_FOR_GET_CALLSTACK_INFORMATION_QUERY +
604             FROM +
605                 REQUEST_END_TABLE_NAME +
606             WHERE +
607                 REQUEST_END_TABLE_NAME + DOT + REQUEST_ID + " = ?";
608     
609     public static final String JavaDoc GET_CALLSTACK_INFORMATION_SQL =
610             CALLSTACK_REQUEST_START_TBL_SQL +
611             UNION +
612             " ( " + CALLSTACK_METHOD_START_TBL_SQL + " ) " +
613             UNION +
614             " ( " + CALLSTACK_METHOD_END_TBL_SQL + " ) " +
615             UNION +
616             " ( " + CALLSTACK_REQUEST_END_TBL_SQL + " ) " +
617             ORDER_BY + TIMESTAMP_FOR_CALLSTACK_QUERY;
618     
619 //</editor-fold>
620

621     //<editor-fold defaultstate="collapsed" desc="Queries: getPieInformation">
622

623 /**
624  * select START_TIME_TBL.containerTypeOrApplicationType,
625  * SUM (START_TIME_TBL.TIME_STAMP)
626  * FROM START_TIME_TBL
627  * WHERE
628  * START_TIME_TBL.RID = 'RequestID_1'
629  * GROUP BY START_TIME_TBL.containerTypeOrApplicationType
630  *
631  */

632     public static final String JavaDoc GET_PIE_INFORMATION_START_TIME_SQL =
633             SELECT +
634                  START_TIME_TABLE_NAME + DOT + CONTAINER_TYPE + COMMA +
635                  SUM + " ( "+ START_TIME_TABLE_NAME + DOT + TIME_STAMP +" ) " +
636             FROM +
637                 START_TIME_TABLE_NAME +
638             WHERE +
639                     START_TIME_TABLE_NAME + DOT + REQUEST_ID + EQUALS + " ? " +
640            GROUP_BY + START_TIME_TABLE_NAME + DOT + CONTAINER_TYPE;
641
642 /**
643  * select END_TIME_TBL.containerTypeOrApplicationType,
644  * SUM (END_TIME_TBL.TIME_STAMP)
645  * FROM END_TIME_TBL
646  * WHERE END_TIME_TBL.RID = 'RequestID_1'
647  * GROUP BY END_TIME_TBL.containerTypeOrApplicationType
648  *
649  */

650     public static final String JavaDoc GET_PIE_INFORMATION_END_TIME_SQL =
651             SELECT +
652                  END_TIME_TABLE_NAME + DOT + CONTAINER_TYPE + COMMA +
653                  SUM + " ( "+ END_TIME_TABLE_NAME + DOT + TIME_STAMP +" ) " +
654             FROM +
655                 END_TIME_TABLE_NAME +
656             WHERE +
657                     END_TIME_TABLE_NAME + DOT + REQUEST_ID + EQUALS + " ? " +
658            GROUP_BY + END_TIME_TABLE_NAME + DOT + CONTAINER_TYPE;
659     
660   //</editor-fold>
661
}
662
Popular Tags