diff --git a/src/main/java/org/usf/trace/api/server/ApiController.java b/src/main/java/org/usf/trace/api/server/ApiController.java index 7f9ee5a..dc32bec 100644 --- a/src/main/java/org/usf/trace/api/server/ApiController.java +++ b/src/main/java/org/usf/trace/api/server/ApiController.java @@ -74,7 +74,6 @@ public List getIncomingRequestByCriteria( @RequestParam(required = false, name = "start") Instant start, @RequestParam(required = false, name = "end") Instant end ){ // without tree FilterCriteria fc = new FilterCriteria(id,name,env,port,null,start,end); - System.out.println(fc.toString()); return dao.getIncomingRequestByCriteria(lazy,fc); } diff --git a/src/main/java/org/usf/trace/api/server/config/DataConstants.java b/src/main/java/org/usf/trace/api/server/config/DataConstants.java index b27dd8c..910f49a 100644 --- a/src/main/java/org/usf/trace/api/server/config/DataConstants.java +++ b/src/main/java/org/usf/trace/api/server/config/DataConstants.java @@ -20,118 +20,118 @@ public final class DataConstants { public static String sessionColumns(TraceApiColumn column) { switch (column) { - case ID: return "ID_SES"; - case NAME: return "VA_NAME"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case USER: return "VA_USR"; - case OS: return "VA_OS"; - case RE: return "VA_RE"; - case TYPE: return "LNCH"; - case LOCATION: return "LOC"; - case THREAD: return "VA_THRED"; - case APP_NAME: return "VA_APP_NME"; - case VERSION: return "VA_VRS"; - case ADDRESS: return "VA_ADRS"; - case ENVIRONEMENT: return "VA_ENV"; - case ERR_TYPE: return "VA_ERR_CLS"; - case ERR_MSG: return "VA_ERR_MSG"; + case ID: return "id_ses"; + case NAME: return "va_name"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case USER: return "va_usr"; + case OS: return "va_os"; + case RE: return "va_re"; + case TYPE: return "lnch"; + case LOCATION: return "loc"; + case THREAD: return "va_thred"; + case APP_NAME: return "va_app_nme"; + case VERSION: return "va_vrs"; + case ADDRESS: return "va_adrs"; + case ENVIRONEMENT: return "va_env"; + case ERR_TYPE: return "va_err_cls"; + case ERR_MSG: return "va_err_msg"; default: return null; } } public static String incReqColumns(TraceApiColumn column) { switch (column) { - case ID: return "ID_SES"; - case METHOD: return "VA_MTH"; - case PROTOCOL: return "VA_PRTCL"; - case HOST: return "VA_HST"; - case PORT: return "CD_PRT"; - case PATH: return "VA_PTH"; - case QUERY: return "VA_QRY"; - case MEDIA: return "VA_CNT_TYP"; - case AUTH: return "VA_AUTH"; - case STATUS: return "CD_STT"; - case SIZE_IN: return "VA_I_SZE"; - case SIZE_OUT: return "VA_O_SZE"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case THREAD: return "VA_THRED"; - case API_NAME: return "VA_API_NME"; - case USER: return "VA_USR"; - case APP_NAME: return "VA_APP_NME"; - case VERSION: return "VA_VRS"; - case ADDRESS: return "VA_ADRS"; - case ENVIRONEMENT: return "VA_ENV"; - case OS: return "VA_OS"; - case RE: return "VA_RE"; + case ID: return "id_ses"; + case METHOD: return "va_mth"; + case PROTOCOL: return "va_prtcl"; + case HOST: return "va_hst"; + case PORT: return "cd_prt"; + case PATH: return "va_pth"; + case QUERY: return "va_qry"; + case MEDIA: return "va_cnt_typ"; + case AUTH: return "va_auth"; + case STATUS: return "cd_stt"; + case SIZE_IN: return "va_i_sze"; + case SIZE_OUT: return "va_o_sze"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case THREAD: return "va_thred"; + case API_NAME: return "va_api_nme"; + case USER: return "va_usr"; + case APP_NAME: return "va_app_nme"; + case VERSION: return "va_vrs"; + case ADDRESS: return "va_adrs"; + case ENVIRONEMENT: return "va_env"; + case OS: return "va_os"; + case RE: return "va_re"; default: return null; } } public static String outReqColumns(TraceApiColumn column) { switch (column) { - case ID: return "CD_API"; - case METHOD: return "VA_MTH"; - case PROTOCOL: return "VA_PRTCL"; - case HOST: return "VA_HST"; - case PORT: return "CD_PRT"; - case PATH: return "VA_PTH"; - case QUERY: return "VA_QRY"; - case MEDIA: return "VA_CNT_TYP"; - case AUTH: return "VA_AUTH"; - case STATUS: return "CD_STT"; - case SIZE_IN: return "VA_I_SZE"; - case SIZE_OUT: return "VA_O_SZE"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case THREAD: return "VA_THRED"; - case PARENT: return "CD_SES"; + case ID: return "cd_api"; + case METHOD: return "va_mth"; + case PROTOCOL: return "va_prtcl"; + case HOST: return "va_hst"; + case PORT: return "cd_prt"; + case PATH: return "va_pth"; + case QUERY: return "va_qry"; + case MEDIA: return "va_cnt_typ"; + case AUTH: return "va_auth"; + case STATUS: return "cd_stt"; + case SIZE_IN: return "va_i_sze"; + case SIZE_OUT: return "va_o_sze"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case THREAD: return "va_thred"; + case PARENT: return "cd_ses"; default: return null; } } public static String outQryColumns(TraceApiColumn column) { switch (column){ - case ID: return "ID_OUT_QRY"; - case HOST: return "VA_HST"; - case PORT: return "CD_PRT"; - case SCHEMA: return "VA_SCHMA"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case USER: return "VA_USR"; - case THREAD: return "VA_THRED"; - case DRIVER: return "VA_DRV"; - case DB_NAME: return "VA_DB_NME"; - case DB_VERSION: return "VA_DB_VRS"; - case COMPLETE: return "VA_CMPLT"; - case PARENT: return "CD_SES"; + case ID: return "id_out_qry"; + case HOST: return "va_hst"; + case PORT: return "cd_prt"; + case SCHEMA: return "va_schma"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case USER: return "va_usr"; + case THREAD: return "va_thred"; + case DRIVER: return "va_drv"; + case DB_NAME: return "va_db_nme"; + case DB_VERSION: return "va_db_vrs"; + case COMPLETE: return "va_cmplt"; + case PARENT: return "cd_ses"; default: return null; } } public static String outStgColumns(TraceApiColumn column) { switch (column){ - case NAME: return "VA_NAME"; - case LOCATION: return "LOC"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case USER: return "VA_USR"; - case THREAD: return "VA_THRED"; - case ERR_TYPE: return "VA_ERR_CLS"; - case ERR_MSG: return "VA_ERR_MSG"; - case PARENT: return "CD_SES"; - default: return null; + case NAME: return "va_name"; + case LOCATION: return "loc"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case USER: return "va_usr"; + case THREAD: return "va_thred"; + case ERR_TYPE: return "va_err_cls"; + case ERR_MSG: return "va_err_msg"; + case PARENT: return "cd_ses"; + default: return null; } } public static String dbActColumns(TraceApiColumn column){ switch (column){ - case TYPE: return"VA_TYP"; - case START: return "DH_DBT"; - case END: return "DH_FIN"; - case ERR_TYPE: return "VA_ERR_CLS"; - case ERR_MSG: return "VA_ERR_MSG"; - case PARENT: return "CD_OUT_QRY"; + case TYPE: return "va_typ"; + case START: return "dh_dbt"; + case END: return "dh_fin"; + case ERR_TYPE: return "va_err_cls"; + case ERR_MSG: return "va_err_msg"; + case PARENT: return "cd_out_qry"; default: return null; } } diff --git a/src/main/java/org/usf/trace/api/server/config/TraceApiTable.java b/src/main/java/org/usf/trace/api/server/config/TraceApiTable.java index dc9236c..f58d65b 100644 --- a/src/main/java/org/usf/trace/api/server/config/TraceApiTable.java +++ b/src/main/java/org/usf/trace/api/server/config/TraceApiTable.java @@ -14,12 +14,12 @@ @RequiredArgsConstructor public enum TraceApiTable implements TableDecorator { - OUT("E_API_REQ", DataConstants::outReqColumns), - REQUEST("E_API_SES", DataConstants::incReqColumns), - SESSION("E_MAIN_SES", DataConstants::sessionColumns), - QUERY("E_DB_REQ",DataConstants::outQryColumns), - STAGES("E_STG",DataConstants::outStgColumns), - DBACTION("E_DB_ACT",DataConstants::dbActColumns); + OUT("e_api_req", DataConstants::outReqColumns), + REQUEST("e_api_ses", DataConstants::incReqColumns), + SESSION("e_main_ses", DataConstants::sessionColumns), + QUERY("e_db_req",DataConstants::outQryColumns), + STAGES("e_stg",DataConstants::outStgColumns), + DBACTION("e_db_act",DataConstants::dbActColumns); @NonNull private final String tableName; diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 8af3763..6b8b59d 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -1,105 +1,105 @@ -CREATE TABLE IF NOT EXISTS "E_MAIN_SES" ( - "ID_SES" VARCHAR PRIMARY KEY, - "VA_NAME" VARCHAR, - "VA_USR" VARCHAR, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "LNCH" VARCHAR, - "LOC" VARCHAR, - "VA_THRED" VARCHAR, - "VA_APP_NME" VARCHAR, - "VA_VRS" VARCHAR, - "VA_ADRS" VARCHAR, - "VA_ENV" VARCHAR, - "VA_OS" VARCHAR, - "VA_RE" VARCHAR, - "VA_ERR_CLS" VARCHAR, - "VA_ERR_MSG" VARCHAR +CREATE TABLE IF NOT EXISTS E_MAIN_SES ( + ID_SES VARCHAR PRIMARY KEY, + VA_NAME VARCHAR, + VA_USR VARCHAR, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + LNCH VARCHAR, + LOC VARCHAR, + VA_THRED VARCHAR, + VA_APP_NME VARCHAR, + VA_VRS VARCHAR, + VA_ADRS VARCHAR, + VA_ENV VARCHAR, + VA_OS VARCHAR, + VA_RE VARCHAR, + VA_ERR_CLS VARCHAR, + VA_ERR_MSG VARCHAR ); -CREATE TABLE IF NOT EXISTS "E_API_SES" ( - "ID_SES" VARCHAR PRIMARY KEY, - "VA_MTH" VARCHAR, - "VA_PRTCL" VARCHAR, - "VA_HST" VARCHAR, - "CD_PRT" INT, - "VA_PTH" VARCHAR, - "VA_QRY" VARCHAR, - "VA_CNT_TYP" VARCHAR, - "VA_AUTH" VARCHAR, - "CD_STT" INT, - "VA_I_SZE" BIGINT, - "VA_O_SZE" BIGINT, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "VA_THRED" VARCHAR, - "VA_ERR_CLS" VARCHAR, - "VA_ERR_MSG" VARCHAR, - "VA_API_NME" VARCHAR, - "VA_USR" VARCHAR, - "VA_APP_NME" VARCHAR, - "VA_VRS" VARCHAR, - "VA_ADRS" VARCHAR, - "VA_ENV" VARCHAR, - "VA_OS" VARCHAR, - "VA_RE" VARCHAR +CREATE TABLE IF NOT EXISTS E_API_SES ( + ID_SES VARCHAR PRIMARY KEY, + VA_MTH VARCHAR, + VA_PRTCL VARCHAR, + VA_HST VARCHAR, + CD_PRT INT, + VA_PTH VARCHAR, + VA_QRY VARCHAR, + VA_CNT_TYP VARCHAR, + VA_AUTH VARCHAR, + CD_STT INT, + VA_I_SZE BIGINT, + VA_O_SZE BIGINT, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + VA_THRED VARCHAR, + VA_ERR_CLS VARCHAR, + VA_ERR_MSG VARCHAR, + VA_API_NME VARCHAR, + VA_USR VARCHAR, + VA_APP_NME VARCHAR, + VA_VRS VARCHAR, + VA_ADRS VARCHAR, + VA_ENV VARCHAR, + VA_OS VARCHAR, + VA_RE VARCHAR ); -CREATE TABLE IF NOT EXISTS "E_API_REQ" ( - "VA_MTH" VARCHAR, - "VA_PRTCL" VARCHAR, - "VA_HST" VARCHAR, - "CD_PRT" INT, - "VA_PTH" VARCHAR, - "VA_QRY" VARCHAR, - "VA_CNT_TYP" VARCHAR, - "VA_AUTH" VARCHAR, - "CD_STT" INT, - "VA_I_SZE" BIGINT, - "VA_O_SZE" BIGINT, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "VA_THRED" VARCHAR, - "VA_ERR_CLS" VARCHAR, - "VA_ERR_MSG" VARCHAR, - "CD_SES" VARCHAR, -- Parent - "CD_API" VARCHAR -- NUll +CREATE TABLE IF NOT EXISTS E_API_REQ ( + VA_MTH VARCHAR, + VA_PRTCL VARCHAR, + VA_HST VARCHAR, + CD_PRT INT, + VA_PTH VARCHAR, + VA_QRY VARCHAR, + VA_CNT_TYP VARCHAR, + VA_AUTH VARCHAR, + CD_STT INT, + VA_I_SZE BIGINT, + VA_O_SZE BIGINT, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + VA_THRED VARCHAR, + VA_ERR_CLS VARCHAR, + VA_ERR_MSG VARCHAR, + CD_SES VARCHAR, -- Parent + CD_API VARCHAR -- NUll ); -CREATE TABLE IF NOT EXISTS "E_DB_REQ" ( - "ID_OUT_QRY" BIGINT, - "VA_HST" VARCHAR, - "CD_PRT" INT, - "VA_SCHMA" VARCHAR, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "VA_USR" VARCHAR, - "VA_THRED" VARCHAR, - "VA_DRV" VARCHAR, - "VA_DB_NME" VARCHAR, - "VA_DB_VRS" VARCHAR, - "VA_CMPLT" CHAR, - "CD_SES" VARCHAR +CREATE TABLE IF NOT EXISTS E_DB_REQ ( + ID_OUT_QRY BIGINT, + VA_HST VARCHAR, + CD_PRT INT, + VA_SCHMA VARCHAR, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + VA_USR VARCHAR, + VA_THRED VARCHAR, + VA_DRV VARCHAR, + VA_DB_NME VARCHAR, + VA_DB_VRS VARCHAR, + VA_CMPLT CHAR, + CD_SES VARCHAR ); -CREATE TABLE IF NOT EXISTS "E_STG" ( - "VA_NAME" VARCHAR, - "LOC" VARCHAR, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "VA_USR" VARCHAR, - "VA_THRED" VARCHAR, - "VA_ERR_CLS" VARCHAR, - "VA_ERR_MSG" VARCHAR, - "CD_SES" VARCHAR +CREATE TABLE IF NOT EXISTS E_STG ( + VA_NAME VARCHAR, + LOC VARCHAR, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + VA_USR VARCHAR, + VA_THRED VARCHAR, + VA_ERR_CLS VARCHAR, + VA_ERR_MSG VARCHAR, + CD_SES VARCHAR ); -CREATE TABLE IF NOT EXISTS "E_DB_ACT" ( - "VA_TYP" VARCHAR, - "DH_DBT" TIMESTAMP(3), - "DH_FIN" TIMESTAMP(3), - "VA_ERR_CLS" VARCHAR, - "VA_ERR_MSG" VARCHAR, - "CD_OUT_QRY" BIGINT +CREATE TABLE IF NOT EXISTS E_DB_ACT ( + VA_TYP VARCHAR, + DH_DBT TIMESTAMP(3), + DH_FIN TIMESTAMP(3), + VA_ERR_CLS VARCHAR, + VA_ERR_MSG VARCHAR, + CD_OUT_QRY BIGINT );