1 23 24 29 30 package com.sun.enterprise.admin.monitor.callflow; 31 import com.sun.appserv.management.monitor.CallFlowMonitor; 32 36 public interface TableInfo { 37 38 39 public static final String REQUEST_ID = "REQUEST_ID"; 40 public static final String REQUEST_ID_TYPE = " VARCHAR(255) "; 41 42 public static final String TIME_STAMP = "TIME_STAMP"; 43 public static final String TIME_STAMP_TYPE = " BIGINT "; 44 45 49 public static final String CREATE_TABLE = " create table "; 50 public static final String NOT_NULL = " NOT NULL "; 51 public static final String COMMA = " , "; 52 public static final String PRIMARY_KEY = " primary key "; 53 public static final String DROP_TABLE = "drop table "; 54 public static final String UPDATE = " UPDATE "; 55 public static final String INSERT_INTO = " INSERT INTO "; 56 public static final String VALUES = " VALUES "; 57 public static final String DOT = "."; 58 public static final String EQUALS = " = "; 59 public static final String HAVING = " HAVING "; 60 public static final String GROUP_BY = " GROUP BY "; 61 public static final String WHERE = " WHERE "; 62 public static final String AND = " AND "; 63 public static final String MIN = " MIN " ; 64 public static final String MAX = " MAX "; 65 public static final String SELECT = " SELECT "; 66 public static final String FROM = " FROM "; 67 public static final String AS = " AS "; 68 public static final String UNION = " UNION "; 69 public static final String ORDER_BY = " ORDER BY "; 70 public static final String SUM = " SUM "; 71 public static final String DELETE = " DELETE "; 72 74 78 public static final String REQUEST_START_TABLE_NAME = "REQUEST_START_TBL"; 79 80 public static final String REQUEST_TYPE = "REQUEST_TYPE"; 81 public static final String REQUEST_TYPE_TYPE = " VARCHAR(25) "; 82 83 public static final String TIME_STAMP_MILLIS = "TIME_STAMP_MILLIS"; 84 85 public static final String TIME_STAMP_MILLIS_TYPE = " BIGINT "; 86 87 public static final String IP_ADDRESS = "IP_ADDRESS"; 88 public static final String IP_ADDRESS_TYPE = " VARCHAR (15) "; 89 96 public static final String 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 107 public static final String DROP_TABLE_REQUEST_START_SQL = 108 DROP_TABLE + REQUEST_START_TABLE_NAME; 109 110 113 public static final String INSERT_INTO_TABLE_REQUEST_START_SQL = 114 INSERT_INTO + REQUEST_START_TABLE_NAME +VALUES + " ( "+ 115 " ?, ? , ? , ? , ?" + " ) "; 116 119 public static final String DELETE_FROM_TABLE_REQUEST_START_SQL = 120 DELETE + FROM + REQUEST_START_TABLE_NAME + WHERE + 121 REQUEST_ID + EQUALS + " ? "; 122 124 128 public static final String REQUEST_END_TABLE_NAME = "REQUEST_END_TBL"; 129 130 136 public static final String 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 144 public static final String DROP_TABLE_REQUEST_END_SQL = 145 DROP_TABLE + REQUEST_END_TABLE_NAME; 146 147 150 public static final String INSERT_INTO_TABLE_REQUEST_END_SQL = 151 INSERT_INTO + REQUEST_END_TABLE_NAME +VALUES + " ( "+ 152 " ?, ? " + " ) "; 153 154 public static final String DELETE_FROM_TABLE_REQUEST_END_SQL = 155 DELETE + FROM + REQUEST_END_TABLE_NAME + WHERE + 156 REQUEST_ID + EQUALS + " ? "; 157 159 163 public static final String METHOD_START_TABLE_NAME = "METHOD_START_TBL"; 164 165 168 public static final String COMPONENT_TYPE = "COMPONENT_TYPE"; 169 public static final String COMPONENT_TYPE_TYPE = " VARCHAR(30) "; 170 171 public static final String COMPONENT_NAME = "COMPONENT_NAME"; 172 public static final String COMPONENT_NAME_TYPE = " VARCHAR(255) "; 173 174 public static final String APP_NAME = "APP_NAME"; 175 public static final String APP_NAME_TYPE = " VARCHAR(255) "; 176 177 public static final String METHOD_NAME = "METHOD_NAME"; 178 public static final String METHOD_NAME_TYPE = " VARCHAR(255) "; 179 180 public static final String MODULE_NAME = "MODULE_NAME"; 181 public static final String MODULE_NAME_TYPE = " VARCHAR(255) "; 182 183 public static final String THREAD_ID = "THREAD_ID"; 184 public static final String THREAD_ID_TYPE = " VARCHAR(255) "; 185 186 public static final String TRANSACTION_ID = "TRANSACTION_ID"; 187 public static final String TRANSACTION_ID_TYPE = " VARCHAR(255) "; 188 189 public static final String SECURITY_ID = "SECURITY_ID"; 190 public static final String SECURITY_ID_TYPE = " VARCHAR(255) "; 191 public static final String MINUS = " - "; 192 202 public static final String 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 DROP_TABLE_METHOD_START_SQL = 217 DROP_TABLE + METHOD_START_TABLE_NAME; 218 219 222 public static final String INSERT_INTO_TABLE_METHOD_START_SQL = 223 INSERT_INTO + METHOD_START_TABLE_NAME +VALUES + " ( "+ 224 " ?, ?, ?, ?, ?, ?, ?, ?, ? ,?" + " ) "; 225 226 public static final String DELETE_FROM_TABLE_METHOD_START_SQL = 227 DELETE + FROM + METHOD_START_TABLE_NAME + WHERE + 228 REQUEST_ID + EQUALS + " ? "; 229 231 235 public static final String METHOD_END_TABLE_NAME = "METHOD_END_TBL"; 236 237 240 public static final String EXCEPTION_NAME = "EXCEPTION_NAME"; 241 public static final String EXCEPTION_NAME_TYPE = " VARCHAR(4096) "; 242 243 249 public static final String 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 259 public static final String DROP_TABLE_METHOD_END_SQL = 260 DROP_TABLE + METHOD_END_TABLE_NAME; 261 264 public static final String INSERT_INTO_TABLE_METHOD_END_SQL = 265 INSERT_INTO + METHOD_END_TABLE_NAME +VALUES + " ( "+ 266 " ?, ?, ? " + " ) "; 267 268 public static final String DELETE_FROM_TABLE_METHOD_END_SQL = 269 DELETE + FROM + METHOD_END_TABLE_NAME + WHERE + 270 REQUEST_ID + EQUALS + " ? "; 271 273 277 public static final String START_TIME_TABLE_NAME = "START_TIME_TBL"; 278 279 282 public static final String CONTAINER_TYPE = "CONT_TYPE_OR_APP_TYPE"; 283 public static final String CONTAINER_TYPE_TYPE = " VARCHAR(20) "; 284 285 291 public static final String 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 301 public static final String DROP_TABLE_START_TIME_SQL = 302 DROP_TABLE + START_TIME_TABLE_NAME; 303 306 public static final String INSERT_INTO_TABLE_START_TIME_SQL = 307 INSERT_INTO + START_TIME_TABLE_NAME +VALUES + " ( "+ 308 " ?, ?, ? " + " ) "; 309 310 public static final String DELETE_FROM_TABLE_START_TIME_SQL = 311 DELETE + FROM + START_TIME_TABLE_NAME + WHERE + 312 REQUEST_ID + EQUALS + " ? "; 313 315 319 public static final String END_TIME_TABLE_NAME = "END_TIME_TBL"; 320 326 public static final String 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 336 public static final String DROP_TABLE_END_TIME_SQL = 337 DROP_TABLE + END_TIME_TABLE_NAME; 338 341 public static final String INSERT_INTO_TABLE_END_TIME_SQL = 342 INSERT_INTO + END_TIME_TABLE_NAME +VALUES + " ( "+ 343 " ?, ?, ? " + " ) "; 344 345 public static final String DELETE_FROM_TABLE_END_TIME_SQL = 346 DELETE + FROM + END_TIME_TABLE_NAME + WHERE + 347 REQUEST_ID + EQUALS + " ? "; 348 350 393 394 public static final String 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 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 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 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 467 468 469 470 471 473 517 public static final String TIMESTAMP_FOR_CALLSTACK_QUERY = " TIMESTAMP "; 518 519 public static final String 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 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 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 "''" + 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 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 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 "''" + COMMA + 572 METHOD_END_TABLE_NAME + DOT + EXCEPTION_NAME + COMMA + 573 "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + 576 "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + "0"; 577 578 579 580 public static final String 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 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 "''" + COMMA + "''" + COMMA + 596 "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + 599 "''" + COMMA + "''" + COMMA + "''" + COMMA + "''" + COMMA + "0"; 600 601 public static final String 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 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 621 623 632 public static final String 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 650 public static final String 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 } 662 | Popular Tags |