# Name   : ndi_crt_confui_tbl_def_val.sh 
# Author : Jitesh Sehgal
# Usage  : ndi_crt_confui_tbl_def_val.sh
#          This shell will create tables in config schema for configui and insert default values in those tables.

FILE="$NS_WDIR/.ndi_crt_confui_tbl_def_val.logs"

CONTROLLER_NAME=`echo $NS_WDIR |cut -d '/' -f4 | tr '[:upper:]' '[:lower:]'`

if [ -f $FILE ]
then
  rm -f $FILE
fi

show_error()
{
  echo $Error | grep "ERROR" >/dev/null
  if [ $? == 0  ]; then
    echo $Error| sed 's/ERROR/\nERROR/g'>>$FILE
    #exit 1
  fi
}

#Create Clone of config and Replace with Controller Based Schema if Controller based schema does not exist
Schema_Name=$(psql --user=cavisson -d test -t --no-align -c "select schema_name from information_schema.schemata WHERE schema_name = 'config_$CONTROLLER_NAME';")
if [ "$Schema_Name" != "config_$CONTROLLER_NAME" ]
then
table_Name=($(psql --user=cavisson -d test -t --no-align -c "select table_name from information_schema.tables where table_schema = 'config';"))
Error=`psql test postgres 2>&1<<+ 
CREATE SCHEMA config_$CONTROLLER_NAME;
+`  
for tableName in $table_Name
do  
Error=`psql test cavisson 2>&1<<+
create table config_$CONTROLLER_NAME.$tableName (like config.$tableName including all);
insert into config_$CONTROLLER_NAME.$tableName select * from config.$tableName;
+`
done
fi

#This will make connection with postgres and create schema config and grant permission to cavisson database user
Error=`psql test postgres 2>&1<<+
CREATE SCHEMA config_$CONTROLLER_NAME;
GRANT ALL PRIVILEGES ON SCHEMA config_$CONTROLLER_NAME TO cavisson;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA config_$CONTROLLER_NAME TO cavisson;
+`
show_error

#This will make connection with postgres and create schema hibernate_sequence if not already exist.
Error=`psql test postgres 2>&1<<+
CREATE SEQUENCE hibernate_sequence START WITH 1 INCREMENT BY 1 NO CYCLE;
+`
show_error

#This will make connection with postgres and create schema hibernate_sequence if not already exist.
Error=`psql test postgres 2>&1<<+
CREATE SEQUENCE config_$CONTROLLER_NAME.hibernate_sequence START WITH 1 INCREMENT BY 1 NO CYCLE;
+`    
show_error

#This will grant privilege for  hibernate_sequence to cavisson user
Error=`psql test postgres 2>&1<<+
GRANT ALL PRIVILEGES ON SEQUENCE config_$CONTROLLER_NAME.hibernate_sequence to cavisson;
+`
show_error

#This will make connection with postgres with cavisson user and create tables in config schema
Error=`psql test cavisson 2>&1<<+

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.application
(
  app_id bigint NOT NULL,
  app_desc character varying(255),
  app_name character varying(255),
  time_stamp character varying(255),
  user_name character varying(255),
  controller_name character varying(255),
  CONSTRAINT application_pk PRIMARY KEY (app_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.backend_type
(
  backend_type_id bigint NOT NULL,
  backend_type_detail character varying(255),
  backend_type_name character varying(255),
  backend_type_name_entrypointsfile character varying(255),
  backend_type_name_rulefile character varying(255),
  agent character varying(255),
  CONSTRAINT backend_type_pk PRIMARY KEY (backend_type_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.backend_points
(
  end_point_id bigint NOT NULL,
  end_point_desc character varying(255),
  end_point_fqm character varying(4096),
  end_point_name character varying(255),
  backend_type_id bigint,
  custom_entry boolean,
  agent character varying(255),
  module character varying(255),
  argument_index bigint,
  CONSTRAINT backend_points_pk PRIMARY KEY (end_point_id),
  CONSTRAINT be_points_be_type_id_fk FOREIGN KEY (backend_type_id)
      REFERENCES config_$CONTROLLER_NAME.backend_type (backend_type_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile
(
  profile_id bigint NOT NULL,
  profile_desc character varying(255),
  profile_name character varying(255),
  time_stamp character varying(255),
  user_name character varying(255),
  controller_name character varying(255),
  agent character varying(255),
  CONSTRAINT profile_pk PRIMARY KEY (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_pattern
(
  bt_pattern_id bigint NOT NULL,
  bt_name character varying(255),
  dynamic_part_req boolean,
  include character varying(255),
  match_type character varying(255),
  mode character varying(255),
  req_hdr_key character varying(255),
  req_hdr_val character varying(255),
  req_header_key_value character varying(255),
  req_method character varying(255),
  req_param_key character varying(255),
  req_param_val character varying(255),
  req_param_key_value character varying(255),
  slow_transaction bigint,
  url_name character varying(255),
  very_slow_transaction bigint,
  profile_id bigint,
  slow_threshold character varying(255),
  very_slow_threshold character varying(255),
  agent character varying(255),
  bt_id bigint NOT NULL,
  parent_bt_id bigint,
  is_tx_async bigint,
  CONSTRAINT bt_pattern_pk PRIMARY KEY (bt_pattern_id),
  CONSTRAINT bt_pat_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bussiness_trans_global
(
  bt_global_id bigint NOT NULL,
  complete boolean,
  dynamic_req_type boolean,
  dynamic_req_value character varying(255),
  http_method boolean,
  request_header character varying(255),
  request_param character varying(255),
  segment_type character varying(255),
  segment_uri boolean,
  segment_value character varying(255),
  slow_transaction character varying(255),
  uri_type character varying(255),
  very_slow_transaction character varying(255),
  profile_id bigint,
  slow_threshold character varying(255),
  very_slow_threshold character varying(255),
  segment_no character varying(255),
  CONSTRAINT bussiness_trans_global_pk PRIMARY KEY (bt_global_id),
  CONSTRAINT bus_trans_global_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.value_type
(
  val_id bigint NOT NULL,
  val_type character varying(255),
  CONSTRAINT value_type_pk PRIMARY KEY (val_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.conditional_operator
(
  opt_id bigint NOT NULL,
  operators character varying(255),
  val_id bigint,
  CONSTRAINT conditional_operator_pk PRIMARY KEY (opt_id),
  CONSTRAINT cond_opt_val_id_fk FOREIGN KEY (val_id)
      REFERENCES config_$CONTROLLER_NAME.value_type (val_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dc_detail
(
  dc_id bigint NOT NULL,
  dc_desc character varying(255),
  dc_ip character varying(255),
  dc_name character varying(255),
  dc_port character varying(255),
  nde_ip character varying(255),
  nde_port character varying(255),
  app_id bigint,
  CONSTRAINT dc_detail_pk PRIMARY KEY (dc_id),
  CONSTRAINT dc_detail_app_id_fk FOREIGN KEY (app_id)
      REFERENCES config_$CONTROLLER_NAME.application (app_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.topo_details
(
  topo_id bigint NOT NULL,
  topo_desc character varying(255),
  topo_name character varying(255),
  controller_name character varying(255),
  time_stamp character varying(255),
  CONSTRAINT topo_details_pk PRIMARY KEY (topo_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dc_topo_asso
(
  dc_topo_id bigint NOT NULL,
  topo_state boolean,
  dc_id bigint,
  topo_id bigint,
  CONSTRAINT dc_topo_asso_pk PRIMARY KEY (dc_topo_id),
  CONSTRAINT dc_top_asso_topo_id_fk FOREIGN KEY (topo_id)
      REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id),
  CONSTRAINT dc_top_asso_dc_id_fk FOREIGN KEY (dc_id)
      REFERENCES config_$CONTROLLER_NAME.dc_detail (dc_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.entry_type
(
  entry_type_id bigint NOT NULL,
  entry_type_detail character varying(255),
  entry_type_name character varying(255),
  CONSTRAINT entry_type_pk PRIMARY KEY (entry_type_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.error_detection
(
  err_detection_id bigint NOT NULL,
  enable boolean,
  error_from character varying(255),
  error_to character varying(255),
  rule_desc character varying(255),
  rule_name character varying(255),
  profile_id bigint,
  CONSTRAINT error_detection_pk PRIMARY KEY (err_detection_id),
  CONSTRAINT err_det_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.headers_type
(
  ht_id bigint NOT NULL,
  header_type_name character varying(255),
  CONSTRAINT headers_type_pk PRIMARY KEY (ht_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.headers_meta_data
(
  hmd_id bigint NOT NULL,
  header_name character varying(255),
  ht_id bigint,
  CONSTRAINT headers_meta_data_pk PRIMARY KEY (hmd_id),
  CONSTRAINT headr_mdata_ht_id_fk FOREIGN KEY (ht_id)
      REFERENCES config_$CONTROLLER_NAME.headers_type (ht_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.http_stats_condition
(
  hsc_id bigint NOT NULL,
  comparison_value character varying(255),
  condition character varying(255),
  condition_name character varying(255),
  cookie_name character varying(255),
  description character varying(255),
  fp_dump_mode bigint,
  ht_id bigint,
  hmd_id bigint,
  opt_id bigint,
  profile_id bigint,
  val_id bigint,
  CONSTRAINT http_stats_condition_pk PRIMARY KEY (hsc_id),
  CONSTRAINT ht_stats_cond_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT ht_stats_cond_ht_id_fk FOREIGN KEY (ht_id)
      REFERENCES config_$CONTROLLER_NAME.headers_type (ht_id),
  CONSTRAINT ht_stats_cond_opt_id_fk FOREIGN KEY (opt_id)
      REFERENCES config_$CONTROLLER_NAME.conditional_operator (opt_id),
  CONSTRAINT ht_stats_cond_hmd_id_fk FOREIGN KEY (hmd_id)
      REFERENCES config_$CONTROLLER_NAME.headers_meta_data (hmd_id),
  CONSTRAINT ht_stats_cond_val_id_fk FOREIGN KEY (val_id)
      REFERENCES config_$CONTROLLER_NAME.value_type (val_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.tier_group
(
    tier_group_id bigint NOT NULL,
    tier_group_desc character varying(255),
    tier_group_name character varying(255),
    type character varying(255),
    username character varying(255),
    topo_id bigint,
    CONSTRAINT tier_group_pkey PRIMARY KEY (tier_group_id),
    CONSTRAINT tier_group_topo_id_fk FOREIGN KEY (topo_id)
        REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.tier
(
  tier_id bigint NOT NULL,
  tier_desc character varying(255),
  tier_file_id bigint,
  tier_name character varying(255),
  topo_id bigint,
  active boolean,
  CONSTRAINT tier_pk PRIMARY KEY (tier_id),
  CONSTRAINT tier_topo_id_fk FOREIGN KEY (topo_id)
      REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.server
(
  server_id bigint NOT NULL,
  server_desc character varying(255),
  server_display_name character varying(255),
  server_file_id bigint,
  server_name character varying(255),
  tier_id bigint,
  topo_id bigint,
  CONSTRAINT server_pk PRIMARY KEY (server_id),
  CONSTRAINT server_tier_id_fk FOREIGN KEY (tier_id)
      REFERENCES config_$CONTROLLER_NAME.tier (tier_id),
  CONSTRAINT server_topo_id_fk FOREIGN KEY (topo_id)
      REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.instance
(
  instance_id bigint NOT NULL,
  enabled boolean,
  instance_desc character varying(255),
  instance_display_name character varying(255),
  instance_file_id bigint,
  instance_name character varying(255),
  server_id bigint,
  tier_id bigint,
  topo_id bigint,
  instance_type character varying(255),
  ai_enable boolean,
  CONSTRAINT instance_pk PRIMARY KEY (instance_id),
  CONSTRAINT instance_server_id_fk FOREIGN KEY (server_id)
      REFERENCES config_$CONTROLLER_NAME.server (server_id),
  CONSTRAINT instance_tier_id_fk FOREIGN KEY (tier_id)
      REFERENCES config_$CONTROLLER_NAME.tier (tier_id),
  CONSTRAINT instance_topo_id_fk FOREIGN KEY (topo_id)
      REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.keywords_meta_data
(
  kmd_id bigint NOT NULL,
  key_type character varying(255),
  key_type_id bigint,
  CONSTRAINT keywords_meta_data_pk PRIMARY KEY (kmd_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.keywords
(
  key_id bigint NOT NULL,
  key_def_value character varying(255),
  key_desc character varying(255),
  key_name character varying(255),
  key_max character varying(255),
  key_min character varying(255),
  kmd_id bigint,
  type character varying(255),
  agent_mode character varying(255),
  CONSTRAINT keywords_pk PRIMARY KEY (key_id),
  CONSTRAINT keywords_kmd_id_fk FOREIGN KEY (kmd_id)
      REFERENCES config_$CONTROLLER_NAME.keywords_meta_data (kmd_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.method_monitors
(
  method_id bigint NOT NULL,
  method_desc character varying(255),
  method_display_name character varying(255),
  method_name character varying(750),
  profile_id bigint,
  module character varying(255),
  agent character varying(50),
  CONSTRAINT method_monitors_pk PRIMARY KEY (method_id),
  CONSTRAINT met_mon_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso
(
  assoc_id bigint NOT NULL,
  databaseproduct_name boolean,
  databaseproduct_version boolean,
  driver_name boolean,
  driver_version boolean,
  host boolean,
  port boolean,
  prefix boolean,
  query boolean,
  service_name boolean,
  table_name boolean,
  topic_name boolean,
  url boolean,
  user_name boolean,
  backend_type_id bigint,
  profile_id bigint,
  CONSTRAINT naming_rule_profile_backendtype_asso_pk PRIMARY KEY (assoc_id),
  CONSTRAINT nam_rule_prof_betype_asso_be_type_id_fk FOREIGN KEY (backend_type_id)
      REFERENCES config_$CONTROLLER_NAME.backend_type (backend_type_id),
  CONSTRAINT nam_rule_prof_betype_asso_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile_backend_point_asso
(
  assoc_id bigint NOT NULL,
  enabled boolean,
  end_point_id bigint,
  profile_id bigint,
  CONSTRAINT profile_backend_point_asso_pk PRIMARY KEY (assoc_id),
  CONSTRAINT prof_be_point_asso_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT prof_be_point_asso_end_point_id_fk FOREIGN KEY (end_point_id)
      REFERENCES config_$CONTROLLER_NAME.backend_points (end_point_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile_keywords
(
  key_value_index bigint NOT NULL,
  key_value character varying(4000),
  key_id bigint,
  profile_id bigint,
  enable character varying(255),
  CONSTRAINT profile_keywords_pk PRIMARY KEY (key_value_index),
  CONSTRAINT prof_key_key_id_fk FOREIGN KEY (key_id)
      REFERENCES config_$CONTROLLER_NAME.keywords (key_id),
  CONSTRAINT prof_key_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.service_entry_points
(
  entry_id bigint NOT NULL,
  entry_desc character varying(255),
  entry_fqm character varying(4096),
  entry_name character varying(255),
  entry_type_id bigint,
  custom_entry boolean,
  agent character varying(255),
  module character varying(255),
  CONSTRAINT service_entry_points_pk PRIMARY KEY (entry_id),
  CONSTRAINT ser_ent_points_ent_type_id_fk FOREIGN KEY (entry_type_id)
      REFERENCES config_$CONTROLLER_NAME.entry_type (entry_type_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile_service_entry_asso
(
  prof_entry_id bigint NOT NULL,
  profile_enable boolean,
  entry_id bigint,
  profile_id bigint,
  CONSTRAINT profile_service_entry_asso_pk PRIMARY KEY (prof_entry_id),
  CONSTRAINT prof_ser_ent_asso_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT prof_ser_ent_asso_entry_id_fk FOREIGN KEY (entry_id)
      REFERENCES config_$CONTROLLER_NAME.service_entry_points (entry_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.topo_profile_assoc
(
  id bigint NOT NULL,
  weightage bigint,
  instance_id bigint,
  profile_id bigint,
  server_id bigint,
  tier_id bigint,
  topo_id bigint,
  tier_group_id bigint,
  CONSTRAINT topo_profile_assoc_pk PRIMARY KEY (id),
  CONSTRAINT top_prof_asso_server_id_fk FOREIGN KEY (server_id)
      REFERENCES config_$CONTROLLER_NAME.server (server_id),
  CONSTRAINT top_prof_asso_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT top_prof_asso_topo_id_fk FOREIGN KEY (topo_id)
      REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id),
  CONSTRAINT top_prof_asso_inst_id_fk FOREIGN KEY (instance_id)
      REFERENCES config_$CONTROLLER_NAME.instance (instance_id),
  CONSTRAINT top_prof_asso_tier_id_fk FOREIGN KEY (tier_id)
      REFERENCES config_$CONTROLLER_NAME.tier (tier_id),
  CONSTRAINT top_prof_asso_tier_group_id_fk FOREIGN KEY (tier_group_id)
        REFERENCES config_$CONTROLLER_NAME.tier_group (tier_group_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.session_attr_monitors_asso
(
  sess_attr_asso_id bigint NOT NULL,
  session_type character varying(255),
  profile_id bigint,
  CONSTRAINT session_attr_monitors_asso_pk PRIMARY KEY (sess_attr_asso_id),
  CONSTRAINT session_attr_mon_asso_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.session_attribute_monitors
(
  sess_attr_id bigint NOT NULL,
  attr_mode bigint,
  attr_name character varying(255),
  attr_type character varying(255),
  sess_attr_asso_id bigint,
  CONSTRAINT session_attribute_monitors_pk PRIMARY KEY (sess_attr_id),
  CONSTRAINT session_attr_mon_sess_attr_asso_id_fk FOREIGN KEY (sess_attr_asso_id)
      REFERENCES config_$CONTROLLER_NAME.session_attr_monitors_asso (sess_attr_asso_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.specific_attr_val
(
  spec_attr_val_id bigint NOT NULL,
  lb character varying(255),
  rb character varying(255),
  type character varying(255),
  val_name character varying(255),
  sess_attr_id bigint,
  CONSTRAINT specific_attr_val_pk PRIMARY KEY (spec_attr_val_id),
  CONSTRAINT specific_attr_val_sess_attr_id_fk FOREIGN KEY (sess_attr_id)
      REFERENCES config_$CONTROLLER_NAME.session_attribute_monitors (sess_attr_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.method_based_customdata
(
  methodbased_id bigint NOT NULL,
  enable_argtype boolean,
  enable_returntype boolean,
  fqm character varying(4096),
  profile_id bigint,
  CONSTRAINT method_based_customdata_pk PRIMARY KEY (methodbased_id),
  CONSTRAINT method_based_customdata_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.argment_type
(
  argtype_id bigint NOT NULL,
  header_name character varying(255),
  index character varying(255),
  operation character varying(255),
  operation_value character varying(255),
  type character varying(255),
  methodbased_id bigint,
  mode character varying(255),
  header_value character varying(255),
  lb character varying(255),
  rb character varying(255),
  CONSTRAINT argment_type_pk PRIMARY KEY (argtype_id),
  CONSTRAINT argment_type_methodbased_id_fk FOREIGN KEY (methodbased_id)
      REFERENCES config_$CONTROLLER_NAME.method_based_customdata (methodbased_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.return_type
(
  returntype_id bigint NOT NULL,
  header_name character varying(255),
  operation character varying(255),
  operation_value character varying(255),
  type character varying(255),
  methodbased_id bigint,
  mode character varying(255),
  header_value character varying(255),
  lb character varying(255),
  rb character varying(255),
  CONSTRAINT return_type_pk PRIMARY KEY (returntype_id),
  CONSTRAINT return_type_methodbased_id_fk FOREIGN KEY (methodbased_id)
      REFERENCES config_$CONTROLLER_NAME.method_based_customdata (methodbased_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_method
(
  bt_method_id bigint NOT NULL,
  argument_index character varying(255),
  enable_argument_type boolean,
  fqm character varying(4096),
  return_type character varying(255),
  profile_id bigint,
  meth_invocation character varying(255),
  meth_invocation_index bigint,
  CONSTRAINT bt_method_pk PRIMARY KEY (bt_method_id),
  CONSTRAINT bt_method_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_method_rules
(
  bt_method_rule_id bigint NOT NULL,
  bt_name character varying(255),
  op_code bigint,
  operation_name character varying(255),
  value character varying(255),
  bt_method_id bigint,
  CONSTRAINT bt_method_rules_pk PRIMARY KEY (bt_method_rule_id),
  CONSTRAINT bt_method_rules_bt_method_id_fk FOREIGN KEY (bt_method_id)
      REFERENCES config_$CONTROLLER_NAME.bt_method (bt_method_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.advance_exception_filter
(
    advanceexception_id bigint NOT NULL,
    advanceexception_mode integer,
    advanceexception_operation character varying(255) COLLATE pg_catalog."default",
    advanceexception_pattern character varying(255) COLLATE pg_catalog."default",
    profile_id bigint,
    CONSTRAINT advance_exception_filter_pkey PRIMARY KEY (advanceexception_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_http_hdr
(
  header_id bigint NOT NULL,
  header_name character varying(255),
  header_val_type character varying(255),
  profile_id bigint,
  CONSTRAINT bt_http_hdr_pkey PRIMARY KEY (header_id),
  CONSTRAINT bt_http_hdr_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_http_hdr_cond
(
  hdr_cond_id bigint NOT NULL,
  bt_name character varying(255),
  operation character varying(255),
  value character varying(255),
  header_id bigint,
  CONSTRAINT bt_http_hdr_cond_pkey PRIMARY KEY (hdr_cond_id),
  CONSTRAINT bt_http_hdr_cond_header_id_fk FOREIGN KEY (header_id)
      REFERENCES config_$CONTROLLER_NAME.bt_http_hdr (header_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.exception_monitors
(
    exception_id bigint NOT NULL,
    exception_desc character varying(255) COLLATE pg_catalog."default",
    exception_display_name character varying(255) COLLATE pg_catalog."default",
    exception_name character varying(255) COLLATE pg_catalog."default",
    profile_id bigint,
    CONSTRAINT exception_monitors_pkey PRIMARY KEY (exception_id),
    CONSTRAINT exception_monitors_profile_id_fk FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.http_req_hdr_asso
(
  http_req_asso_id bigint NOT NULL,
  http_req_hdr_type character varying(255),
  profile_id bigint,
  CONSTRAINT http_req_hdr_asso_pkey PRIMARY KEY (http_req_asso_id),
  CONSTRAINT http_req_hdr_asso_profile_id_fk FOREIGN KEY (profile_id) REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.httpreqhdr_based_customdata
(
  httpreqhdrbased_id bigint NOT NULL,
  dump_mode character varying(255),
  hdr_name character varying(255),
  http_req_asso_id bigint,
  profile_id bigint,
  CONSTRAINT httpreqhdr_based_customdata_pkey PRIMARY KEY (httpreqhdrbased_id),
  CONSTRAINT httpreqhdr_based_customdata_http_req_asso_id_fk FOREIGN KEY (http_req_asso_id)
      REFERENCES config_$CONTROLLER_NAME.http_req_hdr_asso (http_req_asso_id) 
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.httpreqhdr_rules
(
  httpreqhdrrules_id bigint NOT NULL,
  display_name character varying(255),
  left_bound character varying(255),
  right_bound character varying(255),
  type character varying(255),
  httpreqhdrbased_id bigint,
  CONSTRAINT httpreqhdr_rules_pk PRIMARY KEY (httpreqhdrrules_id),
  CONSTRAINT httpreqhdr_rules_httpreqhdrbased_id_fk FOREIGN KEY (httpreqhdrbased_id)
      REFERENCES config_$CONTROLLER_NAME.httpreqhdr_based_customdata (httpreqhdrbased_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.ndc_keywords
(
  ndc_key_id bigint NOT NULL,
  controller_name character varying(255),
  ndc_def_value character varying(255),
  ndc_key_max character varying(255),
  ndc_key_min character varying(255),
  ndc_key_name character varying(255),
  ndc_key_val character varying(255),
  ndc_key_type character varying(255),
  ndc_key_desc character varying(255),
  CONSTRAINT ndc_keywords_pkey PRIMARY KEY (ndc_key_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.ndc_keyword_asso
(
  key_value_index bigint NOT NULL,
  key_value character varying(255),
  app_id bigint,
  ndc_key_id bigint,
  CONSTRAINT ndc_keyword_asso_pkey PRIMARY KEY (key_value_index),
  CONSTRAINT ndc_keyword_asso_ndc_key_id_fk FOREIGN KEY (ndc_key_id)
      REFERENCES config_$CONTROLLER_NAME.ndc_keywords (ndc_key_id),
  CONSTRAINT ndc_keyword_asso_app_id_fk FOREIGN KEY (app_id)
      REFERENCES config_$CONTROLLER_NAME.application (app_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.auto_instrumentation
(
  id bigint NOT NULL,
  app_name character varying(255),
  configuration character varying(500),
  controller_name character varying(255),
  duration character varying(255),
  elapsed_time character varying(255),
  end_time character varying(255),
  instance_id bigint,
  instance_name character varying(255),
  session_name character varying(255),
  start_time character varying(255),
  status character varying(255),
  trigger_screen character varying(255),
  type character varying(255),
  CONSTRAINT auto_instrumentation_pkey PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_response_hdr
( 
  header_id bigint NOT NULL,
  header_name character varying(255),
  header_val_type character varying(255),
  profile_id bigint,
  CONSTRAINT bt_response_hdr_pkey PRIMARY KEY (header_id),
  CONSTRAINT bt_response_hdr_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_response_hdr_cond
(
  hdr_cond_id bigint NOT NULL,
  bt_name character varying(255),
  value character varying(255),
  operation character varying(255),
  header_id bigint,
  CONSTRAINT bt_response_hdr_cond_pkey PRIMARY KEY (hdr_cond_id),
  CONSTRAINT bt_response_hdr_cond_profile_id_fk FOREIGN KEY (header_id)
      REFERENCES config_$CONTROLLER_NAME.bt_response_hdr (header_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.http_rep_hdr_asso
( 
  http_rep_asso_id bigint NOT NULL,
  http_rep_hdr_type character varying(255),
  profile_id bigint,
  CONSTRAINT http_rep_hdr_asso_pkey PRIMARY KEY (http_rep_asso_id),
  CONSTRAINT http_rep_hdr_asso_profile_id_fk FOREIGN KEY (profile_id) REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.httprephdr_based_customdata
( 
  httprephdrbased_id bigint NOT NULL,
  dump_mode character varying(255),
  hdr_name character varying(255),
  http_rep_asso_id bigint,
  profile_id bigint,
  CONSTRAINT httprephdr_based_customdata_pkey PRIMARY KEY (httprephdrbased_id),
  CONSTRAINT httprephdr_based_customdata_http_rep_asso_id_fk FOREIGN KEY (http_rep_asso_id)
      REFERENCES config_$CONTROLLER_NAME.http_rep_hdr_asso (http_rep_asso_id),
  CONSTRAINT httprephdr_based_customdata_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.httprephdr_rules
(
  httprephdrrules_id bigint NOT NULL,
  display_name character varying(255),
  left_bound character varying(255),
  right_bound character varying(255),
  type character varying(255),
  httprephdrbased_id bigint,
  CONSTRAINT httprephdr_rules_pk PRIMARY KEY (httprephdrrules_id),
  CONSTRAINT httprephdr_rules_httprephdrbased_id_fk FOREIGN KEY (httprephdrbased_id)
      REFERENCES config_$CONTROLLER_NAME.httprephdr_based_customdata (httprephdrbased_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.container_type
(
    container_id bigint NOT NULL,
    container_name character varying(255),
    container_type character varying(255),
    description character varying(255),
    CONSTRAINT container_type_pkey PRIMARY KEY (container_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.nd_asynchronous_rule
(
    async_rule_id bigint NOT NULL,
    dump_mode bigint,
    fqm character varying(750),
    rule_type character varying(255),
    container_id bigint,
    CONSTRAINT nd_asynchronous_rule_pkey PRIMARY KEY (async_rule_id),
    CONSTRAINT nd_asynchronous_rule_container_id FOREIGN KEY (container_id)
        REFERENCES config_$CONTROLLER_NAME.container_type (container_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile_async_type_assoc
(
    assoc_id bigint NOT NULL,
    enabled boolean,
    container_id bigint,
    profile_id bigint,
    CONSTRAINT profile_async_type_assoc_pkey PRIMARY KEY (assoc_id),
    CONSTRAINT profile_async_type_assoc_container_id FOREIGN KEY (container_id)
        REFERENCES config_$CONTROLLER_NAME.container_type (container_id),
    CONSTRAINT profile_async_type_assoc_profile_id FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_http_body
(
  id bigint NOT NULL,
  body_type character varying(255),
  xpath character varying(255),
  data_type character varying(255),
  profile_id bigint,
  CONSTRAINT bt_http_body_pkey PRIMARY KEY (id),
  CONSTRAINT bt_http_body_profile_id FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_http_body_cond
(
  cond_id bigint NOT NULL,
  bt_name character varying(255),
  op_code character varying(255),
  value character varying(255),
  id bigint,
  CONSTRAINT bt_http_body_cond_pkey PRIMARY KEY (cond_id),
  CONSTRAINT bt_http_body_id FOREIGN KEY (id)
      REFERENCES config_$CONTROLLER_NAME.bt_http_body (id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.nde_cluster_config
(
  nde_id bigint NOT NULL,
  ip character varying(255),
  is_master character varying(255),
  name character varying(255),
  port character varying(255),
  ws_port character varying(255),
  wss_port character varying(255),
  CONSTRAINT nde_cluster_config_pkey PRIMARY KEY (nde_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.nde_routing_rules
(
  rule_id bigint NOT NULL,
  tier_group character varying(255),
  nde_id bigint,
  CONSTRAINT nde_routing_rules_pkey PRIMARY KEY (rule_id),
  CONSTRAINT nde_id_nde_cluster_config FOREIGN KEY (nde_id)
      REFERENCES config_$CONTROLLER_NAME.nde_cluster_config (nde_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.backend_type_interface
(
  backend_type_interface_id bigint NOT NULL,
  backend_type_interface_name character varying(255),
  backend_type_interface_desc character varying(255),
  backend_type_interface_entrypointsfile character varying(255),
  agent character varying(255),
  CONSTRAINT backend_type_interface_pkey PRIMARY KEY (backend_type_interface_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.backend_points_interface
(
  end_point_interface_id bigint NOT NULL,
  end_point_interface_fqm character varying(750),
  end_point_interface_desc character varying(255),
  end_point_interface_name character varying(255),
  backend_type_interface_id bigint,
  custom_entry boolean,
  agent character varying(255),
  module character varying(255),
  type character varying(255),
  sub_type character varying(255),
  CONSTRAINT backend_points_interface_pkey PRIMARY KEY (end_point_interface_id),
  CONSTRAINT backend_type_interface_fk FOREIGN KEY (backend_type_interface_id)
      REFERENCES config_$CONTROLLER_NAME.backend_type_interface (backend_type_interface_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.profile_backend_point_interface_asso
(
    assoc_id bigint NOT NULL,
    enabled boolean,
    end_point_interface_id bigint,
    profile_id bigint,
    CONSTRAINT profile_backend_point_interface_asso_pkey PRIMARY KEY (assoc_id),
    CONSTRAINT profile_backend_point_interface_asso_container_id FOREIGN KEY (end_point_interface_id)
        REFERENCES config_$CONTROLLER_NAME.backend_points_interface (end_point_interface_id),
    CONSTRAINT profile_backend_point_interface_asso_profile_id FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.auto_injection_policy_rule
(
    id bigint NOT NULL,
    bt_name character varying(255),
    enabled boolean,
    exclude boolean,
    extension character varying(255),
    header_name character varying(255),
    header_operation character varying(255),
    header_value character varying(255),
    http_method character varying(255),
    http_url character varying(4096),
    parameter_name character varying(255),
    parameter_operation character varying(255),
    parameter_value character varying(255),
    rule_name character varying(255),
    type character varying(255),
    profile_id bigint,
    CONSTRAINT auto_injection_policy_rule_pkey PRIMARY KEY (id),
    CONSTRAINT auto_injection_policy_rule_profile_id FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.auto_injection_tag_rule
(
    id bigint NOT NULL,
    before_after_tag character varying(255),
    enabled boolean,
    html_tag character varying(255),
    js_code character varying(4096),
    rule_name character varying(255),
    profile_id bigint,
    CONSTRAINT auto_injection_tag_rule_pkey PRIMARY KEY (id),
    CONSTRAINT auto_injection_tag_rule_profile_id FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.global_settings
 (
   key_id bigint NOT NULL,
   key_name character varying(255),
   key_min character varying(255),
   key_max character varying(255),
   key_def_value character varying(255),
   key_value character varying(255),
   key_desc character varying(255),
   CONSTRAINT global_settings_pk PRIMARY KEY (key_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.tier_assign_rule
(
   tier_rule_id bigint NOT NULL,
   rule_name character varying(255),
   display_tier_name character varying(255),
   display_server_name character varying(3000),
   rule_type character varying(255),
   custom_server_name character varying(3000),
   server_name_list character varying(3000),
   custom_tier_name character varying(255),
   non_custom_tier_name character varying(255),
   status boolean,
   user_name character varying(255),
   action character varying(255),
   topo_name character varying(255),
   CONSTRAINT tier_assignment_rule_pk PRIMARY KEY (tier_rule_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dl_data
(
  dl_id bigint NOT NULL,
  enable boolean,
  fqm character varying(4096),
  lno bigint,
  trace_all boolean,
  trace_all_class_field boolean,
  trace_all_args boolean,
  trace_all_local_var boolean,
  trace_ret_value boolean,
  st boolean,
  logger character varying(255),
  message character varying(255),
  local_var_list character varying(255),
  class_fld_list character varying(255),
  hit_limit bigint,
  depth bigint,
  meta_data character varying(255),
  data_type bigint,
  name character varying(255),
  path character varying(255),
  operation character varying(255),
  value character varying(255),
  fqc character varying(255),
  profile_id bigint,
  CONSTRAINT dl_id_pk PRIMARY KEY (dl_id),
  CONSTRAINT dl_id_profile_id_fk FOREIGN KEY (profile_id)
      REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dl_argument
(
  arg_id bigint NOT NULL,
  meta_data character varying(255),
  data_type bigint,
  name character varying(255),
  path character varying(255),
  operation character varying(255),
  value character varying(255),
  dl_id bigint,
  CONSTRAINT arg_id_pk PRIMARY KEY (arg_id),
  CONSTRAINT argument_dl_id_fk FOREIGN KEY (dl_id)
      REFERENCES config_$CONTROLLER_NAME.dl_data (dl_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dl_local_var
(
  loc_var_id bigint NOT NULL,
  meta_data character varying(255),
  data_type bigint,
  name character varying(255),
  path character varying(255),
  operation character varying(255),
  value character varying(255),
  dl_id bigint,
  CONSTRAINT local_var_id_pk PRIMARY KEY (loc_var_id),
  CONSTRAINT local_var_dl_id_fk FOREIGN KEY (dl_id)
      REFERENCES config_$CONTROLLER_NAME.dl_data (dl_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.dl_class_field
(
  class_fld_id bigint NOT NULL,
  meta_data character varying(255),
  data_type bigint,
  name character varying(255),
  path character varying(255),
  operation character varying(255),
  value character varying(255),
  dl_id bigint,
  CONSTRAINT class_fld_id_pk PRIMARY KEY (class_fld_id),
  CONSTRAINT class_fld_dl_id_fk FOREIGN KEY (dl_id)
      REFERENCES config_$CONTROLLER_NAME.dl_data (dl_id)
);

 CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.memory_profiler
(
  id bigint NOT NULL,
  app_name character varying(255),
  topo_name character varying(255),
  configuration character varying(1000),
  duration character varying(255),
  end_time character varying(255),
  instance_id bigint,
  tier_name character varying(255),
  server_name character varying(255),
  instance_name character varying(255),
  session_name character varying(255),
  start_time character varying(255),
  status character varying(255),
  trigger_screen character varying(255),
  agent_type character varying(255),
  txn_id bigint,
  description character varying(255),
  CONSTRAINT memory_profiler_pkey PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.bt_tags
(
  tag_id bigint NOT NULL,
  tag_name character varying(255),
  name_space character varying(255),
  value character varying(255),
  profile_id bigint,
  bt_pattern_id bigint,
  CONSTRAINT bt_tags_tagid_pk PRIMARY KEY (tag_id),
  CONSTRAINT bt_tags_profile_id_fk FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id)
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.ip_global
(
  ip_global_id bigint NOT NULL,
  uri_type character varying(255),
  segment_type character varying(255),
  segment_value character varying(255),
  dynamic_request_enabled boolean,
  query_param_str character varying(255),
  profile_id bigint,
  backend_type_id bigint,
  dynamic_req_type character varying(255),
  segment_number character varying(255),
  CONSTRAINT ip_global_id_pk PRIMARY KEY (ip_global_id), 
  CONSTRAINT ip_global_profile_id_fk FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT ip_global_backend_type_id_fk FOREIGN KEY (backend_type_id)
		REFERENCES config_$CONTROLLER_NAME.backend_type (backend_type_id )
);

CREATE TABLE IF NOT EXISTS config_$CONTROLLER_NAME.ip_pattern
(
  ip_pattern_id bigint NOT NULL,
  pattern_name character varying(255),
  ip_id bigint,
  url_pattern character varying(255),
  match_type character varying(255),
  profile_id bigint,
  backend_type_id bigint,
  dynamic_req_part boolean,
  req_method character varying(255),
  CONSTRAINT ip_pattern_id_pk PRIMARY KEY (ip_pattern_id), 
  CONSTRAINT ip_pattern_profile_id_fk FOREIGN KEY (profile_id)
        REFERENCES config_$CONTROLLER_NAME.profile (profile_id),
  CONSTRAINT ip_pattern_backend_type_id_fk FOREIGN KEY (backend_type_id)
		REFERENCES config_$CONTROLLER_NAME.backend_type (backend_type_id )
);

+`

show_error

#This will change owner of table from postgres to cavisson
#So that cavisson user can alter this tables for adding columns
table_Name=($(psql --user=cavisson -d test -t --no-align -c "select table_name from information_schema.tables where table_schema = 'config_$CONTROLLER_NAME';"))
for tableName in $table_Name
do
Error=`psql test postgres 2>&1<<+
alter table config_$CONTROLLER_NAME.$tableName owner to cavisson;
+`
done
show_error

#This will insert default values  in tables in config schema.
#This will check whether their is data in tables or not, if table is empty then we will insert default values in tables 
#otherwise we don't do anything.
#This action will be perform for all tables in config schema.
data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.profile;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile(profile_id,profile_name,profile_desc,controller_name,agent) 
VALUES
(1,'default_Java','Default profile for Java','-','Java'),
(777777,'default_NodeJS','Default profile for Node JS','-','NodeJS'),
(888888,'default_DotNet','Default profile for Dot Net','-','Dot Net');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.entry_type;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_name, entry_type_detail) VALUES
(1,'HttpServletService','description'),
(2,'EntryForWebLogicJSP','description'),
(3,'ApacheJsperService','description'),
(4,'jerseyCall', 'description'),
(5,'glassFishJersey', 'description'),
(6,'Generic', 'description'),
(7,'JMSCall', 'description'),
(8,'EntryForJBOSS', 'description'),
(9,'ErrorPageEntry','description'),
(10,'HessianCallOut','description'),
(11,'ATGServlet','description'),
(12,'TX_EXIT','description'),
(13,'playEntryPoint','description'),
(14,'JsAutoInject','description');
+`
show_error
   fi
 fi
  
data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.service_entry_points;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
(1,'Fully qualified name for the service method for HttpServlet Class','javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','HttpServlet.service', 1,false,'-','Java'),
(2,'fully qualified name for the doFilter method for weblogic','weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','FilterChainImpl.doFilter', 2,false,'-','Java'),
(3,' ','org.apache.jasper.runtime.HttpJspBase.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','ApacheJsperService', 3,false,'-','Java'),
(4,' ','weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','WebAppFilterChain.doFilter', 2,false,'-','Java'),
(5,' ','com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','ServletWrapper.service', 2,false,'-','Java'),
(6,' ','com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lcom/ibm/ws/webcontainer/webapp/WebAppServletInvocationEvent;)V','ServletWrapper.service-WebAppServletInvocationEvent', 2,false,'-','Java'),
(7,' ','org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','ApplicationFilterChain.doFilter', 8,false,'-','Java'),
(8,' ','org.glassfish.jersey.servlet.ServletContainer.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','ServletContainer.service', 5,false,'-','Java'),
(9,' ','com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','WebAppFilterChain.doFilter', 2,false,'-','Java'),
(10,' ','weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','RequestDispatcherImpl.forward',9,false,'-','Java'),
(11,' ','com.caucho.hessian.server.HessianServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','HessianServlet.service',10,false,'-','Java'),
(12,' ' ,'atg.servlet.pipeline.PipelineableServletImpl.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V', 'PipelineableServletImpl.service',11,false,'-','Java'),
(13,' ','atg.servlet.DynamoServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','DynamoServlet.service',11,false,'-','Java'),
(14,' ','atg.servlet.sessionsaver.SessionSaverServlet.service(Latg/servlet/DynamoHttpServletRequest;Latg/servlet/DynamoHttpServletResponse;)V', 'SessionSaverServlet.service',11,false,'-','Java'),
(15,' ','atg.servlet.pipeline.HeadPipelineServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V', 'HeadPipelineServlet.service',11,false,'-','Java'),
(16,' ','org.apache.activemq.ActiveMQMessageConsumer.dispatch(Lorg/apache/activemq/command/MessageDispatch;)V','ActiveMQMessageConsumer.dispatch',7,false,'-','Java'),
(17,' ','com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(Ljavax/jms/Message;)V','MQMessageConsumer$FacadeMessageListener.onMessage',7,false,'-','Java'),
(18,' ','System.Web.HttpRuntime.ProcessRequestNotificationPrivate','ProcessRequestNotificationPrivate',1,false,'System.Web.dll','Dot Net'),
(19,' ','System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper','ProcessRequestNotificationHelper',1,false,'System.Web.dll','Dot Net'),
(20,' ','System.Web.HttpRuntime.FinishPipelineRequest','FinishPipelineRequest',12,false,'System.Web.dll','Dot Net'),
(21,' ','System.Web.HttpRuntime.FinishRequest','FinishRequest',12,false,'System.Web.dll','Dot Net'),
(22,' ','org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','ServletHandler$CachedChain.doFilter',1,false,'-','Java'),
(23,' ','org.springframework.web.filter.OncePerRequestFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V','OncePerRequestFilter.doFilter',1,false,'-','Java'),
(24,' ','com.sun.jersey.spi.container.servlet.WebComponent.service(Ljava/net/URI;Ljava/net/URI;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)I','WebComponent.service(URI,URI,HttpServletRequest,HttpServletResponse)',4,false,'-','Java'),
(25,' ','com.tibco.plugin.share.http.servlet.BwServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doGet(HttpServletRequest,HttpServletResponse)',1,false,'-','Java'),
(26,' ','com.tibco.plugin.share.http.servlet.BwServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doPost(HttpServletRequest,HttpServletResponse)',1,false,'-','Java'),
(27,' ','com.tibco.plugin.share.http.servlet.BwServlet.doPut(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doPut(HttpServletRequest,HttpServletResponse)',1,false,'-','Java'),
(28,' ','com.tibco.plugin.share.http.servlet.BwServlet.doDelete(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doDelete(HttpServletRequest,HttpServletResponse)',1,false,'-','Java'),
(29,' ','com.tibco.plugin.share.http.servlet.BwServlet.doOptions(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doOptions(HttpServletRequest,HttpServletResponse)',1,false,'-','Java'),
(30,' ','com.tibco.plugin.share.http.servlet.BwServlet.a(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V','a(HttpServletRequest,HttpServletResponse,String)',1,false,'-','Java'),
(31,' ','org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(Ljavax/jms/Session;Ljavax/jms/Message;)V','invokeListener(Session,Message)',7,false,'-','Java'),
(32,' ','org.springframework.batch.core.job.AbstractJob.execute(Lorg/springframework/batch/core/JobExecution;)V','AbstractJob_Execute',6,false,'-','Java'),
(33,' ','org.springframework.batch.core.job.SimpleJob.doExecute(Lorg/springframework/batch/core/JobExecution;)V','SimpleJob_doExecute',6,false,'-','Java');
+`
show_error
   fi
 fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES
(1, true, 1, 1),
(2, true, 2, 1),
(3, true, 3, 1),
(4, true, 4, 1),
(5, true, 5, 1),
(6, true, 6, 1),
(7, true, 7, 1),
(8, false, 8, 1),
(9, true, 9, 1),
(10, true, 10, 1),
(11, true, 11, 1),
(12, true, 12, 1),
(13, true, 13, 1),
(14, true, 14, 1),
(15, true, 15, 1),
(16, true, 16, 1),
(17, true, 17, 1),
(18, true, 18, 888888),
(19, true, 19, 888888),
(20, true, 20, 888888),
(21, true, 21, 888888),
(22, true, 22, 1),
(23, true, 23, 1),
(24, false, 24,1),
(25, true, 25, 1),
(26, true, 26, 1),
(27, true, 27, 1),
(28, true, 28, 1),
(29, true, 29, 1),
(30, true, 30, 1),
(31, false, 31, 1),
(32, true, 32, 1),
(33, true, 33, 1);
+`
show_error
   fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.keywords_meta_data;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords_meta_data(kmd_id,key_type,key_type_id) VALUES
(1,'char','0'),
(2,'integer','1'),
(3,'double','2'),
(4,'long long','3'),
(5,'string','4'),
(6,'file','5');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords(key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES
(1,'bciInstrSessionPct','0','100','5','0','normal','7'),
(2,'logLevelOneFpMethod','0','1','1','1','pre-custom','5'),
(3,'enableBciDebug','0','6','1','1','normal','3'),
(4,'enableBciError','1','100','5','1','normal','1'),
(5,'doNotDiscardFlowPaths','0','1','2','0','pre-custom','4'),
(6,'ASSampleInterval','0','5000','4','500','normal','7'),
(7,'ASThresholdMatchCount','1','100','4','5','normal','7'),
(8,'ASReportInterval','0','900000','4','0','normal','4'),
(9,'instrProfile','','','5','','normal','7'),
(10,'ASDepthFilter','0','100','2','20','normal','1'),
(11,'ASTraceLevel','0','20','2','0','pre-custom','3'),
(12,'enableNDSession','0','1024','5','0','normal','7'),
(13,'enableCpuTime','0','1024','1','0','normal','5'),
(15,'InstrTraceLevel','0','11','2','0','normal','5'),
(16,'instrExceptions','0','512','5','1%201%200%2020','normal','3'),
(17,'correlationIDHeader','0','1024','5','-','normal','7'),
(18,'ASStackComparingDepth','0','1000','4','10','normal','5'),
(19,'putDelayInMethod','0','10240','5','0','normal','5'),
(20,'enableBackendMonitor','0','1','2','1','normal','7'),
(21,'NDEntryPointsFile','','','5','true','normal','5'),
(22,'ndMethodMonTraceLevel','0','10','2','0','normal','7'),
(23,'generateExceptionInMethod','0','10240','5','0','normal','1'),
(24,'captureHTTPReqFullFp','1','10485760','5','2','normal','7'),
(25,'NDHTTPReqHdrCfgListFullFp','1','1024','6','NA','normal','5'),
(26,'captureHTTPRespFullFp','1','1048576','5','1','normal','7'),
(27,'enableBTMonitor','0','1','2','1','normal','7'),
(28,'BTRuleConfig','NA','NA','5','global','normal','7'),
(29,'ndMethodMonFile','','','5','false','normal','7'),
(30,'BTErrorRules','','','5','false','normal','5'),
(32,'enableJVMThreadMonitor','0','2048','5','0','normal','1'),
(33,'captureCustomData','','','5','false','normal','3'),
(34,'ASPositiveThreadFilters','2','1048576','5','NA','normal','1'),
(35,'ASNegativeThreadFilter','2','1048576','5','NDControlConnection','normal','1'),
(36,'maxStackSizeDiff','0','1000','4','20','normal','1'),
(37,'ASMethodHotspots','0','1','1','0','normal','1'),
(38,'enableExceptionInSeqBlob','0','1','2','0','pre-custom','1'),
(39,'captureErrorLogs','0','2','2','0','normal','1'),
(40,'maxExceptionMessageLength','0','10000','2','50','pre-custom','1'), 
(41,'maxResourceDetailMapSize','0','1000000','2','10000','pre-custom','1'),
(42,'HTTPStatsCondCfg','1','1024','5','false','normal','7'),
(43,'enableExceptionsWithSourceAndVars','0','248','2','0','normal','1'),
(44,'enableSourceCodeFilters','1','1024','5','false','normal','1'),
(45,'ndExceptionMonFile','','','5','false','normal','7'),
(46,'maxQueryDetailMapSize','0','10000000','1','10000','pre-custom','1'),
(47,'formatIPResourceURL','0','512','5','1','normal','1'),
(48,'enableIPResourceURL','0','1','2','0','normal','5'),
(49,'dumpDefaultCassandraQuery','0','1','2','0','normal','1'),
(50,'enableTransformThreadSubClass','0','1','2','1','normal','1'),
(51,'captureDocumentforMongo','0','1','2','0','pre-custom','1'),
(52,'enableErrorRedirectionPage','0','1','2','0','pre-custom','1'),
(53,'enableMethodBreakDownTime','0','1024','5','0','normal','1'),
(54,'NDHTTPRepHdrCfgListFullFp','1','1024','6','NA','pre-custom','5'),
(55,'NDHTTPRepHdrCfgListL1Fp','1','1024','6','NA','pre-custom','5'),
(56,'ndHttpHdrCaptureFileList','1','1024','6','NA','pre-custom','5'),
(57,'ASReportDumpMode','0','3','1','1','normal','5'),
(58,'ASStackCompareOption','1','2','4','1','pre-custom','1'),
(59,'ASDataBufferMinCount','2','1024','4','16','pre-custom','5'),
(60,'ASEnableFPSummaryReport','0','2','2','0','pre-custom','1'),
(61,'ASResumeDataBuffFreePct','1','100','4','25','pre-custom','1'),
(62,'ndMonitorInterval','0','2147483647','2','0','normal','5'),
(63,'captureExceptionTraceLevel','0','10','2','0','pre-custom','7'),
(64,'enableThreadCallout','0','10240','5','1','pre-custom','1'),
(65,'enableThreadMonTraceLevel','0','10','2','0','pre-custom','5'),
(66,'enableBTMonitorTrace','0','6','2','0','pre-custom','7'),
(67,'maxBTCount','1','5000','2','256','pre-custom','7'),
(68,'maxIPCount','1','1000','2','32','pre-custom','5'),
(69,'enableFPTrace','0','3','2','0','pre-custom','5'),
(70,'AgentTraceLevel','0','4','2','0','pre-custom','5'),
(71,'captureHttpSessionTraceLevel','0','3','1','1','pre-custom','1'),
(72,'ndExceptionThrowingClassFilter','1','1024','6','NA','pre-custom','1'),
(73,'captureMethodForAllFP','0','1','2','0','normal','5'),
(74,'ndBackendNamingRulesFile','1','1024','6','true','normal','7'),
(75,'ndExceptionFilterList','0','10240','6','NA','pre-custom','3'),
(76,'enableBackendMonTrace','0','6','2','0','pre-custom','7'),
(77,'enableForcedFPChain','0','3','2','1','pre-custom','7'),
(78,'maxCharInSeqBlob','0','1024000000','5','13312','pre-custom','7'),
(79,'bciMaxNonServiceMethodsPerFP','0','2147483647','5','50000','pre-custom','7'),
(80,'bciDataBufferMaxCount','1','30000','4','512','pre-custom','7'),
(81,'bciDataBufferMaxSize','128','65536','4','32768','pre-custom','7'),
(82,'ASDataBufferSize','1','2147483647','4','64000','pre-custom','7'),
(83,'ASDataBufferMaxCount','2','1024','4','256','pre-custom','7'),
(84,'NVCookie','2','1048576','5','CavNVC','pre-custom','7'),
(85,'NDAppLogFile','1','1024','6','NA','pre-custom','5'),
(86,'ndBackendMonFile','1','1024','6','NA','pre-custom','5'),
(87,'generateExceptionConfFile','1','1024','6','NA','pre-custom','5'),
(88,'cavNVURLFile','1','1024','6','NA','pre-custom','5'),
(89,'NDInterfaceFile','1','1024','6','NA','pre-custom','5'),
(90,'genNewMonRecord','0','1','2','1','pre-custom','5'),
(91,'BTAggDataArraySize','50','5000','2','50','pre-custom','5'),
(92,'AppLogTraceLevel','0','6','2','0','pre-custom','5'),
(93,'ControlThreadTraceLevel','0','4','2','0','pre-custom','5'),
(94,'BCITraceMaxSize','1024','1073741824','4','10485760','pre-custom','5'),
(95,'ASEnableHotspotRecord','0','2','2','2','pre-custom','5'),
(96,'eventLoopMonitor','0','1','2','1','normal','2'),
(97,'gcProfiler','0','1','2','1','normal','2'),
(98,'nodejsCpuProfilingTime','10','120','2','10','normal','2'),
(99,'nodeAsyncEventMonitor','0','1','2','0','normal','2'),
(100,'nodeServerMonitor','0','1','2','0','normal','2'),
(101,'captureHttpTraceLevel','0','6','2','0','pre-custom','3'),
(102,'excludeMethodOnRespTime','0','90000','2','0','normal','2'),
(103,'dumpOnlyMethodExitInFP','0','1','2','0','normal','1'),
(104, 'methodResponseTimeFilter', '0', '360000', '5', '0%201%2020', 'normal','1'),
(105,'NDAsyncRuleConfig','1','1024','6','false','normal','1'),
(106,'enableHSLongStack','0','1024','5','0%5%Immediate,TickObject,Timeout,TIMERWRAP','normal','2'),
(107,'correlateEventCallback','0','512','5','0','normal','2'),
(108,'enableWaitSyncQueueTime','0','1','2','1','pre-custom','1'),
(109,'enableCaptureNetDelay','0','1','2','0','normal','3'),
(110,'enableFPMethodStackTrace','0','512','5','0%205%205%205%2010%200','normal','1'),
(112,'ndMBeanMonTraceLevel','0','6','2','0','normal','1'),
(113,'FPMaxAllowedAgeInSec','1','40000000','2','300','pre-custom','1'),
(114,'removeAutoInstrumentations','0','1','2','0','pre-custom','1'),
(115,'enableAutoDetectPlayEntryPoint','0','2048','5','1%201','pre-custom','1'),
(116,'jedisCommands','1','1024','6','NA','pre-custom','1'),
(117,'enableFilterForJedisClient','0','1','2','1','pre-custom','1'),
(118,'addObjectInQueryForCloudant','0','1','2','0','pre-custom','1'),
(119,'instrLog4J','0','1','1','0','pre-custom','1'),
(120,'enableAddingHdrForEndeca','0','1','1','0','pre-custom','1'),
(121,'collectIndependentQuery','0','1','1','0','pre-custom','1'),
(122,'ndGenLogCaptureFileList','1','1024','6','NA','pre-custom','1'),
(123,'genNewSQLRecords','0','1','1','1','pre-custom','1'),
(124,'enableCloudantBackendMode','0','6','2','2','pre-custom','1'),
(125,'enableHeartBeatLog','0','6','2','0','pre-custom','1'),
(126,'dumpSQLQuery','0','1','1','1','pre-custom','1'),
(127,'flushInterval','0','300000','4','100','pre-custom','1'),
(128,'bciDataBuffIncreament','0','30000','2','0','pre-custom','1'),
(129,'socketBufferSize','0','1048576','4','128','pre-custom','1'),
(130,'bciUriLogLevel','0','1','1','1','pre-custom','1'),
(131,'bciUriMaxLength','0','2147483647','2','1024','pre-custom','1'),
(132,'urlLength','0','2147483647','2','1024','pre-custom','1'),
(133,'uriQueryLength','0','2147483647','2','1024','pre-custom','1'),
(134,'logNonNSUrlAndQueryRecord','0','2','1','0','pre-custom','1'),
(135,'bciMaxServiceMethodsPerFP','0','2147483647','5','5000','pre-custom','1'),
(136,'entryMethodMaxDepth','0','9999','2','9999','pre-custom','1'),
(137,'ctrlConnIdleTimeMaxCount','0','120','2','10','pre-custom','1'),
(138,'instrProfileContentMaxIdleTime','0','120','2','1','pre-custom','1'),
(139,'ndCriticalFileKeyword','1','1024','6','NA','pre-custom','1'),
(140,'enableInterfaceInstr','0','6','1','0','pre-custom','1'),
(141,'SQLTraceLevel','0','6','1','0','pre-custom','1'),
(142,'SQLPreparedQueryFilter','2','1048576','5','-','pre-custom','1'),
(143,'SQLNonPreparedQueryFilter','2','1048576','5','-','pre-custom','1'),
(144,'captureHTTPReqL1Fp','1','1048576','5','2','pre-custom','1'),
(145,'captureHTTPRespL1Fp','1','1048576','5','1','pre-custom','1'),
(146,'captureHTTPReqBodyL1Fp','1','1048576','5','0','pre-custom','1'),
(147,'captureHTTPReqBodyFullFp','1','1048576','5','0','pre-custom','1'),
(148,'captureHTTPRespBodyL1Fp','1','1048576','5','0','pre-custom','1'),
(149,'captureHTTPRespBodyFullFp','1','1048576','5','0','pre-custom','1'),
(150,'hdrListForValueAsId','0','4096','5','Content-Encoding,Host,Server,Transfer-Encoding','pre-custom','5'),
(151,'NDHTTPReqHdrCfgListL1Fp','1','1024','6','NA','pre-custom','5'),
(152,'maxHttpBodySize','0','1048576','2','1024','pre-custom','5'),
(153,'ASStateReport','0','1','2','1','pre-custom','1'),
(154,'ASDoNotFilterBlocked','0','1','2','0','pre-custom','1'),
(155,'ASAllocateDataBuffOnFailure','0','1','2','0','pre-custom','1'),
(156,'threadCleanUpCount','0','50','2','5','pre-custom','1'),
(157,'ndHttpCondMonFileList','1','1024','6','NA','pre-custom','1'),
(159,'ndMethodMonFileList','1','1024','6','NA','pre-custom','1'),
(160,'ndExceptionMonFileList','1','1024','6','NA','pre-custom','1'),
(161,'FPGMode','0','2','1','2','pre-custom','1'),
(162,'fpVersionID','0','10240','5','1.0','pre-custom','5'),
(163,'ndDynamicDiagnosticsConfFile','1','1024','6','NA','pre-custom','1'),
(164,'threadIdleTimeout','0','2147483647','2','10','pre-custom','1'),
(165,'ndPoolFile','0','2048','6','NA','pre-custom','5'),
(166,'ASReportBufferMaxSize','1','2147483647','4','262144','pre-custom','1'),
(167,'BTTConfig','1','1024','6','NA','pre-custom','7'),
(168,'enableDCHeartBeat','0','3600','2','0','pre-custom','7'),
(169,'DBIPName','0','1024','5','-','pre-custom','5'),
(170,'backendErrorDetectionMode','0','2048','5','3','pre-custom','1'),
(171,'enableUpdateLogMsgForNF','0','1','1','0','pre-custom','3'),
(172,'BTRuleOverridePolicy','0','2','1','1','pre-custom','5'),
(173,'ndEnableTxHotspot','0','1','2','1','pre-custom','5'),
(174,'ndHelperDepth','0','10','2','2','pre-custom','5'),
(175,'ndHotspotThreadLimit','0','100','2','0','pre-custom','5'),
(176,'enableCheckAdapter','0','1','2','1','pre-custom','1'),
(177,'groupedQueryThreshold','0','3600000','2','0','pre-custom','1'),
(178,'maxFieldValueLength','0','1048576','2','4096','pre-custom','1'),
(179,'maxRecordValueLength','0','4194304','2','16384','pre-custom','1'),
(180,'bciLogSleepInterval','0','30000','4','300','pre-custom','1'),
(181,'enableIPStatusCode','0','1','2','0','pre-custom','1'),
(182,'enableExecuteBatch','0','1','2','0','pre-custom','1'),
(183,'enableExSrcTraceLevel','0','2048','2','0','pre-custom','1'),
(184,'BCILoggingMode','0','2048','5','FILE','pre-custom','1'),
(185,'SafetyNetClassTypesFile','1','1024','6','NA','pre-custom','1'),
(186,'threadDumpFormat','0','1','2','1','pre-custom','1'),
(187,'statusCodeAccessible','0','1','2','1','pre-custom','1'),
(188,'maxAsyncDetailMapSize','0','10000000','2','10000','pre-custom','1'),
(189,'dynamicSlowVslowThreshold','0','1','2','0','pre-custom','2'),
(190,'ndILRewritterFile','0','2048','6','NA','pre-custom','5'),
(191,'ndModuleFile','0','2048','6','NA','pre-custom','5'),
(192,'ndProcessesFile','0','2048','6','NA','pre-custom','5');
+`
show_error
   fi
 fi

KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.backend_type;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES
(1,'HTTP Backend','HTTP','HttpCallout','HTTP','Java'),
(2,'Web Services Backend','Web Services','HttpCallout','WS','Java'),
(3,'JDBC Backend','JDBC','oracleDB','JDBC','Java'),
(4,'Coherence Backend','Coherence','HttpCallout','None','Java'),
(5,'RMI Backend','RMI','HttpCallout','RMI','Java'),
(6,'Mem Cache Backend','Mem Cache','HttpCallout','None','Java'),
(7,'Cloudant Backend','Cloudant','HttpCallout','None','Java'),
(8,'Hadoop Backend','Hadoop','HttpCallout','HBASE','Java'),
(9,'Custom  Backend','Custom','CustomCallout:','None','Java'),
(10,'Redis Backend','Redis','redis','REDIS','Java'),
(11,'Mongo Backend','Mongo','mongodb','MONGO','Java'),
(12,'Cassandra Backend','Cassandra','cassandra','None','Java'),
(13,'Custom Log Backend','Custom Log','CustomLog','None','Java'),
(14,'Custom Error Log Backend','Custom Error Log','CustomErrorlog','None','Java'),
(15,'Thread Backend','Thread','Thread','None','Java'),
(16,'HTTP Backend For Dot Net','HTTP','HTTP_CALLOUT','HTTP','Dot Net'),
(17,'SQL Backend For Dot Net','SQL','SQL_CALLOUT','SQL','Dot Net'),
(18,'Async Call For Dot Net','Async_Call','ASYNC_CALL','ASYNC_CALL','Dot Net'),
(19,'Cloudant NoSQL Backend','Cloudant NoSQL','cloudantEntry','CLOUDANT','Java'),
(20,'Big Table Backend','Big Table','bigTable','None','Java'),
(21,'Microsoft SQL Backend','Microsoft SQL','microsoftDB','None','Java'),
(22,'Log Backend','Log','Log','None','Java'),
(23,'Exception Backend','Exception','Exception','None','Java'),
(24,'XATransaction Backend','XATransaction','XATransaction','None','Java'),
(26,'Neo4j DB Callout Backend','Neo4j DB Callout','neo4jDB','NEO4J','Java'),
(27,'JMS Backend','JMS','HttpCallout','JMS','Java'),
(28,'Custom Backend','Custom','CUSTOM_ENTRY','None','Dot Net');
+`
show_error
   fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.backend_points;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES
(1,'HTTP end point','org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Lorg/apache/commons/httpclient/HttpMethod;)V','Apace HTTP Client',1,false,'-','Java'),
(2,'HTTP end point','com.endeca.navigation.HttpENEConnection.query(Lcom/endeca/navigation/ENEQuery;)Lcom/endeca/navigation/ENEQueryResults;','Endeca',1,false,'-','Java'),
(3,'HTTP end point','org.apache.http.impl.client.AbstractHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;','Apache AbstractHttpClient',1,false,'-','Java'),
(4,'HTTP end point','org.apache.http.impl.client.DefaultRequestDirector.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;','Apache Default HTTP Client',1,false,'-','Java'),
(5,'HTTP end point','org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(Lorg/apache/wink/client/ClientRequest;Lorg/apache/wink/client/handlers/HandlerContext;)Ljava/net/HttpURLConnection;','Apache Wink Client',1,false,'-','Java'),
(6,'HTTP end point','com.worklight.adapters.http.HTTPConnectionManager.execute(Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;','MFP Worklight HTTP Client',1,false,'-','Java'),
(7,'HTTP end point','org.springframework.web.client.RestTemplate.doExecute(Ljava/net/URI;Lorg/springframework/http/HttpMethod;Lorg/springframework/web/client/RequestCallback;Lorg/springframework/web/client/ResponseExtractor;)Ljava/lang/Object;','Spring REST Template Client',1,false,'-','Java'),
(8,'HTTP end point','org.springframework.web.client.RestTemplate\$HttpEntityRequestCallback.doWithRequest(Lorg/springframework/http/client/ClientHttpRequest;)V','Spring add Header in REST Callback Template Client',1,false,'-','Java'),
(9,'HTTP end point','org.springframework.http.client.support.HttpAccessor.createRequest(Ljava/net/URI;Lorg/springframework/http/HttpMethod;)Lorg/springframework/http/client/ClientHttpRequest;','Spring add Header in REST Client Template Client',1,false,'-','Java'),
(10,'HTTP end point','org.apache.http.impl.client.InternalHttpClient.doExecute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;','Apache Internal HTTP Client',1,false,'-','Java'),
(11,'WS end point','org.glassfish.jersey.client.JerseyInvocation.invoke()Ljavax/ws/rs/core/Response;','Jersey Webservice Client',2,false,'-','Java'),
(12,'WS end point','com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(Ljavax/xml/soap/SOAPMessage;Ljava/net/URL;)Ljavax/xml/soap/SOAPMessage;','HTTP SOAP connection',2,false,'-','Java'),
(13,'WS end point','com.sun.xml.ws.transport.http.client.HttpClientTransport.<init>(Lcom/sun/xml/ws/api/message/Packet;Ljava/util/Map;)V','HTTP Client Transport',2,false,'-','Java'),
(14,'WS end point','com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(Lcom/sun/xml/ws/api/message/Packet;)Lcom/sun/xml/ws/api/pipe/NextAction;','HTTP Transport Pipe',2,false,'-','Java'),
(15,'WS end point','org.apache.cxf.jaxws.JaxWsClientProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;','Apache cxf Webservice',2,false,'-','Java'),
(16,'RMI end point','java.rmi.Naming.lookup(Ljava/lang/String;)Ljava/rmi/Remote;','RMI Lookup Calls',5,false,'-','Java'),
(17,'RMI end point','java.rmi.Naming\$ParsedNamingURL.<init>(Ljava/lang/String;ILjava/lang/String;)','RMI Request',5,false,'-','Java'),
(19,'JDBC end point','oracle.jdbc.driver.OraclePreparedStatementWrapper','oracleDB',3,false,'-','Java'),
(20,'HADOOP end point','org.springframework.data.hadoop.hbase.HbaseTemplate.execute(Ljava/lang/String;Lorg/springframework/data/hadoop/hbase/TableCallback;)Ljava/lang/Object;','Spring HBASE',8,false,'-','Java'),
(21,'COHERENCE end point','com.tangosol.net.cache.CachingMap.get(Ljava/lang/Object;)Ljava/lang/Object;','Coherence get',4,false,'-','Java'),
(22,'COHERENCE end point','com.tangosol.net.cache.CachingMap.getAll(Ljava/util/Collection;)Ljava/util/Map;','Coherence getAll',4,false,'-','Java'),
(23,'COHERENCE end point','com.tangosol.net.cache.CachingMap.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;','Coherence put',4,false,'-','Java'),
(24,'COHERENCE end point','com.tangosol.net.cache.CachingMap.put(Ljava/lang/Object;Ljava/lang/Object;ZJ)Ljava/lang/Object;','Coherence put',4,false,'-','Java'),
(25,'COHERENCE end point','com.tangosol.net.cache.CachingMap.putAll(Ljava/util/Map;)V','Coherence putAll',4,false,'-','Java'),
(26,'COHERENCE end point','com.tangosol.net.cache.CachingMap.remove(Ljava/lang/Object;)Ljava/lang/Object;','Coherence remove',4,false,'-','Java'),
(27,'MEM CACHE end point','net.rubyeye.xmemcached.XMemcachedClient.add0(Ljava/lang/String;ILjava/lang/Object;Lnet/rubyeye/xmemcached/transcoders/Transcoder;J)Z','Mem Cache add',6,false,'-','Java'),
(28,'MEM CACHE end point','net.rubyeye.xmemcached.XMemcachedClient.getMulti0(Ljava/util/Collection;JLnet/rubyeye/xmemcached/command/CommandType;Lnet/rubyeye/xmemcached/transcoders/Transcoder;)Ljava/util/Map;','MEM CACHE getMulti',6,false,'-','Java'),
(29,'MEM CACHE end point','net.rubyeye.xmemcached.XMemcachedClient.get0(Ljava/lang/String;JLnet/rubyeye/xmemcached/command/CommandType;Lnet/rubyeye/xmemcached/transcoders/Transcoder;)Ljava/lang/Object;','Mem Cache get',6,false,'-','Java'),
(30,'MEM CACHE end point','net.rubyeye.xmemcached.XMemcachedClient.delete0(Ljava/lang/String;IJZJ)Z','Mem Cache delete',6,false,'-','Java'),
(31,'MEM CACHE end point','net.rubyeye.xmemcached.XMemcachedClient.replace(Ljava/lang/String;ILjava/lang/Object;Lnet/rubyeye/xmemcached/transcoders/Transcoder;J)Z','Mem Cache replace',6,false,'-','Java'),
(32,'CLOUDANT end point','org.lightcouch.CouchDbClientBase.executeRequest(Lorg/apache/http/client/methods/HttpRequestBase;)Lorg/apache/http/HttpResponse;','Cloudant executeRequest',7,false,'-','Java'),
(33,'HTTP end point','javax.naming.ldap.InitialLdapContext.<init>(Ljava/util/Hashtable;[Ljavax/naming/ldap/Control;)V','Initial LDAP Context',1,false,'-','Java'),
(34,'HTTP end point','weblogic.servlet.internal.ServletResponseImpl.writeHeaders()V','Weblogic Servlet Response headers',1,false,'-','Java'),
(35,'HTTP end point','com.hazelcast.client.spi.ClientProxy.invoke(Lcom/hazelcast/client/impl/protocol/ClientMessage;)Ljava/lang/Object;','Hazelcast client proxy',1,false,'-','Java'),
(36,'JDBC end point','com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement','Prepared Statement : ibmDB',3,false,'-','Java'),
(37,'JDBC end point','com.ibm.ws.rsadapter.jdbc.WSJdbcStatement','Statement : ibmDB',3,false,'-','Java'),
(38,'JDBC end point','com.mysql.jdbc.PreparedStatement','Prepared Statement : mysqlDB',3,false,'-','Java'),
(39,'JDBC end point','org.apache.openjpa.kernel.DelegatingQuery.execute()Ljava/lang/Object;','execute()Ljava/lang/Object : openJPADB',3,false,'-','Java'),
(40,'JDBC end point','org.apache.openjpa.kernel.DelegatingQuery.execute(Ljava/util/Map;)Ljava/lang/Object;','execute(Ljava/util/Map;)Ljava/lang/Object : openJPADB',3,false,'-','Java'),
(41,'JDBC end point','org.apache.openjpa.kernel.DelegatingQuery.execute([Ljava/lang/Object;)Ljava/lang/Object;','execute([Ljava/lang/Object;)Ljava/lang/Object : openJPADB',3,false,'-','Java'),
(42,'REDIS end point','redis.clients.jedis.Jedis','Jedis : redisDB',10,false,'-','Java'),
(43,'REDIS end point','redis.clients.jedis.BinaryJedis','Binary Jedis : redisDB',10,false,'-','Java'),
(44,'MONGO end point','com.mongodb.DBCollection','DB Collection : mongoDB',11,false,'-','Java'),
(45,'MONGO end point','com.mongodb.DB',' DB : mongoDB',11,false,'-','Java'),
(46,'CASSANDRA end point','com.datastax.driver.core.SessionManager',' SessionManager : cassandraDB',12,false,'-','Java'),
(47,'CASSANDRA end point','com.datastax.driver.core.RequestHandler',' RequestHandler : cassandraDB',12,false,'-','Java'),
(48,'CUSTOM LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V','LogEvent.<init>(String,Throwable)',13,false,'-','Java'),
(49,'CUSTOM LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;Ljava/lang/String;)V','LogEvent.<init>(String,String)',13,false,'-','Java'),
(50,'CUSTOM LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V','LogEvent.<init>(String,String,Throwable)',13,false,'-','Java'),
(51,'CUSTOM LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;)V','LogEvent.<init>(String)',13,false,'-','Java'),
(52,'CUSTOM ERROR LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V','LogEvent.<init>(String,Throwable)',14,false,'-','Java'),
(53,'CUSTOM ERROR LOG end point','atg.nucleus.logging.LogEvent.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V','LogEvent.<init>(String,String,Throwable)',14,false,'-','Java'),
(54,'CUSTOM ERROR LOG end point','ch.qos.logback.classic.spi.LoggingEvent.<init>(Ljava/lang/String;Lch/qos/logback/classic/Logger;Lch/qos/logback/classic/Level;Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V','LoggingEvent.<init>(String,Logger,Level,String,Throwable,Object)',14,false,'-','Java'),
(55,'THREAD end point','java.lang.Thread.start()V','start()',15,false,'-','Java'),
(56,'THREAD end point','java.lang.Thread.run()V','run()',15,false,'-','Java'),
(57,'THREAD end point','java.util.concurrent.ThreadPoolExecutor.execute(Ljava/lang/Runnable;)V','execute(Runnable)',15,false,'-','Java'),
(58,'THREAD end point', 'java.util.concurrent.ThreadPoolExecutor.beforeExecute(Ljava/lang/Thread;Ljava/lang/Runnable;)V','beforeExecute(Thread,Runnable)',15, false,'-','Java'), 
(59,'THREAD end point','java.util.concurrent.ThreadPoolExecutor.afterExecute(Ljava/lang/Runnable;Ljava/lang/Throwable;)V','afterExecute(Throwable)',15,false,'-','Java'),
(60,'THREAD end point','java.util.concurrent.ForkJoinPool.addSubmission(Ljava/util/concurrent/ForkJoinTask;)V','addSubmission(ForkJoinTask)',15,false,'-','Java'),
(61,'THREAD end point','java.util.concurrent.ForkJoinTask.doExec()V','doExec()V',15,false,'-','Java'),
(62,'THREAD end point','java.util.concurrent.ForkJoinPool.externalPush(Ljava/util/concurrent/ForkJoinTask;)V','externalPush(ForkJoinTask)',15,false,'-','Java'),
(63,'THREAD end point','java.util.concurrent.ForkJoinTask.doExec()I','doExec()I',15,false,'-','Java'),
(64,'THREAD end point','com.tibco.pe.core.JobDispatcher.schedule(Lcom/tibco/pe/core/Job;)V','schedule(Job)',15,false,'-','Java'),
(65,'THREAD end point','com.tibco.pe.core.JobDispatcher$JobCourier.a(Lcom/tibco/pe/core/Job;)Z','a(Job)',15,false,'-','Java'),
(66,'WS end point','com.sun.xml.ws.transport.http.client.HttpTransportPipe.writeSOAPAction(Ljava/util/Map;Ljava/lang/String;Lcom/sun/xml/ws/api/message/Packet;)V','writeSOAPAction(Map,String,Packet)(i.e Ljava/lang/String;Lcom/sun/xml/ws/api/message/Packet;)',2,false,'-','Java'),
(67,'WS end point','com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Lcom/sun/xml/internal/ws/api/message/Packet;)Lcom/sun/xml/internal/ws/api/pipe/NextAction;','writeSOAPAction(Packet)',2,false,'-','Java'),
(68,'WS end point','com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.writeSOAPAction(Ljava/util/Map;Ljava/lang/String;)V','writeSOAPAction(Map,String)',2,false,'-','Java'),
(69,'WS end point','com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.writeSOAPAction(Ljava/util/Map;Ljava/lang/String;Lcom/sun/xml/internal/ws/api/message/Packet;)V','writeSOAPAction(Map,String,Packet)(i.e Lcom/sun/xml/internal/ws/api/message/Packet;)',2,false,'-','Java'),
(70,'HTTP end point for dot net','System.Net.HttpWebRequest.GetResponse','HttpWebRequest.GetResponse',16,false,'System.dll','Dot Net'),
(71,'HTTP end point for dot net','System.Net.HttpWebRequest.BeginGetRequestStream', 'HttpWebRequest.BeginGetRequestStream' ,18, false,'System.dll','Dot Net'),
(72,'HTTP end point for dot net','System.Net.HttpWebRequest.BeginGetResponse','HttpWebRequest.BeginGetResponse',16,false,'System.dll','Dot Net'),
(73,'HTTP end point for dot net','System.Net.HttpWebRequest.EndGetResponse','HttpWebRequest.EndGetResponse',16,false,'System.dll','Dot Net'),
(74,'HTTP end point for dot net','System.Net.HttpWebRequest.GetRequestStream','HttpWebRequest.GetRequestStream',18,false,'System.dll','Dot Net'),
(80,'SQL call for dot net','System.Data.SqlClient.SqlCommand.RunExecuteReader','SqlCommand.RunExecuteReader',17,false,'System.Data.dll','Dot Net'),
(82,'SQL call for dot net','System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery','SqlCommand.InternalExecuteNonQuery',17,false,'System.Data.dll','Dot Net'),
(83,'ASYNC call for dot net','System.Web.HttpApplication.ExecuteStep','HttpApplication.ExecuteStep',18,false,'System.Web.dll','Dot Net'),
(84,'ASYNC call for dot net','System.Runtime.IOThreadScheduler.ScheduleCallbackLowPriNoFlow','IOThreadScheduler.ScheduleCallbackLowPriNoFlow',18,false,'System.ServiceModel.Internals.dll','Dot Net'),
(85,'ASYNC call for dot net', 'System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest','HostedHttpRequestAsyncResult.OnBeginRequest',18, false,'System.ServiceModel.Activation.dll','Dot Net'),
(86,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.find(Ljava/lang/String;)Ljava/io/InputStream;','Cloudant NoSQL find',19,false,'-','Java'),
(87,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.save(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL save',19,false,'-','Java'),
(88,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.post(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL post',19,false,'-','Java'),
(89,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.update(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL update',19,false,'-','Java'),
(90,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.remove(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL remove',19,false,'-','Java'),
(91,'WS end point','com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Ljavax/xml/soap/SOAPMessage;Ljava/net/URL;)Ljavax/xml/soap/SOAPMessage;','post(SOAP,URL)',2,false,'-','Java'),
(92,'CASSANDRA end point','com.datastax.driver.core.AbstractSession',' AbstractSession : cassandraDB',12,false,'-','Java'),
(93,'CASSANDRA end point','com.datastax.driver.core.RequestHandler$SpeculativeExecution',' SpeculativeExecution : cassandraDB',12,false,'-','Java'),
(94,'HTTP end point','com.google.api.client.http.HttpRequest.execute()Lcom/google/api/client/http/HttpResponse;','Big Query',1,false,'-','Java'),
(95,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.put(Lorg/apache/hadoop/hbase/client/Put;)V','Big Table: Put',20,false,'-','Java'),
(96,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.get(Lorg/apache/hadoop/hbase/client/Get;)Lorg/apache/hadoop/hbase/client/Result;','Big Table: Get',20,false,'-','Java'),
(97,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.delete(Lorg/apache/hadoop/hbase/client/Delete;)V','Big Table: Delete',20,false,'-','Java'),
(98,'Microsoft SQL end point','com.microsoft.sqlserver.jdbc.SQLServerStatement','SQLServerStatement',21,false,'-','Java'),
(99,'Microsoft SQL end point','com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement','SQLServerPreparedStatement',21,false,'-','Java'),
(100,'HTTP end point','java.net.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V','setRequestMethod(String)',1,false,'-','Java'),
(101,'HTTP end point','java.net.HttpURLConnection.getInputStream()Ljava/io/InputStream;','getInputStream()',1,false,'-','Java'),
(102,'HTTP end point','weblogic.net.http.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V','setRequestMethod(String)',1,false,'-','Java'),
(103,'HTTP end point','weblogic.net.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;','getInputStream()',1,false,'-','Java'),
(104,'HTTP end point','feign.Client$Default.execute(Lfeign/Request;Lfeign/Request$Options;)Lfeign/Response;','execute(Request,Request$Options)',1,false,'-','Java'),
(105,'HTTP end point','org.springframework.web.client.DefaultResponseErrorHandler.hasError(Lorg/springframework/http/client/ClientHttpResponse;)Z','hasError(ClientHttpResponse)',1,false,'-','Java'),
(106,'HTTP end point','java.net.URL.openConnection()Ljava/net/URLConnection;','openConnection()',1,false,'-','Java'),
(107,'HTTP end point','com.nds.nudetect.NuDetectClient.restCall(Ljava/lang/String;Ljava/lang/String;Lcom/nds/nudetect/ConstantsInternal$RESTRequestFunc;Lcom/nds/nudetect/TransactionParameters;)Lcom/nds/nudetect/RESTClientResponse;','restCall.<init>(String,String,ConstantsInternal$RESTRequestFunc,TransactionParameters)',1,false,'-','Java'),
(108,'HTTP end point','com.caucho.hessian.client.HessianProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;','invoke(Object,Method,Object)',1,false,'-','Java'),
(109,'HTTP end point','com.caucho.hessian.client.HessianProxy.addRequestHeaders(Ljava/net/URLConnection;)V','addRequestHeaders(URLConnection)',1,false,'-','Java'),
(110,'HTTP end point','com.caucho.hessian.client.HessianProxy.sendRequest(Ljava/lang/String;[Ljava/lang/Object;)Lcom/caucho/hessian/client/HessianConnection;','sendRequest(String,Object)',1,false,'-','Java'),
(111,'THREAD end point','java.util.concurrent.ForkJoinPool.forkOrSubmit(Ljava/util/concurrent/ForkJoinTask;)V','forkOrSubmit(ForkJoinTask)',15,false,'-','Java'),
(112,'THREAD end point','java.util.concurrent.ForkJoinTask.fork()Ljava/util/concurrent/ForkJoinTask;','fork()',15,false,'-','Java'),
(113,'THREAD end point','java.util.concurrent.ForkJoinTask.doInvoke()I','doInvoke()',15,false,'-','Java'),
(114,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace()V','printStackTrace()',14,false,'-','Java'),
(115,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/io/PrintStream;)V','printStackTrace(PrintStream)',14,false,'-','Java'),
(116,'CUSTOM ERROR LOG end point','java.lang.Throwable.printEnclosedStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;[Ljava/lang/StackTraceElement;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;)V','printEnclosedStackTrace(PrintStreamOrWriter,StackTraceElement,String,String,Set)',14,false,'-','Java'),
(117,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V','printStackTrace(PrintStreamOrWriter)',14,false,'-','Java'),
(118,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/io/PrintWriter;)V','printStackTrace(PrintWriter)',14,false,'-','Java'),
(119,'JDBC end point','oracle.jdbc.driver.OraclePreparedStatement','OraclePreparedStatement',3,false,'-','Java'),
(120,'JDBC end point','oracle.jdbc.driver.OracleStatement','OracleStatement',3,false,'-','Java'),
(121,'JDBC end point','com.mysql.cj.jdbc.PreparedStatement','Prepared Statement : mysqlDB',3,false,'-','Java'),
(122,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.get(Lorg/apache/hadoop/hbase/client/Get;)Lorg/apache/hadoop/hbase/client/Result;','get(Get)',8,false,'-','Java'),
(123,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.get(Ljava/util/List;)[Lorg/apache/hadoop/hbase/client/Result;','get(List)',8,false,'-','Java'),
(124,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.batchCallback(Ljava/util/List;[Ljava/lang/Object;Lorg/apache/hadoop/hbase/client/coprocessor/Batch$Callback;)V','batchCallback(List,Object,Batch$Callback)',8,false,'-','Java'),
(125,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.delete(Lorg/apache/hadoop/hbase/client/Delete;)V','delete(Delete)',8,false,'-','Java'),
(126,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.doPut(Lorg/apache/hadoop/hbase/client/Put;)V','doPut(Put)',8,false,'-','Java'),
(127,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.checkAndPut([B[B[B[BLorg/apache/hadoop/hbase/client/Put;)Z','checkAndPut(Put)',8,false,'-','Java'),
(128,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.checkAndDelete([B[B[B[BLorg/apache/hadoop/hbase/client/Delete;)Z','checkAndDelete(Delete)',8,false,'-','Java'),
(129,'MONGO end point','com.mongodb.Mongo','Mongo',11,false,'-','Java'),
(130,'CUSTOM LOG end point','org.apache.catalina.valves.AccessLogValve.log(Ljava/lang/String;)V','log(String)',13,false,'-','Java'),
(131,'CUSTOM LOG end point','org.apache.catalina.valves.AccessLogValve.log(Ljava/io/CharArrayWriter;)V','log(CharArrayWriter)',13,false,'-','Java'),
(132,'CUSTOM LOG end point','ch.qos.logback.core.encoder.LayoutWrappingEncoder.convertToBytes(Ljava/lang/String;)[B','convertToBytes(String)',13,false,'-','Java'),
(133,'CUSTOM LOG end point','weblogic.servlet.logging.FormatStringBuffer.getBytes()[B','getBytes()',13,false,'-','Java'),
(134,'RMI end point','java.rmi.Naming.<init>(Ljava/lang/String;ILjava/lang/String;)','Naming.<init>(String,String)',5,false,'-','Java'),
(135,'WS end point','com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;','_invoke(ClientRequest)',2,false,'-','Java'),
(136,'WS end point','org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode()I','getResponseCode()',2,false,'-','Java'),
(137,'WS end point','org.apache.cxf.jaxrs.client.WebClient.prepareHeaders(Ljava/lang/Class;Ljava/lang/Object;)Ljavax/ws/rs/core/MultivaluedMap;','prepareHeaders(Class,Object)',2,false,'-','Java'),
(138,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Class,Type)',2,false,'-','Java'),
(139,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Type,Class,Type)',2,false,'-','Java'),
(140,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Class,Type,Class,Type)',2,false,'-','Java'),
(141,'Log end point','org.apache.log4j.AppenderSkeleton.doAppend(Lorg/apache/log4j/spi/LoggingEvent;)V','Log: doappend(LoggingEvent)',22,false,'-','Java'),
(142,'XATransaction end point','oracle.jdbc.xa.client.OracleXAResource','XATransaction: OracleXAResource',24,false,'-','Java'),
(143,'JDBC Connection end point','weblogic.jdbc.common.internal.RmiDataSource','DBConnection: RmiDataSource',3,false,'-','Java'),
(144,'JDBC Connection end point','java.sql.DriverManager','DBConnection: DriverManager',3,false,'-','Java'),
(145,'JDBC Connection end point','org.apache.commons.dbcp.BasicDataSource','DBConnection: BasicDataSource',3,false,'-','Java'),
(146,'Neo4j DB Callout end point','org.neo4j.jdbc.http.driver.CypherExecutor.executeQuery(Lorg/neo4j/jdbc/http/driver/Neo4jStatement;)Lorg/neo4j/jdbc/http/driver/Neo4jResponse;','CypherExecutor.executeQuery(Neo4jStatement)',26,false,'-','Java'),
(147,'Neo4j DB Callout end point','org.neo4j.jdbc.bolt.BoltPreparedStatement.executeQuery()Ljava/sql/ResultSet;','BoltPreparedStatement.executeQuery()',26,false,'-','Java'),
(148,'Exception end point','java.lang.Throwable.<init>()V','Exception: <init>()V',23,false,'-','Java'),
(149,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/String;)V','Exception: <init>(Ljava/lang/String;)V',23,false,'-','Java'),
(150,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/Throwable;)V','Exception: <init>(Throwable)V',23,false,'-','Java'),
(151,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V','Exception: <init>(String,Throwable)V',23,false,'-','Java'),
(152,'Custom Log end point','io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver.logMessage(Ljava/lang/String;)V','DefaultAccessLogReceiver.logMessage(String)',13,false,'-','Java'),
(153,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Message;IIJ)V','MQMessageProducer.send(Message,IIJ)V',27,false,'-','Java'),
(154,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Message;)V','MQMessageProducer.send(Message)V',27,false,'-','Java'),
(155,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;)V','MQMessageProducer.send(Destination,Message)V',27,false,'-','Java'),
(156,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJ)V','MQMessageProducer.send(Destination,Message,IIJ)V',27,false,'-','Java'),
(157,'JMS Active Backend','org.apache.activemq.ActiveMQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJ)V','ActiveMQMessageProducer.send(Destination,Message,IIJ)V',27,false,'-','Java'),
(158,'JMS Active Backend','org.apache.activemq.ActiveMQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJLorg/apache/activemq/AsyncCallback;)V','ActiveMQMessageProducer.send(Destination,Message,AsyncCallback)V',27,false,'-','Java'),
(159,'JMS Rabbit Backend','com.rabbitmq.client.impl.AMQChannel.transmit(Lcom/rabbitmq/client/Method;)V','AMQChannel.transmit(Method)V',27,false,'-','Java'),
(160,'JMS Rabbit Backend','com.rabbitmq.client.impl.AMQChannel.transmit(Lcom/rabbitmq/client/impl/AMQCommand;)V','AMQChannel.transmit(AMQCommand)V',27,false,'-','Java'),
(161,'JMS ATG Backend','atg.dms.local.TopicPublisherImpl.publish(Ljavax/jms/Topic;Ljavax/jms/Message;)V','TopicPublisherImpl.publish(Topic,Message)V',27,false,'-','Java'),
(162,'JMS TIBCO Backend','com.tibco.tibjms.TibjmsMessageProducer._publish(Ljavax/jms/Destination;Ljavax/jms/Message;ZIIJZLjavax/jms/CompletionListener;)Lcom/tibco/tibjms/TibjmsMessage;','TibjmsMessageProducer._publish(Destination,Message,CompletionListener)V',27,false,'-','Java'),
(163,'Async HTTP Backend','org.apache.http.impl.nio.client.FutureWrapper','client.FutureWrapper',1,false,'-','Java'),
(164,'Async HTTP Backend','org.apache.http.concurrent.BasicFuture.completed(Ljava/lang/Object;)Z','BasicFuture.completed(Object)Z',1,false,'-','Java'),
(165,'Async HTTP Backend','org.apache.http.concurrent.BasicFuture.failed(Ljava/lang/Exception;)Z','BasicFuture.failed(Exception)Z',1,false,'-','Java'),
(166,'Async HTTP Backend','org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Lorg/apache/http/nio/protocol/HttpAsyncRequestProducer;Lorg/apache/http/nio/protocol/HttpAsyncResponseConsumer;Lorg/apache/http/protocol/HttpContext;Lorg/apache/http/concurrent/FutureCallback;)Ljava/util/concurrent/Future;','InternalHttpAsyncClient.execute(HttpAsyncRequestProducer,HttpAsyncResponseConsumer,HttpContext,FutureCallback)',1,false,'-','Java'),
(167,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.finishSetup()V','HTable.finishSetup()V',8,false,'-','Java'),
(168,'HTTP end point','org.apache.commons.httpclient.HttpClient.executeMethod(Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/apache/commons/httpclient/HttpState;)I','HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)',1,false,'-','Java'),
(169,'SQL call for dot net','System.Data.OracleClient.OracleCommand.ExecuteReader','OracleCommand.ExecuteReader',17,false,'System.Data.OracleClient.dll','Dot Net'),
(170,'SQL call for dot net','System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal','OracleCommand.ExecuteNonQueryInternal',17,false,'System.Data.OracleClient.dll','Dot Net');

+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES
(1,true,false,false,false,false,false,false,false,false,false,false,false,false,1,1),
(2,true,false,false,false,false,false,false,false,false,false,false,false,false,2,1),
(3,true,false,false,false,false,false,false,false,false,false,false,false,false,3,1),
(4,true,false,false,false,false,false,false,false,false,false,false,false,false,4,1),
(5,true,false,false,false,false,false,false,false,false,false,false,false,false,5,1),
(6,true,false,false,false,false,false,false,false,false,false,false,false,false,6,1),
(7,true,false,false,false,false,false,false,false,false,false,false,false,false,7,1),
(8,true,false,false,false,false,false,false,false,false,false,false,false,false,8,1),
(9,true,false,false,false,false,false,false,false,false,false,false,false,false,9,1),
(10,true,false,false,false,false,false,false,false,false,false,false,false,false,10,1),
(11,true,false,false,false,false,false,false,false,false,false,false,false,false,11,1),
(12,false,false,false,false,false,false,false,false,false,false,false,false,false,12,1),
(13,false,false,false,false,false,false,false,false,false,false,false,false,false,13,1),
(14,false,false,false,false,false,false,false,false,false,false,false,false,false,14,1),
(15,false,false,false,false,false,false,false,false,false,false,false,false,false,15,1),
(16,false,false,false,false,false,false,false,false,false,false,false,false,false,16,888888),
(17,false,false,false,false,false,false,false,false,false,false,false,false,false,17,888888),
(18,false,false,false,false,false,false,false,false,false,false,false,false,false,18,888888),
(19,true,false,false,false,false,false,false,false,false,false,false,false,false,19,1),
(20,true,false,false,false,false,false,false,false,false,false,false,false,false,20,1),
(21,true,false,false,false,false,false,false,false,false,false,false,false,false,21,1),
(22,true,false,false,false,false,false,false,false,false,false,false,false,false,22,1),
(23,true,false,false,false,false,false,false,false,false,false,false,false,false,23,1),
(24,true,false,false,false,false,false,false,false,false,false,false,false,false,24,1),
(26,true,true,false,false,false,false,true,false,false,false,false,false,false,26,1),
(27,true,true,false,false,false,false,false,false,false,false,false,true,false,27,1);

+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES
(1,true,1,1),
(2,true,2,1),
(3,true,3,1),
(4,true,4,1),
(5,true,5,1),
(6,true,6,1),
(7,true,7,1),
(8,true,8,1),
(9,true,9,1),
(10,true,10,1),
(11,true,11,1),
(12,true,12,1),
(13,false,13,1),
(14,true,14,1),
(15,true,15,1),
(16,false,16,1),
(17,false,17,1),
(19,true,19,1),
(20,true,20,1),
(21,true,21,1),
(22,true,22,1),
(23,true,23,1),
(24,true,24,1),
(25,true,25,1),
(26,true,26,1),
(27,true,27,1),
(28,true,28,1),
(29,true,29,1),
(30,true,30,1),
(31,true,31,1),
(32,true,32,1),
(33,false,33,1),
(34,true,34,1),
(35,true,35,1),
(36,true,36,1),
(37,true,37,1),
(38,true,38,1),
(39,true,39,1),
(40,true,40,1),
(41,true,41,1),
(42,false,42,1),
(43,false,43,1),
(44,true,44,1),
(45,true,45,1),
(46,true,46,1),
(47,true,47,1),
(48,false,48,1),
(49,false,49,1),
(50,false,50,1),
(51,false,51,1),
(52,true,52,1),
(53,true,53,1),
(54,false,54,1),
(55,true,55,1),
(56,true,56,1),
(57,true,57,1),
(58,true,58,1),
(59,true,59,1),
(60,true,60,1),
(61,true,61,1),
(62,true,62,1),
(63,true,63,1),
(64,true,64,1),
(65,true,65,1),
(66,true,66,1),
(67,true,67,1),
(68,true,68,1),
(69,true,69,1),
(70,true,70,888888),
(71,false,71,888888),
(72,true,72,888888),
(73,true,73,888888),
(74,true,74,888888),
(80,true,80,888888),
(82,true,82,888888),
(83,true,83,888888),
(84,true,84,888888),
(85,true,85,888888),
(86,true,86,1),
(87,true,87,1),
(88,true,88,1),
(89,true,89,1),
(90,true,90,1),
(91,true,91,1),
(92,true,92,1),
(93,true,93,1),
(94,true,94,1),
(95,true,95,1),
(96,true,96,1),
(97,true,97,1),
(98,true,98,1),
(99,true,99,1),
(100,true,100,1),
(101,true,101,1),
(102,true,102,1),
(103,true,103,1),
(104,true,104,1),
(105,true,105,1),
(106,false,106,1),
(107,true,107,1),
(108,true,108,1),
(109,true,109,1),
(110,true,110,1),
(111,true,111,1),
(112,true,112,1),
(113,true,113,1),
(114,true,114,1),
(115,false,115,1),
(116,false,116,1),
(117,false,117,1),
(118,false,118,1),
(119,true,119,1),
(120,true,120,1),
(121,false,121,1),
(122,true,122,1),
(123,true,123,1),
(124,true,124,1),
(125,true,125,1),
(126,true,126,1),
(127,true,127,1),
(128,true,128,1),
(129,true,129,1),
(130,true,130,1),
(131,true,131,1),
(132,true,132,1),
(133,true,133,1),
(134,false,134,1),
(135,true,135,1),
(136,true,136,1),
(137,true,137,1),
(138,true,138,1),
(139,true,139,1),
(140,true,140,1),
(141,true,141,1),
(142,true,142,1),
(143,true,143,1),
(144,true,144,1),
(145,true,145,1),
(146,true,146,1),
(147,true,147,1),
(148,true,148,1),
(149,true,149,1),
(150,true,150,1),
(151,true,151,1),
(152,false,152,1),
(153,true,153,1),
(154,true,154,1),
(155,true,155,1),
(156,true,156,1),
(157,true,157,1),
(158,true,158,1),
(159,true,159,1),
(160,true,160,1),
(161,true,161,1),
(162,true,162,1),
(163,true,163,1),
(164,true,164,1),
(165,true,165,1),
(166,true,166,1),
(167,true,167,1),
(168,true,168,1),
(169,true,169,888888),
(170,true,170,888888);

+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.headers_type;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.headers_type(ht_id,header_type_name) VALUES 
(1,'request'),
(2,'response'),
(3,'cookie');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.headers_meta_data;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.headers_meta_data(hmd_id,ht_id,header_name) VALUES
(1,1,'Accept-Charset'),
(2,1,'Accept-Datetime'),
(3,1,'Accept-Encoding'),
(4,1,'Accept-Language'),
(5,1,'Accept'),
(6,1,'Authorization'),
(7,1,'Cache-Control'),
(8,1,'Connection'),
(9,1,'Content-Length'),
(10,1,'Content-MD5'),
(11,1,'Content-Type'),
(12,1,'Cookie'),
(13,1,'DNT'),
(14,1,'Date'),
(15,1,'Expect'),
(16,1,'Front-End-Https'),
(17,1,'Host'),
(18,1,'If-Match'),
(19,1,'If-Modified-Since'),
(20,1,'If-None-Match'),
(21,1,'If-Range'),
(22,1,'If-Unmodified-Since'),
(23,1,'Max-Forwards'),
(24,1,'Origin'),
(25,1,'Pragma'),
(26,1,'Proxy-Authorization'),
(27,1,'If-Range'),
(28,1,'Proxy-Connection'),
(29,1,'Range'),
(30,1,'Referer'),
(31,1,'TE'),
(32,1,'Upgrade'),
(33,1,'User-Agent'),
(34,1,'Via'),
(35,1,'Warning'),
(36,1,'X-ATT-DeviceId'),
(37,1,'X-Forwarded-For'),
(38,1,'X-Forwarded-Proto'),
(39,1,'X-Requested-With'),
(40,1,'X-Wap-Profile'),
(41,2,'Accept-Ranges'),
(42,2,'Access-Control-Allow-Origin'),
(43,2,'Age'),
(44,2,'Allow'),
(45,2,'Cache-Control'),
(46,2,'Connection'),
(47,2,'Content-Disposition'),
(48,2,'Content-Encoding'),
(49,2,'Content-Language'),
(50,2,'Content-Length'),
(51,2,'Content-Location'),
(52,2,'Content-MD5'),
(53,2,'Content-Range'),
(54,2,'Content-Security-Policy'),
(55,2,'Content-Type'),
(56,2,'Date'),
(57,2,'ETag'),
(58,2,'Expires'),
(59,2,'Last-Modified'),
(60,2,'Link'),
(61,2,'Location'),
(62,2,'P3P'),
(63,2,'Pragma'),
(64,2,'Proxy-Authenticate'),
(65,2,'Refresh'),
(66,2,'Retry-After'),
(67,2,'Server'),
(68,2,'Set-Cookie'),
(69,2,'Status'),
(70,2,'Strict-Transport-Security'),
(71,2,'Trailer'),
(72,2,'Transfer-Encoding'),
(73,2,'Vary'),
(74,2,'Via'),
(75,2,'WWW-Authenticate'),
(76,2,'Warning'),
(77,2,'X-Content-Security-Policy'),
(78,2,'X-Content-Type-Options'),
(79,2,'X-Frame-Options'),
(80,2,'X-Powered-By'),
(81,2,'X-UA-Compatible'),
(82,2,'X-WebKit-CSP'),
(83,2,'X-XSS-Protection'),
(84,2,'Accept-Charset'),
(85,2,'Accept-Datetime'),
(86,2,'Accept-Encoding'),
(87,2,'Accept'),
(88,2,'Authorization'),
(89,2,'Cookie'),
(90,2,'DNT'),
(91,2,'Expect'),
(92,2,'Front-End-Https'),
(93,2,'Host'),
(94,2,'If-Match'),
(95,2,'If-Modified-Since'),
(96,2,'If-None-Match'),
(97,2,'If-Range'),
(98,2,'If-Unmodified-Since'),
(99,2,'Max-Forwards'),
(100,2,'Origin'),
(101,2,'Proxy-Authorization'),
(102,2,'Proxy-Connection'),
(103,2,'CavNDFPInstance'),
(104,2,'TE'),
(105,2,'Upgrade'),
(106,2,'User-Agent'),
(107,2,'X-ATT-DeviceId'),
(108,2,'X-Forwarded-For'),
(109,2,'X-Forwarded-Proto'),
(110,2,'X-Requested-With'),
(111,2,'X-Wap-Profile'),
(112,1,'CavNDFPInstance'),
(113,2,'Referer'),
(114,2,'Range');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.value_type;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.value_type(val_id,val_type) VALUES 
(1,'String'),
(2,'Numeric'),
(3,'Others');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.bussiness_trans_global;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
  Error=`psql test cavisson 2>&1<<+
  INSERT INTO config_$CONTROLLER_NAME.bussiness_trans_global(bt_global_id, complete, dynamic_req_type, dynamic_req_value, http_method, request_header, request_param, segment_type, segment_uri,segment_value, slow_transaction, uri_type, very_slow_transaction, profile_id, slow_threshold, very_slow_threshold, segment_no) VALUES 
  (1, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000, 1, '10', '20',''), 
  (2, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000, 777777, '10', '20',''), 
  (3, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000, 888888, '10', '20','');
+` 
  show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.conditional_operator;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.conditional_operator(opt_id,val_id,operators) VALUES
(1,1,'='),
(2,1,'!='),
(3,1,'contains'),
(4,1,'!contains'),
(5,2,'='),
(6,2,'!='),
(7,2,'<'),
(8,2,'<='),
(9,2,'>'),
(10,2,'>='),
(11,3,'PRESENT'),
(12,3,'!PRESENT'),
(13,1,'PRESENT'),
(14,1,'!PRESENT'),
(15,2,'PRESENT'),
(16,2,'!PRESENT');
+`
show_error
  fi
fi
   
#Check if keywords exists in config_$CONTROLLER_NAME.ndc_keywords or not,if not then insert
  data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.ndc_keywords;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES 
(1,'NDC_WAIT_TIME_AFTER_TEST_IS_OVER','','','30','30',''),
(2,'NDC_CONTROL_MSG_ACK_TIMEOUT','','','10','10',''),
(3,'NDC_CONTROL_THREAD_EPOLL_TIMEOUT','','','10',10,''),
(4,'NDC_CONTINUE_ON_CONTROL_CONNECTION_ERROR','','','2','2',''),
(5,'NDC_TIME_TO_SEND_HEART_BEAT_TO_BCI','','','300','300',''),
(6,'NDP_TR_RUNNING_STATUS_POLL_INTERVAL','','','500','500',''),
(7,'NDP_NEW_RAW_DATA_POLL_INTERVAL','','','500','500',''),
(8,'ENABLE_METHOD_TIMING_TABLE','','','1','1',''),
(9,'NDP_OMIT_NON_NS_FLOWPATHS','','','1','1',''),
(10,'NDP_EXCLUDE_FLOWPATHS_OUTSIDE_TESTIDX','','','1','1',''),
(11,'NDP_TRACE_LEVEL','0','4','1','1',''),
(12,'MAX_METHOD_CALL_STACK','1','10485760','128','128',''),
(13,'NDP_INIT_CONCURRENT_FLOWPATHS','8','10485760','512','512',''),
(14,'NDP_DELTA_CONCURRENT_FLOWPATHS','8','10485760','512','512',''),
(15,'NDP_MAX_BUFFERED_META_DATA_BUFSIZE','8','1048576','64','64',''),
(16,'NDP_MAX_BUFFERED_BCI_ARG_BUFSIZE','8','1048576','64','64',''),
(17,'NDP_MAX_BUFFERED_HTTP_HEADER_MD_BUFSIZE','8','1048576','8','8',''),
(18,'NDP_MAX_BUFFERED_HTTP_HEADER_BUFSIZE','8','1048576','64','64',''),
(19,'NDP_MAX_BUFFERED_EXCEPTION_DATA_BUFSIZE','8','1048576','64','64',''),
(20,'NDP_MAX_BUFFERED_FLOWPATH_BUFSIZE','8','1048576','512','512',''),
(21,'NDP_MAX_BUFFERED_APPLOG_BUFSIZE','8','1048576','512','512',''),
(22,'NDP_MAX_BUFFERED_METHOD_TIMING_TABLE_ENTRIES','8','1048576','1024','1024',''),
(23,'NDP_MAX_BUFFERED_MEM_ALLOC_BUFSIZE','8','1048576','16','16',''),
(24,'NDP_MAX_BUFFERED_SQL_TABLE_BUFSIZE','32','1048576','32','32',''),
(25,'NDP_MAX_BUFFERED_SQL_RECORD_TABLE_BUFSIZE','8','1048576','16','16',''),
(26,'NDP_DEBUG_LOGFILE_ROLLOVER_SIZE','1','102400','100','100',''),
(27,'NDP_FORCE_UPLOAD_TIMEOUT','1','2592000000','10','10',''),
(28,'NDP_SECS_TO_MARK_AN_FP_DEAD','0','43200','90','90',''),
(29,'NDP_SECS_TO_CLEAN_DEAD_FLOWPATHS','0','43200','10','10',''),
(30,'DB_UPLOAD_MODE','','','1','1',''),
(31,'NDP_FORCE_ADD_URC_FOR_NS_FPI_IN_MAPPING_RECORD','','','0','0',''),
(32,'NDP_MAX_ENTRY_EXIT_RECORDS_IN_AN_FP','0','10000000','110000','110000',''),
(33,'NDP_LOWER_PROCESS_PRIORITY_FLAG','','','0','0',''),
(34,'NDP_MAX_BUFFERED_JMS_BUFSIZE','8','1048576','32','32',''),
(35,'NDP_MAX_CONCURRENT_THREADS_IN_JVM','','','512','512',''),
(36,'NDP_METHOD_TIMING_CSV_FLUSH_INTERVAL_SECS','0','10000000','300','300',''),
(37,'NDP_DISABLE_DUMPING_CAPTURED_HTTP_BODY','0','1','0','0',''),
(38,'NDC_STOP_INSTRUMENTATION_RESPONSE_TIMEOUT','','','300000','300000',''),
(39,'NDC_ACCEPT_NEW_AND_CLOSE_CURRENT_DATA_CONNECTION','','','1','1',''),
(40,'NDC_DATA_THD_TERM_RETRY_COUNT','','','50','50',''),
(41,'NDC_DATA_THD_TERM_RETRY_INTERVAL_MSEC','','','200000','200000',''),
(42,'SND_RESP_TO_BCI_ON_DATA_CONN','','','0','0',''),
(43,'NDC_LOG_BCI_AGGREGATE_RAW_DATA','','','0','0',''),
(44,'NDP_SEQ_BLOB_IN_FILE_MIN_SIZE','1','2048','64','64',''),
(45,'NDP_SEQ_BLOB_COMPRESSION_BUFFER_INIT_SIZE','1','2048','1024','1024',''),
(46,'MAX_BUFFERED_SQB_BUFSIZE','8','1024000','8192','8192',''),
(47,'NDC_WAIT_TIME_TO_SEND_FORCE_STOP_COMP_SIG','','','60','60',''),
(48,'NDP_DUMP_URC','','','0','0',''),
(49,'NDP_META_DATA_RECOVERY_RETRY_TIMEOUT_IN_SEC','','','60','60',''),
(50,'NDP_SQL_START_NORM_ID','0','2000000000','0','0',''),
(51,'NDP_ENABLE_SQL_TIMING','','','1','1',''),
(52,'NDP_ENABLE_SQL_RECORD','','','0','0',''),
(53,'NDP_ENABLE_BCIARG','','','1','1',''),
(54,'NDDBU_CHUNK_SIZE','','','134217728','134217728',''),
(55,'NDDBU_IDLE_TIME','','','5','5',''),
(57,'NDP_FORCE_ADD_URC_FOR_MISSING_FP_MAPPING_RECORD','','','0','0',''),
(58,'NDP_FREE_FP_MIN_SQB_SIZE','','','32768','32768',''),
(59,'NDP_RAW_DATA_BUF_SIZE','','','262144','262144',''),
(60,'NDP_GENERATE_FP_SIGNATURES','','','0','0',''),
(61,'NDP_MIN_RESPTIME_TO_FILTER_L1_FP','','','0','0',''),
(62,'NDP_BINARY_FORMAT_FOR_METHOD_TIMING','','','1','1',''),
(63,'NDC_BCI_TIME_DIFF_THRESHOLD_IN_MS','','','0','0',''),
(64,'NDC_HS_ST_IN_FILE_MIN_SIZE','1','2000000000','64','64',''),
(65,'NDC_HS_ST_COMPRESSION_BUFFER_INIT_SIZE','1','2000000000','1024','1024',''),
(66,'ND_ENABLE_MONITOR_LOG','','','0','0',''),
(67,'NDP_MAX_ENTRY_EXIT_RECORDS_IN_AN_FP_EX2','','','1000000','1000000',''),
(68,'ENABLE_AUTO_SCALING','','','0','0',''),
(69,'NDC_MODIFY_TOPO_ENTRY','','','1','1',''),
(70,'NDC_DATA_THD_TERM_RETRY_INTERVAL_SEC','','','20','20',''),
(71,'NDP_DEBUG_LOGLEVEL','0','4','0','0',''),
(72,'NDC_REUSE_INSTANCE_ID_TIME_IN_MIN','','','0','0',''),
(73,'NDP_ENABLE_METADATA_RECOVERY','','','1','1',''),
(74,'NDP_ALLOW_REQ_DETAIL_BEFORE_SQB_BEGIN_REC','','','1','1',''),
(75,'NDC_LOG_BCI_AGGREGATE_RAW_DATA_EX','','','0','0',''),
(76,'NDC_BCI_RESPONSE_TIME_FOR_METADATA_IN_SECS','','','60','60',''),
(77,'ENABLE_FP_STAT_MONITOR','','','0','0',''),
(78,'SEND_ACTIVE_INSTANCE_REP','','','1','1',''),
(79,'NDC_MAX_CTRL_CON','','','400','400',''),
(80,'NDP_MAX_SQL_INDEX_FROM_BCI','','','4096','4096',''),
(81,'NDC_TRACING_LEVEL','','','1 50','1 50',''),
(83,'NDP_SEQ_BLOB_IN_FILE_FLAG','','','1 B 10000','1 B 10000',''),
(85,'NDC_HS_ST_IN_FILE_FLAG','','','1 B','1 B',''),
(86,'ND_ENABLE_CAPTURE_DB_TIMING','','','1 0 0 0','1 0 0 0',''),
(87,'NDC_THRESHOLD_TIME_TO_MARK_APP_INACTIVE','','','1H 10M','1H 10M',''),
(88,'NDDBU_TMP_FILE_PATH','','','/mnt/tmp','/mnt/tmp',''),
(89,'ND_FPI_MASK','','','NDEID:56:4;AppID:46:10;TS:8:38;SeqNo:0:8;','NDEID:56:4;AppID:46:10;TS:8:38;SeqNo:0:8;',''),
(90,'NDC_THRESHOLD_TO_MARK_DELETED','','','1 8h','1 8h',''),
(91,'NDP_DELETED_INSTANCE_CLEANUP_DELAY','0','','3D','3D',''),
(92,'SND_RESP_TO_BCI_ON_DATA_CONN','0','1','0','0',''),
(93,'SEND_NDCOLLECTOR_IP','0','1','1','1','NDC'),
(94,'AUTO_SCALE_BLOCKED_TIER','','','','','NDC'),
(95,'AUTO_SCALE_ALLOWD_TIER','','','','','NDC'),
(96,'NDP_EXTENDED_METADATA','0','1','0','0','NDP'),
(97,'NDP_MAX_BEGIN_SEQ_LEN','0','256','256','256','NDP'),
(98,'NDP_FREE_FP_MEM_ON_COMPLETION','0','1','0','0','NDP'),
(99,'NDP_MEMPOOL_SETTINGS','','','','','NDP'),
(100,'NDP_MONITORS','','','','','NDP'),
(101,'NDP_ENABLE_SQL_METADATA_RECOVERY','0','1','1','1','NDP'),
(102,'NDP_THRESHOLD_DIFF_BET_FP_AND_ENTRY_MTD_RESPTIME_SEC','','','900','900','NDP'),
(103,'NDP_NUM_NONPREP_SQL_LOAD_AT_INIT','','','2500','2500','NDP'),
(104,'NDP_SQL_NONPREP_ROLLOVER_SIZE_MB','','','100','100','NDP'),
(105,'NDP_PERIODIC_SCANDIR_TIME','','','600','600','NDP'),
(106,'NDP_MON_LARGE_FLOWPATH_METHOD_COUNT','','','10000','10000','NDP'),
(107,'NDC_THRESHOLD_TO_DELETE_INVALID_SERVERS','','','1 1h','1 1h','');
+`
show_error
  fi
fi

#Check ai_enable column exists in config_$CONTROLLER_NAME.instance table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select ai_enable from config_$CONTROLLER_NAME.instance;")
 if [ $? -ne 0 ]
 then
   #if ai_enable column does not exist then insert add that column in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.instance add COLUMN ai_enable boolean;
+`
show_error
   fi
 fi
  
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.instance set ai_enable = false;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = true where end_point_id = 8;
+`
show_error

#Update backend_type_name for the backend_type_id
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type 
SET backend_type_name = 
    CASE backend_type_id  
        WHEN 1  THEN 'HTTP'
	WHEN 2  THEN 'Web Services'
	WHEN 3  THEN 'JDBC'
	WHEN 4  THEN 'Coherence'
	WHEN 5  THEN 'RMI'
	WHEN 6  THEN 'Mem Cache'
	WHEN 7  THEN 'Cloudant'
	WHEN 8  THEN 'Hadoop'
	WHEN 9  THEN 'Custom'
	WHEN 10  THEN 'Redis'
	WHEN 11  THEN 'Mongo'
	WHEN 12  THEN 'Cassandra'
	WHEN 13  THEN 'Custom Log'
	WHEN 14  THEN 'Custom Error Log'
	WHEN 15  THEN 'Thread'
	WHEN 16  THEN 'HTTP'
	WHEN 17  THEN 'SQL'
	WHEN 18  THEN 'Async_Call'
    END
WHERE backend_type_id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);
+`
show_error

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.auto_instrumentation ALTER COLUMN configuration TYPE varchar(500);
Update config_$CONTROLLER_NAME.service_entry_points set entry_fqm = 'com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(Ljavax/jms/Message;)V' where entry_id = 17;
Update config_$CONTROLLER_NAME.service_entry_points set entry_name = 'MQMessageConsumer$FacadeMessageListener.onMessage' where entry_id = 17;
Update config_$CONTROLLER_NAME.backend_points set end_point_fqm = 'net.rubyeye.xmemcached.XMemcachedClient.delete0(Ljava/lang/String;IJZJ)Z' where end_point_id = 30;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = true where end_point_id in (4, 9, 20);
Update config_$CONTROLLER_NAME.profile_service_entry_asso set profile_enable = false where entry_id in (8, 12, 13, 14, 15);
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id in (13, 71, 75, 79, 81);
+`
show_error

#Update entry_type_name & backend_type_name_entrypointsfile for the entry_type_id & backend_type_id respectively.
Error=` psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.entry_type 
SET entry_type_name = 
    CASE entry_type_id  
        WHEN 4  THEN 'JerseyCall'
	WHEN 5  THEN 'GlassFishJersey'
	WHEN 12  THEN 'TX_EXIT'
    END
WHERE entry_type_id in (4, 5, 12);

UPDATE config_$CONTROLLER_NAME.backend_type 
SET backend_type_name_entrypointsfile = 
    CASE backend_type_id  
        WHEN 16  THEN 'HTTP_CALLOUT'
	WHEN 17  THEN 'SQL_CALLOUT'
	WHEN 18  THEN 'ASYNC_CALL'
    END
WHERE backend_type_id in (16, 17, 18);
+`
show_error

#Check entry_id 22  exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 22;")
 if [ $? -eq 0 ]
 then
   #if 22 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X22" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES(22,' ','org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','ServletHandler$CachedChain.doFilter',1,false,'-','Java');
+`
show_error
   fi
 fi

#Check entry_id 22 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 22;")
 if [ $? -eq 0 ]
 then
   #if 22 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X22" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES(22, true, 22, 1);
+`
show_error
   fi
 fi

 #Check backend_type_id 19 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 19;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X19" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES(19,'Cloudant NoSQL Backend','Cloudant NoSQL','cloudantEntry','CLOUDANT','Java');
+`
show_error
      fi
    fi

 #Check backend_type_id 20 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 20;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X20" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (20,'Big Table Backend','Big Table','bigTable','None','Java');
+`
show_error
      fi
    fi

 #Check backend_type_id 21 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 21;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X21" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (21,'Microsoft SQL Backend','Microsoft SQL','microsoftDB','None','Java');
+`
show_error
      fi
    fi

 #Check end_point_id 86 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 86;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X86" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (86,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.find(Ljava/lang/String;)Ljava/io/InputStream;','Cloudant NoSQL find',19,false,'-','Java');
+`
show_error
      fi
    fi
	
#Check end_point_id 87 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 87;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X87" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (87,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.save(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL save',19,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 88 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 88;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X88" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (88,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.post(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL post',19,false,'-','Java');
+`
show_error
      fi
    fi
		
#Check end_point_id 89 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 89;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X89" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (89,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.update(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL update',19,false,'-','Java');
+`
show_error
      fi
    fi
	
#Check end_point_id 90  exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 90;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X90" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (90,'CLOUDANT NoSQL end point','com.cloudant.client.org.lightcouch.CouchDatabaseBase.remove(Ljava/lang/Object;)Lcom/cloudant/client/org/lightcouch/Response;','Cloudant NoSQL remove',19,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 91 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 91;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X91" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (91,'WS end point','com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Ljavax/xml/soap/SOAPMessage;Ljava/net/URL;)Ljavax/xml/soap/SOAPMessage;','post(SOAP,URL)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 92 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 92;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X92" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (92,'CASSANDRA end point','com.datastax.driver.core.AbstractSession',' AbstractSession : cassandraDB',12,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 93 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 93;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X93" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (93,'CASSANDRA end point','com.datastax.driver.core.RequestHandler$SpeculativeExecution',' SpeculativeExecution : cassandraDB',12,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 94 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 94;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X94" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (94,'HTTP end point','com.google.api.client.http.HttpRequest.execute()Lcom/google/api/client/http/HttpResponse;','Big Query',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 95 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 95;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X95" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (95,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.put(Lorg/apache/hadoop/hbase/client/Put;)V','Big Table: Put',20,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 96 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 96;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X96" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (96,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.get(Lorg/apache/hadoop/hbase/client/Get;)Lorg/apache/hadoop/hbase/client/Result;','Big Table: Get',20,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 97 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 97;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X97" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (97,'Big Table end point','com.google.cloud.bigtable.hbase.BigtableTable.delete(Lorg/apache/hadoop/hbase/client/Delete;)V','Big Table: Delete',20,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 98 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 98;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X98" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (98,'Microsoft SQL end point','com.microsoft.sqlserver.jdbc.SQLServerStatement','SQLServerStatement',21,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 99 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 99;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X99" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (99,'Microsoft SQL end point','com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement','SQLServerPreparedStatement',21,false,'-','Java');
+`
show_error
      fi
    fi

#Check backend_type_id 19 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 19;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X19" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES(19,true,false,false,false,false,false,false,false,false,false,false,false,false,19,1);
+`
show_error
      fi
    fi
	
#Check backend_type_id 20 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 20;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X20" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (20,true,false,false,false,false,false,false,false,false,false,false,false,false,20,1);
+`
show_error
      fi
    fi

#Check backend_type_id 21 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 21;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X21" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (21,true,false,false,false,false,false,false,false,false,false,false,false,false,21,1);
+`
show_error
      fi
    fi
	
#Check end_point_id 86 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 86;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X86" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(86,true,86,1);
+`
show_error
      fi
    fi

#Check end_point_id 87 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 87;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X87" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(87,true,87,1);
+`
show_error
      fi
    fi
	
#Check end_point_id 88 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 88;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X88" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(88,true,88,1);
+`
show_error
      fi
    fi
	
#Check end_point_id 89 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 89;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X89" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(89,true,89,1);
+`
show_error
      fi
    fi

#Check end_point_id 90 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 90;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X90" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(90,true,90,1);
+`
show_error
      fi
    fi

#Check end_point_id 91 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 91;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X91" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES(91,true,91,1);
+`
show_error
      fi
    fi

#Check end_point_id 92 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 92;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X92" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (92,true,92,1);
+`
show_error
      fi
    fi

#Check end_point_id 93 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 93;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X93" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (93,true,93,1);
+`
show_error
      fi
    fi

#Check end_point_id 94 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 94;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X94" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (94,true,94,1);
+`
show_error
      fi
    fi

#Check end_point_id 95 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 95;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X95" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (95,true,95,1);
+`
show_error
      fi
    fi

#Check end_point_id 96 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 96;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X96" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (96,true,96,1);
+`
show_error
      fi
    fi

#Check end_point_id 97 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 97;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X97" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (97,true,97,1);
+`
show_error
      fi
    fi

#Check end_point_id 98 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 98;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X98" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (98,true,98,1);
+`
show_error
      fi
    fi

#Check end_point_id 99 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 99;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X99" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (99,true,99,1);
+`
show_error
      fi
    fi

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ADD COLUMN module varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ADD COLUMN agent varchar(50);
ALTER TABLE config_$CONTROLLER_NAME.return_type ADD COLUMN header_value varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.return_type ADD COLUMN lb varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.return_type ADD COLUMN rb varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.argment_type ADD COLUMN header_value varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.argment_type ADD COLUMN lb varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.argment_type ADD COLUMN rb varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.bussiness_trans_global ADD COLUMN segment_no varchar(255);
Update config_$CONTROLLER_NAME.bussiness_trans_global set segment_type = 'FromFirst' where bt_global_id in (1, 2, 3);
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN bt_id bigint;
ALTER TABLE config_$CONTROLLER_NAME.method_based_customdata ALTER COLUMN fqm TYPE varchar(4096);
ALTER TABLE config_$CONTROLLER_NAME.bt_method ALTER COLUMN fqm TYPE varchar(4096);
ALTER TABLE config_$CONTROLLER_NAME.service_entry_points ALTER COLUMN entry_fqm TYPE varchar(4096);
ALTER TABLE config_$CONTROLLER_NAME.backend_points ALTER COLUMN end_point_fqm TYPE varchar(4096);
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_def_value = '2' , ndc_key_val='2' where ndc_key_id = 4;
DELETE FROM config_$CONTROLLER_NAME.ndc_keywords WHERE ndc_key_id in (56, 82, 84);
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN parent_bt_id bigint;
ALTER TABLE config_$CONTROLLER_NAME.auto_instrumentation ADD COLUMN trigger_screen varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.auto_instrumentation ADD COLUMN type varchar(255);
Update config_$CONTROLLER_NAME.keywords set key_def_value = '0' where key_id = 37;
+`
show_error

#Check key_id 103 exists in config_$CONTROLLER_NAME.keywords table or not
 KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 103;")
if [ $? -eq 0 ]
then
 #if 22 row does not exist then insert that row in table
 if [ "X$KEY_ID" != "X103" ]
 then
Error=` psql test cavisson 2>&1<<+
   INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES(103,'dumpOnlyMethodExitInFP','0','1','2','0','normal');
+`
show_error
 fi
fi
 
#Check key_id 104 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 104;")
 if [ $? -eq 0 ]
 then
   #if 22 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X104" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES(104, 'methodResponseTimeFilter', '0', '3600000', '5', '0%201%2020', 'normal');
+`
show_error
   fi
 fi

#Check key_id 105 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 105;")
 if [ $? -eq 0 ]
 then
   #if 22 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X105" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (105,'NDAsyncRuleConfig','1','1024','6','false','normal');
+`
show_error
   fi
 fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.container_type;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.container_type (container_id,description,container_type,container_name) VALUES
(1,'Asynchronous Transaction Rules for Jetty application','Jetty','jetty'),
(2,'Asynchronous Transaction Rules for Tomcat application','Tomcat','tomcat'),
(3,'Asynchronous Transaction Rules for Weblogic application','Weblogic','weblogic');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule(async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES
(1,'org.eclipse.jetty.server.Request.startAsync()Ljavax/servlet/AsyncContext;',1,'start',0),
(2,'org.eclipse.jetty.server.Request.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;',1,'start',0),
(3,'org.eclipse.jetty.server.AsyncContextState.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V',1,'dispatch',2),
(4,'org.eclipse.jetty.server.AsyncContextState.dispatch(Ljava/lang/String;)V',1,'dispatch',2),
(5,'org.eclipse.jetty.server.AsyncContextState.dispatch()V',1,'dispatch',2),
(6,'org.eclipse.jetty.server.AsyncContextState.complete()V',1,'complete',2),
(7,'weblogic.servlet.internal.ServletRequestImpl.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Z)Ljavax/servlet/AsyncContext;',3,'start',0),
(8,'weblogic.servlet.internal.ServletRequestImpl.startAsync()Ljavax/servlet/AsyncContext;',3,'start',0),
(9,'weblogic.servlet.internal.ServletRequestImpl.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse)Ljavax/servlet/AsyncContext;',3,'start',0),
(10,'weblogic.servlet.internal.async.AsyncContextImpl.dispatch()V',3,'dispatch',2),
(11,'weblogic.servlet.internal.async.AsyncContextImpl.dispatch(Ljava/lang/String;)V',3,'dispatch',2),
(12,'weblogic.servlet.internal.async.AsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V',3,'dispatch',2),
(13,'weblogic.servlet.internal.async.AsyncContextImpl.complete()V',3,'complete',2),
(14,'org.apache.catalina.connector.Request.startAsync()Ljavax/servlet/AsyncContext;',2,'start',0),
(15,'org.apache.catalina.connector.Request.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;',2,'start',0),
(16,'org.apache.catalina.core.AsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V',2,'dispatch',2),
(17,'org.apache.catalina.core.AsyncContextImpl.dispatch(Ljava/lang/String;)V',2,'dispatch',2),
(18,'org.apache.catalina.core.AsyncContextImpl.dispatch()V',2,'dispatch',2),
(19,'org.apache.catalina.core.AsyncContextImpl.complete()V',2,'complete',2);
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.profile_async_type_assoc;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_async_type_assoc(assoc_id,container_id,enabled,profile_id) VALUES
(1,1,true,1),
(2,2,true,1),
(3,3,true,1);
+`
show_error
  fi
fi

#Check ndc_key_id 90 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 90;")
 if [ $? -eq 0 ]
 then
   #if 90 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X90" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords (ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val ) VALUES (90,'NDC_THRESHOLD_TO_MARK_DELETED','','','1 8h','1 8h');
+`
show_error
   fi
 fi

#Check ndc_key_id 91 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 91;")
 if [ $? -eq 0 ]
 then
   #if 90 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X91" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords (ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val ) VALUES (91,'NDP_DELETED_INSTANCE_CLEANUP_DELAY','0','','3D','3D');
+`
show_error
   fi
 fi

#Check ndc_key_id 92 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 92;")
 if [ $? -eq 0 ]
 then
   #if 92 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X92" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val ) VALUES (92,'SND_RESP_TO_BCI_ON_DATA_CONN','0','1','0','0');
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set key_max = '3600000', key_def_value = '0%201%2020' where key_id = 104;
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN is_tx_async bigint;
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_key_name = 'NDC_THRESHOLD_TO_MARK_DELETED' where ndc_key_id = 90;
Update config_$CONTROLLER_NAME.entry_type set entry_type_name = 'jerseyCall' where entry_type_id = 4;
Update config_$CONTROLLER_NAME.entry_type set entry_type_name = 'glassFishJersey' where entry_type_id = 5;
Update config_$CONTROLLER_NAME.backend_points set end_point_fqm = 'com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Ljavax/xml/soap/SOAPMessage;Ljava/net/URL;)Ljavax/xml/soap/SOAPMessage' where end_point_id = 91;
ALTER TABLE config_$CONTROLLER_NAME.topo_profile_assoc add COLUMN tier_group_id bigint;
+`
show_error

#Check key_id 106 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 106;")
 if [ $? -eq 0 ]
 then
   #if 106 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X106" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (106,'enableHSLongStack','0','1024','5','0%5%Immediate,TickObject,Timeout,TIMERWRAP','normal');
+`
show_error
   fi
 fi

 #Check key_id 107 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 107;")
 if [ $? -eq 0 ]
 then
   #if 107 row does not exist then insert that row in tabled
   if [ "X$KEY_ID" != "X107" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (107,'correlateEventCallback','0','512','5','0','normal');
+`
show_error
   fi
 fi

 #Check key_id 108 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 108;")
 if [ $? -eq 0 ]
 then
   #if 108 row does not exist then insert that row in tabled
   if [ "X$KEY_ID" != "X108" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (108,'enableWaitSyncQueueTime','0','1','2','1','pre-custom');
+`
show_error
   fi
 fi

  #Check key_id 109 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 109;")
 if [ $? -eq 0 ]
 then
   #if 109 row does not exist then insert that row in tabled
   if [ "X$KEY_ID" != "X109" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (109,'enableCaptureNetDelay','0','1','2','0','normal');
+`
show_error
   fi
 fi

  #Check key_id 110 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 110;")
 if [ $? -eq 0 ]
 then
   #if 110 row does not exist then insert that row in tabled
   if [ "X$KEY_ID" != "X110" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (110,'enableFPMethodStackTrace','0','512','5','0%205%205%205%2010%200','normal');
+`
show_error
   fi
 fi

 #Check key_id 112 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 112;")
 if [ $? -eq 0 ]
 then
   #if 112 row does not exist then insert that row in tabled
   if [ "X$KEY_ID" != "X112" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (112,'ndMBeanMonTraceLevel','0','6','2','0','normal');
+`
show_error
   fi
 fi

#===============================================NEW SERVICE & BACKEND ENTRY ADDED==================================
#Check entry_id 23  exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 23;")
 if [ $? -eq 0 ]
 then
   #if 23 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X23" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (23,' ','org.springframework.web.filter.OncePerRequestFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V','OncePerRequestFilter.doFilter',1,false,'-','Java');
+`
show_error
   fi
 fi

  #Check entry_id 24  exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 24;")
 if [ $? -eq 0 ]
 then
   #if 24 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X24" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (24,' ','com.sun.jersey.spi.container.servlet.WebComponent.service(Ljava/net/URI;Ljava/net/URI;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)I','WebComponent.service(URI,URI,HttpServletRequest,HttpServletResponse)',4,false,'-','Java');
+`
show_error
   fi
 fi

    #Check entry_id 25 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 25;")
 if [ $? -eq 0 ]
 then
   #if 25 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X25" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (25,' ','com.tibco.plugin.share.http.servlet.BwServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doGet(HttpServletRequest,HttpServletResponse)',1,false,'-','Java');
+`
show_error
   fi
 fi

     #Check entry_id 26 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 26;")
 if [ $? -eq 0 ]
 then
   #if 26 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X26" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (26,' ','com.tibco.plugin.share.http.servlet.BwServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doPost(HttpServletRequest,HttpServletResponse)',1,false,'-','Java');
+`
show_error
   fi
 fi

      #Check entry_id 27 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 27;")
 if [ $? -eq 0 ]
 then
   #if 27 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X27" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (27,' ','com.tibco.plugin.share.http.servlet.BwServlet.doPut(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doPut(HttpServletRequest,HttpServletResponse)',1,false,'-','Java');
+`
show_error
   fi
 fi

       #Check entry_id 28 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 28;")
 if [ $? -eq 0 ]
 then
   #if 28 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X28" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (28,' ','com.tibco.plugin.share.http.servlet.BwServlet.doDelete(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doDelete(HttpServletRequest,HttpServletResponse)',1,false,'-','Java');
+`
show_error
   fi
 fi

       #Check entry_id 29 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 29;")
 if [ $? -eq 0 ]
 then
   #if 29 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X29" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (29,' ','com.tibco.plugin.share.http.servlet.BwServlet.doOptions(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','doOptions(HttpServletRequest,HttpServletResponse)',1,false,'-','Java');
+`
show_error
   fi
 fi

       #Check entry_id 30 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 30;")
 if [ $? -eq 0 ]
 then
   #if 30 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X30" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (30,' ','com.tibco.plugin.share.http.servlet.BwServlet.a(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V','a(HttpServletRequest,HttpServletResponse,String)',1,false,'-','Java');
+`
show_error
   fi
 fi

       #Check entry_id 31 exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 31;")
 if [ $? -eq 0 ]
 then
   #if 31 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X31" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (31,' ','org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(Ljavax/jms/Session;Ljavax/jms/Message;)V','invokeListener(Session,Message)',7,false,'-','Java');
+`
show_error
   fi
 fi

#Check entry_id 23 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 23;")
 if [ $? -eq 0 ]
 then
   #if 23 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X23" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (23, true, 23, 1);
+`
show_error
   fi
 fi

#Check entry_id 24 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 24;")
 if [ $? -eq 0 ]
 then
   #if 24 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X24" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (24, false, 24,1);
+`
show_error
   fi
 fi

 #Check entry_id 25 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 25;")
 if [ $? -eq 0 ]
 then
   #if 25 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X25" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (25, true, 25, 1);
+`
show_error
   fi
 fi

 #Check entry_id 26 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 26;")
 if [ $? -eq 0 ]
 then
   #if 26 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X26" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (26, true, 26, 1);
+`
show_error
   fi
 fi

  #Check entry_id 27 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 27;")
 if [ $? -eq 0 ]
 then
   #if 27 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X27" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (27, true, 27, 1);
+`
show_error
   fi
 fi

   #Check entry_id 28 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 28;")
 if [ $? -eq 0 ]
 then
   #if 28 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X28" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (28, true, 28, 1);
+`
show_error
   fi
 fi

   #Check entry_id 29 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 29;")
 if [ $? -eq 0 ]
 then
   #if 29 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X29" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (29, true, 29, 1);
+`
show_error
   fi
 fi

   #Check entry_id 30 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 30;")
 if [ $? -eq 0 ]
 then
   #if 30 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X30" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (30, true, 30, 1);
+`
show_error
   fi
 fi

    #Check entry_id 31 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 31;")
 if [ $? -eq 0 ]
 then
   #if 31 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X31" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES (31, false, 31, 1);
+`
show_error
   fi
 fi

#Check backend_type_id 22 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 22;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X22" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (22,'Log Backend','Log','Log','None','Java');
+`
show_error
      fi
    fi

 #Check backend_type_id 23 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 23;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X23" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (23,'Exception Backend','Exception','Exception','None','Java');
+`
show_error
      fi
    fi

 #Check backend_type_id 24 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 24;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X24" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (24,'XATransaction Backend','XATransaction','XATransaction','None','Java');
+`
show_error
      fi
    fi

 #Check backend_type_id 26 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 26;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X26" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (26,'Neo4j DB Callout Backend','Neo4j DB Callout','neo4jDB','NEO4J','Java');
+`
show_error
      fi
    fi
	
#===========================New Entry(JMS) =============================================================
 #Check backend_type_id 27 exists in config_$CONTROLLER_NAME.backend_type table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 27;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X27" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (27,'JMS Backend','JMS','HttpCallout','JMS','Java');
+`
show_error
      fi
    fi

#Check backend_type_id 22 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 22;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X22" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (22,true,false,false,false,false,false,false,false,false,false,false,false,false,22,1);
+`
show_error
      fi
    fi

#Check backend_type_id 23 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 23;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X23" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (23,true,false,false,false,false,false,false,false,false,false,false,false,false,23,1);
+`
show_error
      fi
    fi

#Check backend_type_id 24 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 24;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X24" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (24,true,false,false,false,false,false,false,false,false,false,false,false,false,24,1);
+`
show_error
      fi
    fi

#Check backend_type_id 26 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 26;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X26" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (26,true,true,false,false,false,false,true,false,false,false,false,false,false,26,1);
+`
show_error
      fi
    fi

#Check backend_type_id 27 exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where backend_type_id = 27;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X27" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES (27,true,true,false,false,false,false,false,false,false,false,false,true,false,27,1);
+`
show_error
      fi
    fi

#Check end_point_id 100 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 100;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X100" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (100,'HTTP end point','java.net.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V','setRequestMethod(String)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 101 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 101;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X101" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (101,'HTTP end point','java.net.HttpURLConnection.getInputStream()Ljava/io/InputStream;','getInputStream()',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 102 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 102;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X102" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (102,'HTTP end point','weblogic.net.http.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V','setRequestMethod(String)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 103 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 103;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X103" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (103,'HTTP end point','weblogic.net.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;','getInputStream()',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 104 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 104;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X104" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (104,'HTTP end point','feign.Client$Default.execute(Lfeign/Request;Lfeign/Request$Options;)Lfeign/Response;','execute(Request,Request$Options)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 105 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 105;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X105" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (105,'HTTP end point','org.springframework.web.client.DefaultResponseErrorHandler.hasError(Lorg/springframework/http/client/ClientHttpResponse;)Z','hasError(ClientHttpResponse)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 106 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 106;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X106" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (106,'HTTP end point','java.net.URL.openConnection()Ljava/net/URLConnection;','openConnection()',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 107 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 107;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X107" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (107,'HTTP end point','com.nds.nudetect.NuDetectClient.restCall(Ljava/lang/String;Ljava/lang/String;Lcom/nds/nudetect/ConstantsInternal$RESTRequestFunc;Lcom/nds/nudetect/TransactionParameters;)Lcom/nds/nudetect/RESTClientResponse;','restCall.<init>(String,String,ConstantsInternal$RESTRequestFunc,TransactionParameters)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 108 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 108;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X108" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (108,'HTTP end point','com.caucho.hessian.client.HessianProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;','invoke(Object,Method,Object)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 109 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 109;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X109" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (109,'HTTP end point','com.caucho.hessian.client.HessianProxy.addRequestHeaders(Ljava/net/URLConnection;)V','addRequestHeaders(URLConnection)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 110 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 110;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X110" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (110,'HTTP end point','com.caucho.hessian.client.HessianProxy.sendRequest(Ljava/lang/String;[Ljava/lang/Object;)Lcom/caucho/hessian/client/HessianConnection;','sendRequest(String,Object)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 111 exists in config_$CONTROLLER_NAME.config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 111;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X111" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (111,'THREAD end point','java.util.concurrent.ForkJoinPool.forkOrSubmit(Ljava/util/concurrent/ForkJoinTask;)V','forkOrSubmit(ForkJoinTask)',15,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 112 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 112;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X112" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (112,'THREAD end point','java.util.concurrent.ForkJoinTask.fork()Ljava/util/concurrent/ForkJoinTask;','fork()',15,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 113 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 113;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X113" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (113,'THREAD end point','java.util.concurrent.ForkJoinTask.doInvoke()I','doInvoke()',15,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 114 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 114;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X114" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (114,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace()V','printStackTrace()',14,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 115 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 115;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X115" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (115,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/io/PrintStream;)V','printStackTrace(PrintStream)',14,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 116 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 116;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X116" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (116,'CUSTOM ERROR LOG end point','java.lang.Throwable.printEnclosedStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;[Ljava/lang/StackTraceElement;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;)V','printEnclosedStackTrace(PrintStreamOrWriter,StackTraceElement,String,String,Set)',14,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 117 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 117;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X117" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (117,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V','printStackTrace(PrintStreamOrWriter)',14,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 118 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 118;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X118" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (118,'CUSTOM ERROR LOG end point','java.lang.Throwable.printStackTrace(Ljava/io/PrintWriter;)V','printStackTrace(PrintWriter)',14,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 119 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 119;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X119" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (119,'JDBC end point','oracle.jdbc.driver.OraclePreparedStatement','OraclePreparedStatement',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 120 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 120;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X120" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (120,'JDBC end point','oracle.jdbc.driver.OracleStatement','OracleStatement',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 121 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 121;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X121" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (121,'JDBC end point','com.mysql.cj.jdbc.PreparedStatement','Prepared Statement : mysqlDB',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 122 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 122;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X122" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (122,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.get(Lorg/apache/hadoop/hbase/client/Get;)Lorg/apache/hadoop/hbase/client/Result;','get(Get)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 123 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 123;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X123" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (123,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.get(Ljava/util/List;)[Lorg/apache/hadoop/hbase/client/Result;','get(List)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 124 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 124;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X124" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (124,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.batchCallback(Ljava/util/List;[Ljava/lang/Object;Lorg/apache/hadoop/hbase/client/coprocessor/Batch$Callback;)V','batchCallback(List,Object,Batch$Callback)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 125 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 125;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X125" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (125,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.delete(Lorg/apache/hadoop/hbase/client/Delete;)V','delete(Delete)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 126 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 126;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X126" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (126,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.doPut(Lorg/apache/hadoop/hbase/client/Put;)V','doPut(Put)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 127 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 127;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X127" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (127,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.checkAndPut([B[B[B[BLorg/apache/hadoop/hbase/client/Put;)Z','checkAndPut(Put)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 128 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 128;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X128" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (128,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.checkAndDelete([B[B[B[BLorg/apache/hadoop/hbase/client/Delete;)Z','checkAndDelete(Delete)',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 129 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 129;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X129" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (129,'MONGO end point','com.mongodb.Mongo','Mongo',11,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 130 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 130;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X130" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (130,'CUSTOM LOG end point','org.apache.catalina.valves.AccessLogValve.log(Ljava/lang/String;)V','log(String)',13,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 131 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 131;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X131" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (131,'CUSTOM LOG end point','org.apache.catalina.valves.AccessLogValve.log(Ljava/io/CharArrayWriter;)V','log(CharArrayWriter)',13,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 132 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 132;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X132" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (132,'CUSTOM LOG end point','ch.qos.logback.core.encoder.LayoutWrappingEncoder.convertToBytes(Ljava/lang/String;)[B','convertToBytes(String)',13,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 133 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 133;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X133" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (133,'CUSTOM LOG end point','weblogic.servlet.logging.FormatStringBuffer.getBytes()[B','getBytes()',13,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 134 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 134;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X134" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (134,'RMI end point','java.rmi.Naming.<init>(Ljava/lang/String;ILjava/lang/String;)','Naming.<init>(String,String)',5,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 135 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 135;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X135" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (135,'WS end point','com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;','_invoke(ClientRequest)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 136 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 136;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X136" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (136,'WS end point','org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode()I','getResponseCode()',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 137 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 137;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X137" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (137,'WS end point','org.apache.cxf.jaxrs.client.WebClient.prepareHeaders(Ljava/lang/Class;Ljava/lang/Object;)Ljavax/ws/rs/core/MultivaluedMap;','prepareHeaders(Class,Object)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 138 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 138;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X138" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (138,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Class,Type)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 139 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 139;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X139" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (139,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Type,Class,Type)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 140 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 140;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X140" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (140,'WS end point','org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;','doInvoke(String,Object,Class,Type,Class,Type)',2,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 141 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 141;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X141" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (141,'Log end point','org.apache.log4j.AppenderSkeleton.doAppend(Lorg/apache/log4j/spi/LoggingEvent;)V','Log: doappend(LoggingEvent)',22,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 142 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 142;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X142" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (142,'XATransaction end point','oracle.jdbc.xa.client.OracleXAResource','XATransaction: OracleXAResource',24,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 143 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 143;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X143" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (143,'JDBC Connection end point','weblogic.jdbc.common.internal.RmiDataSource','DBConnection: RmiDataSource',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 144 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 144;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X144" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (144,'JDBC Connection end point','java.sql.DriverManager','DBConnection: DriverManager',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 145 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 145;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X145" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (145,'JDBC Connection end point','org.apache.commons.dbcp.BasicDataSource','DBConnection: BasicDataSource',3,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 146 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 146;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X146" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (146,'Neo4j DB Callout end point','org.neo4j.jdbc.http.driver.CypherExecutor.executeQuery(Lorg/neo4j/jdbc/http/driver/Neo4jStatement;)Lorg/neo4j/jdbc/http/driver/Neo4jResponse;','CypherExecutor.executeQuery(Neo4jStatement)',26,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 147 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 147;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X147" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (147,'Neo4j DB Callout end point','org.neo4j.jdbc.bolt.BoltPreparedStatement.executeQuery()Ljava/sql/ResultSet;','BoltPreparedStatement.executeQuery()',26,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 148 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 148;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X148" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (148,'Exception end point','java.lang.Throwable.<init>()V','Exception: <init>()V',23,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 149 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 149;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X149" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (149,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/String;)V','Exception: <init>(Ljava/lang/String;)V',23,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 150 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 150;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X150" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (150,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/Throwable;)V','Exception: <init>(Throwable)V',23,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 151 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 151;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X151" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (151,'Exception end point','java.lang.Throwable.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V','Exception: <init>(String,Throwable)V',23,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 152 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 152;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X152" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (152,'Custom Log end point','io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver.logMessage(Ljava/lang/String;)V','DefaultAccessLogReceiver.logMessage(String)',13,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 153 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 153;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X153" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (153,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Message;IIJ)V','MQMessageProducer.send(Message,IIJ)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 154 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 154;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X154" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (154,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Message;)V','MQMessageProducer.send(Message)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 155 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 155;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X155" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (155,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;)V','MQMessageProducer.send(Destination,Message)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 156 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 156;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X156" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (156,'JMS IBM Backend','com.ibm.mq.jms.MQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJ)V','MQMessageProducer.send(Destination,Message,IIJ)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 157 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 157;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X157" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (157,'JMS Active Backend','org.apache.activemq.ActiveMQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJ)V','ActiveMQMessageProducer.send(Destination,Message,IIJ)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 158 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 158;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X158" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (158,'JMS Active Backend','org.apache.activemq.ActiveMQMessageProducer.send(Ljavax/jms/Destination;Ljavax/jms/Message;IIJLorg/apache/activemq/AsyncCallback;)V','ActiveMQMessageProducer.send(Destination,Message,AsyncCallback)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 159 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 159;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X159" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (159,'JMS Rabbit Backend','com.rabbitmq.client.impl.AMQChannel.transmit(Lcom/rabbitmq/client/Method;)V','AMQChannel.transmit(Method)V',27,false,'-','Java');
+`
show_error
      fi
    fi
    
#Check end_point_id 160 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 160;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X160" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (160,'JMS Rabbit Backend','com.rabbitmq.client.impl.AMQChannel.transmit(Lcom/rabbitmq/client/impl/AMQCommand;)V','AMQChannel.transmit(AMQCommand)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 161 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 161;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X161" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (161,'JMS ATG Backend','atg.dms.local.TopicPublisherImpl.publish(Ljavax/jms/Topic;Ljavax/jms/Message;)V','TopicPublisherImpl.publish(Topic,Message)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 162 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 162;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X162" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (162,'JMS TIBCO Backend','com.tibco.tibjms.TibjmsMessageProducer._publish(Ljavax/jms/Destination;Ljavax/jms/Message;ZIIJZLjavax/jms/CompletionListener;)Lcom/tibco/tibjms/TibjmsMessage;','TibjmsMessageProducer._publish(Destination,Message,CompletionListener)V',27,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 163 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 163;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X163" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (163,'Async HTTP Backend','org.apache.http.impl.nio.client.FutureWrapper','client.FutureWrapper',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 164 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 164;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X164" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (164,'Async HTTP Backend','org.apache.http.concurrent.BasicFuture.completed(Ljava/lang/Object;)Z','BasicFuture.completed(Object)Z',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 165 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 165;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X165" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (165,'Async HTTP Backend','org.apache.http.concurrent.BasicFuture.failed(Ljava/lang/Exception;)Z','BasicFuture.failed(Exception)Z',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 166 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 166;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X166" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (166,'Async HTTP Backend','org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Lorg/apache/http/nio/protocol/HttpAsyncRequestProducer;Lorg/apache/http/nio/protocol/HttpAsyncResponseConsumer;Lorg/apache/http/protocol/HttpContext;Lorg/apache/http/concurrent/FutureCallback;)Ljava/util/concurrent/Future;','InternalHttpAsyncClient.execute(HttpAsyncRequestProducer,HttpAsyncResponseConsumer,HttpContext,FutureCallback)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 167 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 167;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X167" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (167,'HADOOP end point','org.apache.hadoop.hbase.client.HTable.finishSetup()V','HTable.finishSetup()V',8,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 168 exists in config_$CONTROLLER_NAME.backend_points table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 168;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X168" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points(end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (168,'HTTP end point','org.apache.commons.httpclient.HttpClient.executeMethod(Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/apache/commons/httpclient/HttpState;)I','HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)',1,false,'-','Java');
+`
show_error
      fi
    fi

#Check end_point_id 100 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 100;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X100" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (100,false,100,1);
+`
show_error
      fi
    fi

#Check end_point_id 101 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 101;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X101" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (101,false,101,1);
+`
show_error
      fi
    fi

#Check end_point_id 102 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 102;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X102" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (102,false,102,1);
+`
show_error
      fi
    fi

#Check end_point_id 103 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 103;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X103" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (103,false,103,1);
+`
show_error
      fi
    fi

#Check end_point_id 104 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 104;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X104" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (104,true,104,1);
+`
show_error
      fi
    fi

#Check end_point_id 105 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 105;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X105" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (105,false,105,1);
+`
show_error
      fi
    fi

#Check end_point_id 106 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 106;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X106" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (106,false,106,1);
+`
show_error
      fi
    fi

#Check end_point_id 107 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 107;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X107" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (107,true,107,1);
+`
show_error
      fi
    fi

#Check end_point_id 108 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 108;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X108" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (108,true,108,1);
+`
show_error
      fi
    fi

#Check end_point_id 109 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 109;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X109" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (109,true,109,1);
+`
show_error
      fi
    fi

#Check end_point_id 110 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 110;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X110" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (110,true,110,1);
+`
show_error
      fi
    fi

#Check end_point_id 111 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 111;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X111" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (111,false,111,1);
+`
show_error
      fi
    fi

#Check end_point_id 112 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 112;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X112" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (112,false,112,1);
+`
show_error
      fi
    fi

#Check end_point_id 113 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 113;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X113" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (113,false,113,1);
+`
show_error
      fi
    fi

#Check end_point_id 114 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 114;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X114" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (114,true,114,1);
+`
show_error
      fi
    fi

#Check end_point_id 115 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 115;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X115" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (115,false,115,1);
+`
show_error
      fi
    fi

#Check end_point_id 116 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 116;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X116" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (116,false,116,1);
+`
show_error
      fi
    fi

#Check end_point_id 117 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 117;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X117" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (117,false,117,1);
+`
show_error
      fi
    fi

#Check end_point_id 118 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 118;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X118" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (118,false,118,1);
+`
show_error
      fi
    fi

#Check end_point_id 119 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 119;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X119" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (119,false,119,1);
+`
show_error
      fi
    fi

#Check end_point_id 120 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 120;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X120" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (120,false,120,1);
+`
show_error
      fi
    fi

#Check end_point_id 121 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 121;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X121" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (121,false,121,1);
+`
show_error
      fi
    fi

#Check end_point_id 122 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 122;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X122" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (122,true,122,1);
+`
show_error
      fi
    fi

#Check end_point_id 123 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 123;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X123" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (123,true,123,1);
+`
show_error
      fi
    fi

#Check end_point_id 124 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 124;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X124" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (124,false,124,1);
+`
show_error
      fi
    fi

#Check end_point_id 125 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 125;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X125" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (125,false,125,1);
+`
show_error
      fi
    fi

#Check end_point_id 126 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 126;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X126" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (126,false,126,1);
+`
show_error
      fi
    fi

#Check end_point_id 127 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 127;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X127" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (127,false,127,1);
+`
show_error
      fi
    fi

#Check end_point_id 128 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 128;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X128" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (128,false,128,1);
+`
show_error
      fi
    fi

#Check end_point_id 129 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 129;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X129" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (129,true,129,1);
+`
show_error
      fi
    fi

#Check end_point_id 130 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 130;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X130" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (130,true,130,1);
+`
show_error
      fi
    fi

#Check end_point_id 131 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 131;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X131" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (131,true,131,1);
+`
show_error
      fi
    fi

#Check end_point_id 132 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 132;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X132" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (132,true,132,1);
+`
show_error
      fi
    fi

#Check end_point_id 133 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 133;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X133" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (133,true,133,1);
+`
show_error
      fi
    fi

#Check end_point_id 134 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 134;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X134" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (134,false,134,1);
+`
show_error
      fi
    fi

#Check end_point_id 135 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 135;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X135" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (135,true,135,1);
+`
show_error
      fi
    fi

#Check end_point_id 136 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 136;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X136" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (136,false,136,1);
+`
show_error
      fi
    fi

#Check end_point_id 137 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 137;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X137" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (137,false,137,1);
+`
show_error
      fi
    fi

#Check end_point_id 138 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 138;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X138" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (138,false,138,1);
+`
show_error
      fi
    fi

#Check end_point_id 139 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 139;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X139" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (139,false,139,1);
+`
show_error
      fi
    fi

#Check end_point_id 140 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 140;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X140" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (140,false,140,1);
+`
show_error
      fi
    fi

#Check end_point_id 141 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 141;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X141" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (141,true,141,1);
+`
show_error
      fi
    fi

#Check end_point_id 142 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 142;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X142" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (142,true,142,1);
+`
show_error
      fi
    fi

#Check end_point_id 143 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 143;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X143" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (143,true,143,1);
+`
show_error
      fi
    fi

#Check end_point_id 144 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 144;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X144" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (144,true,144,1);
+`
show_error
      fi
    fi

#Check end_point_id 145 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 145;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X145" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (145,true,145,1);
+`
show_error
      fi
    fi

#Check end_point_id 146 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 146;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X146" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (146,true,146,1);
+`
show_error
      fi
    fi

#Check end_point_id 147 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 147;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X147" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (147,true,147,1);
+`
show_error
      fi
    fi

#Check end_point_id 148 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 148;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X148" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (148,true,148,1);
+`
show_error
      fi
    fi


#Check end_point_id 149 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 149;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X149" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (149,true,149,1);
+`
show_error
      fi
    fi

#Check end_point_id 150 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 150;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X150" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (150,true,150,1);
+`
show_error
      fi
    fi

#Check end_point_id 151 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 151;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X151" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (151,true,151,1);
+`
show_error
      fi
    fi

#Check end_point_id 152 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 152;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X152" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (152,false,152,1);
+`
show_error
      fi
    fi

#Check end_point_id 153 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 153;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X153" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (153,true,153,1);
+`
show_error
      fi
    fi

#Check end_point_id 154 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 154;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X154" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (154,true,154,1);
+`
show_error
      fi
    fi

#Check end_point_id 155 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 155;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X155" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (155,true,155,1);
+`
show_error
      fi
    fi

#Check end_point_id 156 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 156;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X156" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (156,true,156,1);
+`
show_error
      fi
    fi

#Check end_point_id 157 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 157;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X157" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (157,true,157,1);
+`
show_error
      fi
    fi

#Check end_point_id 158 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 158;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X158" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (158,true,158,1);
+`
show_error
      fi
    fi

#Check end_point_id 159 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 159;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X159" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (159,true,159,1);
+`
show_error
      fi
    fi

#Check end_point_id 160 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 160;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X160" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (160,true,160,1);
+`
show_error
      fi
    fi

#Check end_point_id 161 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 161;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X161" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (161,true,161,1);
+`
show_error
      fi
    fi

#Check end_point_id 162 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 162;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X162" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (162,false,162,1);
+`
show_error
      fi
    fi

#Check end_point_id 163 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 163;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X163" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (163,true,163,1);
+`
show_error
      fi
    fi

#Check end_point_id 164 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 164;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X164" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (164,true,164,1);
+`
show_error
      fi
    fi

#Check end_point_id 165 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 165;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X165" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (165,true,165,1);
+`
show_error
      fi
    fi

#Check end_point_id 166 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 166;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X166" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (166,true,166,1);
+`
show_error
      fi
    fi

#Check end_point_id 167 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 167;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X167" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (167,false,167,1);
+`
show_error
      fi
    fi

#Check end_point_id 168 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
    KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 168;")
    if [ $? -eq 0 ]
    then
      if [ "X$KEY_ID" != "X168" ]
      then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (168,false,168,1);
+`
show_error
      fi
    fi

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.backend_points ADD COLUMN argument_index bigint;
Update config_$CONTROLLER_NAME.backend_points set end_point_fqm = 'java.lang.Throwable.printStackTrace()V' where end_point_id = 114;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true ,port = true  WHERE backend_type_id = 27;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true WHERE backend_type_id = 17;
DELETE FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso WHERE backend_type_id in (25, 28, 29, 30, 31, 32);
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 3 WHERE backend_type_id = 25;
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 27 WHERE backend_type_id in (28, 29, 30, 31);
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 1 WHERE backend_type_id = 32;
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name = 'JMS' , backend_type_name_entrypointsfile = 'HttpCallout' , backend_type_name_rulefile = 'JMS' where  backend_type_id = 27 ;
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'NEO4J' where  backend_type_id = 26 ;
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'CLOUDANT' where  backend_type_id = 19 ;
DELETE FROM config_$CONTROLLER_NAME.backend_type WHERE backend_type_id in (25, 28, 29, 30, 31, 32);
Update config_$CONTROLLER_NAME.backend_points set backend_type_id = 18 where end_point_id in (71, 74);
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id in (75, 76, 77, 78, 79, 81);
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id in (75, 76, 77, 78, 79, 81);
+`
show_error

 #Check end_point_id 169 exists in config_$CONTROLLER_NAME.backend_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 169;")
 if [ $? -eq 0 ]
 then
   #if 169 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X169" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (169,'SQL call for dot net','System.Data.OracleClient.OracleCommand.ExecuteReader','OracleCommand.ExecuteReader',17,false,'System.Data.OracleClient.dll','Dot Net');
+`
show_error
   fi
 fi

#Check end_point_id 170 exists in config_$CONTROLLER_NAME.backend_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_id = 170;")
 if [ $? -eq 0 ]
 then
   #if 170 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X170" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES (170,'SQL call for dot net','System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal','OracleCommand.ExecuteNonQueryInternal',17,false,'System.Data.OracleClient.dll','Dot Net');
+`
show_error
   fi
 fi

#Check end_point_id 169 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 169;")
 if [ $? -eq 0 ]
 then
   #if 169 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X169" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (169,true,169,888888);
+`
show_error
   fi
 fi

#Check end_point_id 170 exists in config_$CONTROLLER_NAME.profile_backend_point_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id = 170;")
 if [ $? -eq 0 ]
 then
   #if 170 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X170" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES (170,true,170,888888);
+`
show_error
   fi
 fi

#========================Update for two new column in bt_method table===================
#Check meth_invocation column exists in config_$CONTROLLER_NAME.bt_method table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.bt_method' and column_name ilike 'meth_invocation';")
if [ $? -eq 0 ]
then
 #if meth_invocation column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
        ALTER TABLE config_$CONTROLLER_NAME.bt_method add COLUMN meth_invocation varchar(255);
+`
show_error
   fi
 fi

#Check meth_invocation_index column exists in config_$CONTROLLER_NAME.bt_method table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.bt_method' and column_name ilike 'meth_invocation_index';")
if [ $? -eq 0 ]
then
 #if meth_invocation_index column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
        ALTER TABLE config_$CONTROLLER_NAME.bt_method add COLUMN meth_invocation_index bigint;
+`
show_error
   fi
 fi
 
#========================Update for two new service_entry_points===================
#Check entry_id 32  exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 32;")
 if [ $? -eq 0 ]
 then
   #if 32 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X32" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (32,' ','org.springframework.batch.core.job.AbstractJob.execute(Lorg/springframework/batch/core/JobExecution;)V','AbstractJob_Execute',6,false,'-','Java');
+`
show_error
   fi
 fi

 #Check entry_id 33  exists in config_$CONTROLLER_NAME.service_entry_points table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_id = 33;")
 if [ $? -eq 0 ]
 then
   #if 33 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X33" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES (33,' ','org.springframework.batch.core.job.SimpleJob.doExecute(Lorg/springframework/batch/core/JobExecution;)V','SimpleJob_doExecute',6,false,'-','Java');
+`
show_error
   fi
 fi

 #Check entry_id 32 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 32;")
   PROF_ID=$(psql --user=cavisson -d test -t --no-align -c "select profile_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 32 AND profile_id = 1;")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT prof_entry_id FROM config_$CONTROLLER_NAME.profile_service_entry_asso ORDER BY prof_entry_id DESC LIMIT 1;")
 if [ $? -eq 0 ]
 then
   #if 32 column does not exist then insert that row in table
   if [ "X$PROF_ID" != "X1" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($MAX_ID + 1)), false, 32, 1);
+`
show_error
   fi
 fi

  #Check entry_id 33 exists in config_$CONTROLLER_NAME.profile_service_entry_asso table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 33;")
   PROF_ID=$(psql --user=cavisson -d test -t --no-align -c "select profile_id from config_$CONTROLLER_NAME.profile_service_entry_asso where entry_id = 33 AND profile_id = 1;")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT prof_entry_id FROM config_$CONTROLLER_NAME.profile_service_entry_asso ORDER BY prof_entry_id DESC LIMIT 1;")
 if [ $? -eq 0 ]
 then
   #if 33 column does not exist then insert that row in table
   if [ "X$PROF_ID" != "X1" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($MAX_ID + 1)), false, 33, 1);
+`
show_error
   fi
 fi

#============================================Update code for Newly Added Custom Keywords========================================
 #Check key_id 113 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 113;")
 if [ $? -eq 0 ]
 then
   #if 113 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X113" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type) VALUES (113,'FPMaxAllowedAgeInSec','1','40000000','2','300','pre-custom');
+`
show_error
   fi
 fi

#=============================Add column agent_mode in table keywords==================================
#Check agent_mode column exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.keywords' and column_name ilike 'agent_mode';")
if [ $? -eq 0 ]
then
 #if agent_mode column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
		ALTER TABLE config_$CONTROLLER_NAME.keywords add COLUMN agent_mode varchar(255);
+`
show_error
   fi
 fi

#==============================Update agent_mode and type in table keywords========================================
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_def_value = '3D' , ndc_key_val = '3D' , ndc_key_max = ''  where ndc_key_id = 91;
Update config_$CONTROLLER_NAME.keywords set agent_mode = '3' where key_id in (3, 11, 16, 33, 75, 101, 109);
Update config_$CONTROLLER_NAME.keywords set agent_mode = '1' where key_id in (4, 10, 23, 32, 34, 35, 36, 37, 39, 40, 41, 43, 44, 46, 47, 49, 50, 53, 58, 61, 103, 104, 105,  108, 110, 111, 112, 113);
Update config_$CONTROLLER_NAME.keywords set agent_mode = '4' where key_id in (5, 8);
Update config_$CONTROLLER_NAME.keywords set agent_mode = '7' where key_id in (1, 6, 7, 9, 12, 14, 17, 20, 22, 24, 26, 27, 28, 29, 22, 42, 45, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84);
Update config_$CONTROLLER_NAME.keywords set agent_mode = '5' where key_id in (13, 15, 18, 19, 21, 25, 30, 38, 48, 54, 55, 56, 57, 59, 62, 70, 73, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95);
Update config_$CONTROLLER_NAME.keywords set type = 'pre-custom' , agent_mode = '1' where key_id in (51, 52, 60, 64, 71, 72);
Update config_$CONTROLLER_NAME.keywords set type = 'pre-custom' , agent_mode = '7' where key_id in (63, 66, 67);
Update config_$CONTROLLER_NAME.keywords set type = 'pre-custom' , agent_mode = '5' where key_id in (2, 65, 68, 69);
Update config_$CONTROLLER_NAME.keywords set agent_mode = '2' where key_id in (96, 97, 98, 99, 100, 102, 106, 107);
+`
show_error

#============================================Update code for Newly Added Custom Keywords========================================  
 #Check key_id 114 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 114;")
 if [ $? -eq 0 ]
 then
   #if 114 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X114" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (114,'removeAutoInstrumentations','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 115 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 115;")
 if [ $? -eq 0 ]
 then
   #if 115 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X115" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (115,'enableAutoDetectPlayEntryPoint','0','2048','5','1%201','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 116 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 116;")
 if [ $? -eq 0 ]
 then
   #if 116 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X116" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (116,'jedisCommands','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 117 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 117;")
 if [ $? -eq 0 ]
 then
   #if 117 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X117" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (117,'enableFilterForJedisClient','0','1','2','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 118 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 118;")
 if [ $? -eq 0 ]
 then
   #if 118 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X118" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (118,'addObjectInQueryForCloudant','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 119 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 119;")
 if [ $? -eq 0 ]
 then
   #if 119 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X119" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (119,'instrLog4J','0','1','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 120 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 120;")
 if [ $? -eq 0 ]
 then
   #if 120 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X120" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (120,'enableAddingHdrForEndeca','0','1','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 121 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 121;")
 if [ $? -eq 0 ]
 then
   #if 121 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X121" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (121,'collectIndependentQuery','0','1','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 122 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 122;")
 if [ $? -eq 0 ]
 then
   #if 122 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X122" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (122,'ndGenLogCaptureFileList','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 123 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 123;")
 if [ $? -eq 0 ]
 then
   #if 123 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X123" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (123,'genNewSQLRecords','0','1','1','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 124 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 124;")
 if [ $? -eq 0 ]
 then
   #if 124 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X124" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (124,'enableCloudantBackendMode','0','6','2','2','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 125 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 125;")
 if [ $? -eq 0 ]
 then
   #if 125 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X125" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (125,'enableHeartBeatLog','0','6','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 126 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 126;")
 if [ $? -eq 0 ]
 then
   #if 126 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X126" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (126,'dumpSQLQuery','0','1','1','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 127 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 127;")
 if [ $? -eq 0 ]
 then
   #if 127 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X127" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (127,'flushInterval','0','300000','4','100','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 128 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 128;")
 if [ $? -eq 0 ]
 then
   #if 128 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X128" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (128,'bciDataBuffIncreament','0','30000','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 129 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 129;")
 if [ $? -eq 0 ]
 then
   #if 129 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X129" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (129,'socketBufferSize','0','1048576','4','128','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 130 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 130;")
 if [ $? -eq 0 ]
 then
   #if 130 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X130" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (130,'bciUriLogLevel','0','1','1','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 131 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 131;")
 if [ $? -eq 0 ]
 then
   #if 131 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X131" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (131,'bciUriMaxLength','0','2147483647','2','1024','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 132 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 132;")
 if [ $? -eq 0 ]
 then
   #if 132 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X132" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (132,'urlLength','0','2147483647','2','1024','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 133 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 133;")
 if [ $? -eq 0 ]
 then
   #if 133 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X133" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (133,'uriQueryLength','0','2147483647','2','1024','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 134 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 134;")
 if [ $? -eq 0 ]
 then
   #if 134 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X134" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (134,'logNonNSUrlAndQueryRecord','0','2','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 135 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 135;")
 if [ $? -eq 0 ]
 then
   #if 135 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X135" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (135,'bciMaxServiceMethodsPerFP','0','2147483647','5','5000','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 136 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 136;")
 if [ $? -eq 0 ]
 then
   #if 136 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X136" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (136,'entryMethodMaxDepth','0','9999','2','9999','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 137 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 137;")
 if [ $? -eq 0 ]
 then
   #if 137 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X137" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (137,'ctrlConnIdleTimeMaxCount','0','120','2','10','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 138 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 138;")
 if [ $? -eq 0 ]
 then
   #if 138 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X138" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (138,'instrProfileContentMaxIdleTime','0','120','2','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 139 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 139;")
 if [ $? -eq 0 ]
 then
   #if 139 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X139" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (139,'ndCriticalFileKeyword','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 140 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 140;")
 if [ $? -eq 0 ]
 then
   #if 140 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X140" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (140,'enableInterfaceInstr','0','6','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 141 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 141;")
 if [ $? -eq 0 ]
 then
   #if 141 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X141" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (141,'SQLTraceLevel','0','6','1','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 142 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 142;")
 if [ $? -eq 0 ]
 then
   #if 142 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X142" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (142,'SQLPreparedQueryFilter','2','1048576','5','-','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 143 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 143;")
 if [ $? -eq 0 ]
 then
   #if 143 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X143" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (143,'SQLNonPreparedQueryFilter','2','1048576','5','-','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 144 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 144;")
 if [ $? -eq 0 ]
 then
   #if 144 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X144" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (144,'captureHTTPReqL1Fp','1','1048576','5','2','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 145 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 145;")
 if [ $? -eq 0 ]
 then
   #if 145 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X145" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (145,'captureHTTPRespL1Fp','1','1048576','5','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 146 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 146;")
 if [ $? -eq 0 ]
 then
   #if 146 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X146" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (146,'captureHTTPReqBodyL1Fp','1','1048576','5','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 147 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 147;")
 if [ $? -eq 0 ]
 then
   #if 147 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X147" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (147,'captureHTTPReqBodyFullFp','1','1048576','5','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 148 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 148;")
 if [ $? -eq 0 ]
 then
   #if 148 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X148" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (148,'captureHTTPRespBodyL1Fp','1','1048576','5','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 149 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 149;")
 if [ $? -eq 0 ]
 then
   #if 149 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X149" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (149,'captureHTTPRespBodyFullFp','1','1048576','5','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 150 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 150;")
 if [ $? -eq 0 ]
 then
   #if 150 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X150" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (150,'hdrListForValueAsId','0','4096','5','Content-Encoding,Host,Server,Transfer-Encoding','pre-custom','5');
+`
show_error
   fi
 fi
 
 #Check key_id 151 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 151;")
 if [ $? -eq 0 ]
 then
   #if 151 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X151" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (151,'NDHTTPReqHdrCfgListL1Fp','1','1024','6','NA','pre-custom','5');
+`
show_error
   fi
 fi
 
 #Check key_id 152 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 152;")
 if [ $? -eq 0 ]
 then
   #if 152 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X152" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (152,'maxHttpBodySize','0','1048576','2','1024','pre-custom','5');
+`
show_error
   fi
 fi
 
 #Check key_id 153 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 153;")
 if [ $? -eq 0 ]
 then
   #if 153 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X153" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (153,'ASStateReport','0','1','2','1','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 154 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 154;")
 if [ $? -eq 0 ]
 then
   #if 154 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X154" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (154,'ASDoNotFilterBlocked','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 155 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 155;")
 if [ $? -eq 0 ]
 then
   #if 155 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X155" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (155,'ASAllocateDataBuffOnFailure','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 156 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 156;")
 if [ $? -eq 0 ]
 then
   #if 156 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X156" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (156,'threadCleanUpCount','0','50','2','5','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 157 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 157;")
 if [ $? -eq 0 ]
 then
   #if 157 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X157" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (157,'ndHttpCondMonFileList','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 159 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 159;")
 if [ $? -eq 0 ]
 then
   #if 159 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X159" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (159,'ndMethodMonFileList','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 160 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 160;")
 if [ $? -eq 0 ]
 then
   #if 160 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X160" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (160,'ndExceptionMonFileList','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 161 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 161;")
 if [ $? -eq 0 ]
 then
   #if 161 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X161" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (161,'FPGMode','0','2','1','2','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 162 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 162;")
 if [ $? -eq 0 ]
 then
   #if 162 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X162" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (162,'fpVersionID','0','10240','5','1.0','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 163 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 163;")
 if [ $? -eq 0 ]
 then
   #if 163 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X163" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (163,'ndDynamicDiagnosticsConfFile','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 164 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 164;")
 if [ $? -eq 0 ]
 then
   #if 164 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X164" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (164,'threadIdleTimeout','0','2147483647','2','10','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 165 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 165;")
 if [ $? -eq 0 ]
 then
   #if 165 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X165" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (165,'ndPoolFile','0','2048','6','NA','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 166 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 166;")
 if [ $? -eq 0 ]
 then
   #if 166 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X166" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (166,'ASReportBufferMaxSize','1','2147483647','4','262144','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 167 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 167;")
 if [ $? -eq 0 ]
 then
   #if 167 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X167" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (167,'BTTConfig','1','1024','6','NA','pre-custom','7');
+`
show_error
   fi
 fi
  
 #Check key_id 168 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 168;")
 if [ $? -eq 0 ]
 then
   #if 168 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X168" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (168,'enableDCHeartBeat','0','3600','2','0','pre-custom','7');
+`
show_error
   fi
 fi
  
 #Check key_id 169 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 169;")
 if [ $? -eq 0 ]
 then
   #if 169 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X169" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (169,'DBIPName','0','1024','5','-','pre-custom','5');
+`
show_error
   fi
 fi
 
 #Check key_id 170 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 170;")
 if [ $? -eq 0 ]
 then
   #if 170 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X170" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (170,'backendErrorDetectionMode','0','2048','5','3','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 171 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 171;")
 if [ $? -eq 0 ]
 then
   #if 171 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X171" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (171,'enableUpdateLogMsgForNF','0','1','1','0','pre-custom','3');
+`
show_error
   fi
 fi
  
 #Check key_id 172 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 172;")
 if [ $? -eq 0 ]
 then
   #if 172 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X172" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (172,'BTRuleOverridePolicy','0','2','1','1','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 173 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 173;")
 if [ $? -eq 0 ]
 then
   #if 173 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X173" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (173,'ndEnableTxHotspot','0','1','2','1','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 174 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 174;")
 if [ $? -eq 0 ]
 then
   #if 174 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X174" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (174,'ndHelperDepth','0','10','2','2','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 175 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 175;")

 if [ $? -eq 0 ]
 then
   #if 175 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X175" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (175,'ndHotspotThreadLimit','0','10','2','0','pre-custom','5');
+`
show_error
   fi
 fi
  
 #Check key_id 176 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 176;")
 if [ $? -eq 0 ]
 then
   #if 176 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X176" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (176,'enableCheckAdapter','0','1','2','1','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 177 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 177;")
 if [ $? -eq 0 ]
 then
   #if 177 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X177" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (177,'groupedQueryThreshold','0','3600000','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
 #Check key_id 178 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 178;")
 if [ $? -eq 0 ]
 then
   #if 178 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X178" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (178,'maxFieldValueLength','0','1048576','2','4096','pre-custom','1');
+`
show_error
   fi
 fi
  
 #Check key_id 179 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 179;")
 if [ $? -eq 0 ]
 then
   #if 179 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X179" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (179,'maxRecordValueLength','0','4194304','2','16384','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 180 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 180;")
 if [ $? -eq 0 ]
 then
   #if 180 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X180" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (180,'bciLogSleepInterval','0','30000','4','300','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 181 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 181;")
 if [ $? -eq 0 ]
 then
   #if 181 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X181" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (181,'enableIPStatusCode','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 182 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 182;")
 if [ $? -eq 0 ]
 then
   #if 182 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X182" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (182,'enableExecuteBatch','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 183 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 183;")
 if [ $? -eq 0 ]
 then
   #if 183 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X183" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (183,'enableExSrcTraceLevel','0','2048','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 184 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 184;")
 if [ $? -eq 0 ]
 then
   #if 184 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X184" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (184,'BCILoggingMode','0','2048','5','FILE','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 185 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 185;")
 if [ $? -eq 0 ]
 then
   #if 185 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X185" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES (185,'SafetyNetClassTypesFile','1','1024','6','NA','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 186 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 186;")
 if [ $? -eq 0 ]
 then
   #if 186 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X186" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (186,'threadDumpFormat','0','1','2','1','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 187 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 187;")
 if [ $? -eq 0 ]
 then
   #if 187 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X187" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (187,'statusCodeAccessible','0','1','2','1','pre-custom','1');
+`
show_error
   fi
 fi

#Check key_id 188 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 188;")
 if [ $? -eq 0 ]
 then
   #if 188 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X188" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (188,'maxAsyncDetailMapSize','0','100000','2','10000','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check key_id 189 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 189;")
 if [ $? -eq 0 ]
 then
   #if 189 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X189" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (189,'dynamicSlowVslowThreshold','0','1','2','0','pre-custom','2');
+`
show_error
   fi
 fi
 
#Check key_id 190 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 190;")
 if [ $? -eq 0 ]
 then
   #if 190 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X190" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (190,'ndILRewritterFile','0','2048','6','NA','pre-custom','5');
+`
show_error
   fi
 fi
 
#Check key_id 191 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 191;")
 if [ $? -eq 0 ]
 then
   #if 191 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X191" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (191,'ndModuleFile','0','2048','6','NA','pre-custom','5');
+`
show_error
   fi
 fi
 
#Check key_id 192 exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 192;")
 if [ $? -eq 0 ]
 then
   #if 192 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X192" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES 
	 (192,'ndProcessesFile','0','2048','6','NA','pre-custom','5');
+`
show_error
   fi
 fi
 
#========================Add column ndc_key_type in table ndc_keywords==============================
#Check ndc_key_type column exists in config_$CONTROLLER_NAME.ndc_keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.ndc_keywords' and column_name ilike 'ndc_key_type';")
if [ $? -eq 0 ]
then
 #if ndc_key_type column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
		ALTER TABLE config_$CONTROLLER_NAME.ndc_keywords ADD COLUMN ndc_key_type varchar(255);
+`
show_error
   fi
 fi

#==========================Update code for Newly Added  NDC Keywords=============================================================
#Check ndc_key_id 93 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 93;")
 if [ $? -eq 0 ]
 then
   #if 93 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X93" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (93,'SEND_NDCOLLECTOR_IP','0','1','1','1','NDC');
+`
show_error
   fi
 fi

 #Check ndc_key_id 94 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 94;")
 if [ $? -eq 0 ]
 then
   #if 94 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X94" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (94,'AUTO_SCALE_BLOCKED_TIER','','','','','NDC');
+`
show_error
   fi
 fi

#Check ndc_key_id 95 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 95;")
 if [ $? -eq 0 ]
 then
   #if 95 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X95" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (95,'AUTO_SCALE_ALLOWD_TIER','','','','','NDC');
+`
show_error
   fi
 fi

#Check ndc_key_id 96 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 96;")
 if [ $? -eq 0 ]
 then
   #if 96 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X96" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (96,'NDP_EXTENDED_METADATA','0','1','0','0','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 97 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 97;")
 if [ $? -eq 0 ]
 then
   #if 97 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X97" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (97,'NDP_MAX_BEGIN_SEQ_LEN','0','256','256','256','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 98 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 98;")
 if [ $? -eq 0 ]
 then
   #if 98 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X98" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (98,'NDP_FREE_FP_MEM_ON_COMPLETION','0','1','0','0','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 99 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 99;")
 if [ $? -eq 0 ]
 then
   #if 99 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X99" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (99,'NDP_MEMPOOL_SETTINGS','','','','','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 100 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 100;")
 if [ $? -eq 0 ]
 then
   #if 100 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X100" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (100,'NDP_MONITORS','','','','','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 101 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 101;")
 if [ $? -eq 0 ]
 then
   #if 101 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X101" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (101,'NDP_ENABLE_SQL_METADATA_RECOVERY','0','1','1','1','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 102 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 102;")
 if [ $? -eq 0 ]
 then
   #if 102 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X102" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (102,'NDP_THRESHOLD_DIFF_BET_FP_AND_ENTRY_MTD_RESPTIME_SEC','','','900','900','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 103 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 103;")
 if [ $? -eq 0 ]
 then
   #if 103 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X103" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (103,'NDP_NUM_NONPREP_SQL_LOAD_AT_INIT','','','2500','2500','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 104 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 104;")
 if [ $? -eq 0 ]
 then
   #if 104 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X104" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (104,'NDP_SQL_NONPREP_ROLLOVER_SIZE_MB','','','100','100','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 105 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 105;")
 if [ $? -eq 0 ]
 then
   #if 105 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X105" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (105,'NDP_PERIODIC_SCANDIR_TIME','','','600','600','NDP');
+`
show_error
   fi
 fi

#Check ndc_key_id 106 exists in config_$CONTROLLER_NAME.ndc_keywords table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_id = 106;")
 if [ $? -eq 0 ]
 then
   #if 106 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X106" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords (ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES (106,'NDP_MON_LARGE_FLOWPATH_METHOD_COUNT','','','10000','10000','NDP');
+`
show_error
   fi
 fi

#Check entry_type_id 13 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id = 13;")
 if [ $? -eq 0 ]
 then
   #if 13 column does not exist then insert that row in table
   if [ "X$KEY_ID" != "X13" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_name, entry_type_detail) VALUES (13,'playEntryPoint','description');
+`
show_error
   fi
 fi

#=============================Add column ndc_key_desc in table ndc_keywords==================================
#Check ndc_key_desc column exists in config_$CONTROLLER_NAME.ndc_keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.ndc_keywords' and column_name ilike 'ndc_key_desc';")
if [ $? -eq 0 ]
then
 #if ndc_key_desc column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.ndc_keywords add COLUMN ndc_key_desc varchar(255);
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.keywords WHERE key_id = 158;
+`
show_error

# Table entries for NDInterfaceEntryPoints
data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.backend_type_interface;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type_interface(backend_type_interface_id,backend_type_interface_name,backend_type_interface_desc,backend_type_interface_entrypointsfile,agent) VALUES
(1,'Logger','Logger Backend','Logger','Java');
+`
show_error
   fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.backend_points_interface;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points_interface(end_point_interface_id,end_point_interface_desc,end_point_interface_fqm,end_point_interface_name,backend_type_interface_id,custom_entry,module,agent,type,sub_type) VALUES
(1,'SLF4J End Point','org.slf4j.Logger.info','Logger.info',1,false,'-','Java','SLF4J','info'),
(2,'SLF4J End Point','org.slf4j.Logger.debug','Logger.debug',1,false,'-','Java','SLF4J','debug'),
(3,'SLF4J End Point','org.slf4j.Logger.trace','Logger.trace',1,false,'-','Java','SLF4J','trace'),
(4,'SLF4J End Point','org.slf4j.Logger.warn','Logger.warn',1,false,'-','Java','SLF4J','warn'),
(5,'SLF4J End Point','org.slf4j.Logger.error','Logger.error',1,false,'-','Java','SLF4J','error'),
(6,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.trace','ExtendedLogger.trace',1,false,'-','Java','LOG4J','trace'),
(7,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.info','ExtendedLogger.info',1,false,'-','Java','LOG4J','info'),
(8,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.debug','ExtendedLogger.debug',1,false,'-','Java','LOG4J','debug'),
(9,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.warn','ExtendedLogger.warn',1,false,'-','Java','LOG4J','warn'),
(10,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.fatal','ExtendedLogger.fatal',1,false,'-','Java','LOG4J','fatal'),
(11,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.error','ExtendedLogger.error',1,false,'-','Java','LOG4J','error'),
(12,'LOG4J End Point','org.apache.logging.log4j.spi.ExtendedLogger.log','ExtendedLogger.log',1,false,'-','Java','LOG4J','log');
+`
show_error
  fi
fi

data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.profile_backend_point_interface_asso;")
if [ $? -eq 0 ]
then
  if [ $data_exists -eq 0 ]
  then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_interface_asso(assoc_id,enabled,end_point_interface_id,profile_id) VALUES
(1,false,1,1),
(2,false,2,1),
(3,false,3,1),
(4,false,4,1),
(5,false,5,1),
(6,false,6,1),
(7,false,7,1),
(8,false,8,1),
(9,false,9,1),
(10,false,10,1),
(11,false,11,1),
(12,false,12,1);
+`
show_error
  fi
fi

 #Check key_name NDInterfaceEntryPointsFile exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'NDInterfaceEntryPointsFile';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'NDInterfaceEntryPointsFile','0','1024','6','false','normal','1');
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_def_value = '1H 10M' , ndc_key_val='1H 10M' where ndc_key_id = 87;
Update config_$CONTROLLER_NAME.keywords set key_def_value = '13312' where key_name = 'maxCharInSeqBlob';
Update config_$CONTROLLER_NAME.keywords set key_def_value = '10000' where key_name = 'maxResourceDetailMapSize';
Update config_$CONTROLLER_NAME.keywords set key_def_value = '0' where key_name = 'ASTraceLevel';
Update config_$CONTROLLER_NAME.keywords set key_max = '100' where key_name = 'ndHotspotThreadLimit';
Update config_$CONTROLLER_NAME.keywords set key_max = '10000000' where key_name = 'maxAsyncDetailMapSize';
+`
show_error

#Check entry_type_id 14 exists in config_$CONTROLLER_NAME.entry_type table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id = 14;")
 if [ $? -eq 0 ]
 then
   #if 14 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X14" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.entry_type (entry_type_id, entry_type_name, entry_type_detail) VALUES (14,'JsAutoInject','description');
+`
show_error
   fi
 fi

# To delete the BTTConfig keyword from DB
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name='BTTConfig';")
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_name='BTTConfig';")
 if [ $? -eq 0 ]
 then 
   if [ "X$KEY_NAME" == "XBTTConfig" ]
   then
Error=` psql test cavisson 2>&1<<+
     DELETE FROM config_$CONTROLLER_NAME.profile_keywords WHERE key_id = ${KEY_ID};
     DELETE FROM config_$CONTROLLER_NAME.keywords WHERE key_id = ${KEY_ID};
+`
show_error
   fi
 fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V';"))
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V','OutputBuffer.writeBytes([BII)V', 14,false,'-','Java');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 1);
+`
    show_error
      fi
    fi

  #Check key_name NDC_THRESHOLD_TO_DELETE_INVALID_SERVERS exists in config_$CONTROLLER_NAME.ndc_keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_name from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDC_THRESHOLD_TO_DELETE_INVALID_SERVERS';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
  if [ $? -eq 0 ]
  then
  #if key_name does not exist then insert that row in table
  if [ "X$KEY_NAME" == "X" ]
  then
  Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.ndc_keywords (ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val, ndc_key_type) VALUES ($(($MAX_ID + 1)),'NDC_THRESHOLD_TO_DELETE_INVALID_SERVERS','','','1 1h','1 1h','');
  +`
  show_error
    fi
  fi

# To delete the keyword present at key_id 14 from DB
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 14;")
 if [ $? -eq 0 ]
 then
   if [ "X$KEY_ID" == "X14" ]
   then
Error=`psql test cavisson 2>&1<<+
     DELETE FROM config_$CONTROLLER_NAME.profile_keywords WHERE key_id = ${KEY_ID};
     DELETE FROM config_$CONTROLLER_NAME.keywords WHERE key_id = ${KEY_ID};
+`
show_error
   fi
 fi

 #Check key_name NVAutoInjectionRuleFile exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'NVAutoInjectionRuleFile';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'NVAutoInjectionRuleFile','0','1024','6','false','normal','1');
+`
show_error
   fi
 fi

 #Check key_name enableNVInjectingTag exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableNVInjectingTag';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableNVInjectingTag','0','2048','5','0%201%20text/html','pre-custom','1');
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set agent_mode = '7'  where key_name = 'instrExceptions';
Update config_$CONTROLLER_NAME.keywords set agent_mode = '5'  where key_name in ('enableExceptionsWithSourceAndVars', 'enableSourceCodeFilters');
Update config_$CONTROLLER_NAME.keywords set agent_mode = '3'  where key_name = 'enableUpdateLogMsgForNF';
Update config_$CONTROLLER_NAME.keywords set type = 'normal' where key_name = 'enableNVInjectingTag';
Update config_$CONTROLLER_NAME.service_entry_points set entry_fqm = 'org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V' , entry_name = 'OutputBuffer.writeBytes([BII)V'  where entry_fqm = 'org.apache.coyote.Response.doWrite(Ljava/nio/ByteBuffer;)V';
+`
show_error

#=====================Changes for supporting FTP Entry end point for Java agent=============================
#Check backend_type_id 29 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 33;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X33" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (33,'FTP Backend','FTP','FtpCallout','FTP','Java');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,33,1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.commons.net.ftp.FTP.sendCommand(Ljava/lang/String;Ljava/lang/String;)I';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'FTP Backend','org.apache.commons.net.ftp.FTP.sendCommand(Ljava/lang/String;Ljava/lang/String;)I','FTP',33,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#=====================Changes for supporting NodeJS Entry end point for Java agent=============================
#Check backend_type_id 34 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 34;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X34" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (34,'HTTP Backend','HTTP','HTTP','HTTP','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,34,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'ON:ADDLISTNER';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','ON:ADDLISTNER','ON:ADDLISTNER',34,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 35 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 35;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X35" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (35,'HTTP_Request Backend','Http_Request','HTTP_REQUEST','None','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,35,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 35;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_Request Backend','Command','Command',35,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 36 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 36;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X36" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (36,'Mongo Backend','Mongo','mongo','MONGO','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,36,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 36;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO Backend','Command','Command',36,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 37 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 37;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X37" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (37,'Redis Backend','Redis','redis','REDIS','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,37,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 37;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS Backend','Command','Command',37,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 38 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 38;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X38" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (38,'Winston Backend','Winston','winston','None','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,38,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'error' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','error','error',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'warn' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','warn','warn',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'info' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','info','info',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'verbose' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','verbose','verbose',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'debug' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','debug','debug',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'silly' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','silly','silly',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'log' AND backend_type_id = 38;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'WINSTON Backend point','log','log',38,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 39 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 39;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X39" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type (backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (39,'Console Backend','Console','console','None','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso (assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,39,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'info' AND backend_type_id = 39;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CONSOLE Backend point','info','info',39,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'debug' AND backend_type_id = 39;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CONSOLE Backend point','debug','debug',39,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'log' AND backend_type_id = 39;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CONSOLE Backend point','log','log',39,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso (assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'warn' AND backend_type_id = 39;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CONSOLE Backend point','warn','warn',39,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'error' AND backend_type_id = 39;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CONSOLE Backend point','error','error',39,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check backend_type_id 40 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 40;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X40" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type (backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (40,'Postgresql Backend','Postgresql','postgresql','POSTGRESQL','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso (assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,40,777777);
+`
show_error
fi
fi

#Check backend_type_id 41 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 41;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X41" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type (backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (41,'Zookeeper Backend','Zookeeper','zookeeper','ZOOKEEPER','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso (assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,41,777777);
+`
show_error
fi
fi

#Check backend_type_id 42 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 42;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X42" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type (backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (42,'MemCache Backend','MemCache','memcache','MEMCACHE','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso (assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,42,777777);
+`
show_error
fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_name = 'enableASTransactionHotspot';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_KEY_ID+1)),'enableASTransactionHotspot','0','1','2','0','normal','1');
+`
show_error
   fi
 fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
 KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_name = 'maxThreadsforTransactionHostspot';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_KEY_ID+1)),'maxThreadsforTransactionHostspot','0','10000000','2','10000','normal','1');
+`
show_error
   fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.postgresql.jdbc.PgStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC end point','org.postgresql.jdbc.PgStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;','PgStatement.executeQuery(String;)Ljava/sql/ResultSet;',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.postgresql.jdbc.PgStatement.execute(Lorg/postgresql/core/CachedQuery;Lorg/postgresql/core/ParameterList;I)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC end point','org.postgresql.jdbc.PgStatement.execute(Lorg/postgresql/core/CachedQuery;Lorg/postgresql/core/ParameterList;I)V','PgStatement.execute(CachedQuery;ParameterList;I)V',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlConnection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL callout for dot net','System.Data.SqlClient.SqlConnection.Open','SqlConnection.Open',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.OracleClient.OracleConnection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL callout for dot net','System.Data.OracleClient.OracleConnection.Open','OracleConnection.Open',17,false,'System.Data.OracleClient.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso set profile_enable = false WHERE entry_id = 19 AND profile_id = 888888;
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false WHERE end_point_id in (73, 83) AND profile_id = 888888;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.SendAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','System.Net.Http.HttpClient.SendAsync','HttpClient.SendAsync',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClientHandler.SendAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','System.Net.Http.HttpClientHandler.SendAsync','HttpClientHandler.SendAsync',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#=====================Changes for supporting Custom_Entry end point for Dot Net agent=============================
#Check backend_type_id 44 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 43;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X43" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (43,'Custom Backend','Custom','CUSTOM_ENTRY','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,43,888888);
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.backend_points set backend_type_id = 43 where backend_type_id = 27 and agent = 'Dot Net';
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SampleApplication.Form1.button1_Click';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom end point','SampleApplication.Form1.button1_Click','Form1.button1_Click',43,false,'SampleApplication.exe','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SampleApplication.Form1.button4_Click';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom end point','SampleApplication.Form1.button4_Click','Form1.button4_Click',43,false,'SampleApplication.exe','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SampleApplication.Form1.button6_Click';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom end point','SampleApplication.Form1.button6_Click','Form1.button6_Click',43,false,'SampleApplication.exe','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SampleApplication.Form1.Exception_Level1_Click';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom end point','SampleApplication.Form1.Exception_Level1_Click','Form1.Exception_Level1_Click',43,false,'SampleApplication.exe','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SampleApplication.Form1.Exception_Level2_Click';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom end point','SampleApplication.Form1.Exception_Level2_Click','Form1.Exception_Level2_Click',43,false,'SampleApplication.exe','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Update kmd_id for the keyword ndExceptionFilterList
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set kmd_id = '5' where key_name = 'ndExceptionFilterList';
Update config_$CONTROLLER_NAME.backend_points set custom_entry = false where end_point_fqm = 'ON:ADDLISTNER' AND backend_type_id = 34;
Update config_$CONTROLLER_NAME.backend_points set custom_entry = false where end_point_fqm = 'Command' AND backend_type_id in (35, 36, 37);
+`
show_error

#Insert rtcTimeOut keyword in global_settings table
Error=` psql test cavisson 2>&1<<+
      INSERT INTO config_$CONTROLLER_NAME.global_settings (key_id,key_name,key_min,key_max,key_def_value,key_value,key_desc) VALUES (1,'rtcTimeOut','5','300','60','60','RTC time out setting');
+`
show_error

#========================New Entry Points For AsyncRedisCallout===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(Lcom/lambdaworks/redis/protocol/RedisCommand;)Lcom/lambdaworks/redis/protocol/AsyncCommand;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(Lcom/lambdaworks/redis/protocol/RedisCommand;)Lcom/lambdaworks/redis/protocol/AsyncCommand;','AbstractRedisAsyncCommands.dispatch(RedisCommand)AsyncCommand',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z','CompletableFuture.complete(Ljava/lang/Object;)Z',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z','CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'redis.clients.jedis.Connection.sendCommand(Lredis/clients/jedis/Protocol$Command;[[B)Lredis/clients/jedis/Connection;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','redis.clients.jedis.Connection.sendCommand(Lredis/clients/jedis/Protocol$Command;[[B)Lredis/clients/jedis/Connection;','Connection.sendCommand(Command;[[B)Connection',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'redis.clients.jedis.Protocol.process(Lredis/clients/util/RedisInputStream;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','redis.clients.jedis.Protocol.process(Lredis/clients/util/RedisInputStream;)Ljava/lang/Object;','Protocol.process(RedisInputStream;)Object',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Insert default_Php and default_Python in profile table
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile(profile_id,profile_name,profile_desc,controller_name,agent) 
VALUES
(666666,'default_Php','Default profile for Php','-','Php'),
(999999,'default_Python','Default profile for Python','-','Python');
+`
show_error

#=====================Changes for supporting end points for PHP agent=============================
#Check backend_type_id 44 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 44;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X44" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (44,'SQL_CALLOUT Backend','SQL_CALLOUT','SQL_CALLOUT','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,44,666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.mysqli_prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','.mysqli_prepare','.mysqli_prepare',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.mysqli_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','.mysqli_query','.mysqli_query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'PDO.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','PDO.query','PDO.query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Insert Entry for default_Php and default_Python in bussiness_trans_global table
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.bussiness_trans_global(bt_global_id, complete, dynamic_req_type, dynamic_req_value, http_method, request_header, request_param, segment_type, segment_uri,segment_value, slow_transaction, uri_type, very_slow_transaction, profile_id, slow_threshold, very_slow_threshold, segment_no) VALUES 
(4, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000, 666666, '10', '20',''),
(5, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000, 999999, '10', '20','');
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.mysql.cj.jdbc.StatementImpl';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC end point','com.mysql.cj.jdbc.StatementImpl','Non Prepared Statement : mysqlDB',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check projectid column exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso' and column_name ilike 'projectid';")
if [ $? -eq 0 ]
then
 #if projectid column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso add COLUMN projectid boolean;
+`
show_error
   fi
 fi
 
#Check instanceid column exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso' and column_name ilike 'instanceid';")
if [ $? -eq 0 ]
then
 #if instanceid column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso add COLUMN instanceid boolean;
+`
show_error
   fi
 fi
 
#Check databaseid column exists in config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select column_name from information_schema.columns where table_name ilike 'config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso' and column_name ilike 'databaseid';")
if [ $? -eq 0 ]
then
 #if databaseid column does not exist then insert add that column in table
  if [ "X$KEY_NAME" == "X" ]
  then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso add COLUMN databaseid boolean;
+`
show_error
   fi
 fi

#=====================Changes for supporting SPANNER Entry end point for Java agent=============================
#Check backend_type_id 45 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id =45 ;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X45" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (45,'Spanner Backend','Spanner','spannerDB','SPANNER','Java');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,45,1,true,true,true);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readRow(Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readRow(Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;','SessionPool.readRow(String;Key;Iterable;)Lcom/google/cloud/spanner/Struct;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readRowUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readRowUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;','SessionPool.readRowUsingIndex(String;String;Key;Iterable;)Lcom/google/cloud/spanner/Struct;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$AutoClosingReadContext.readUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;','SessionPool.readUsingIndex(String;String;KeySet;Iterable;Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$AutoClosingReadContext.executeQuery(Lcom/google/cloud/spanner/Statement;[Lcom/google/cloud/spanner/Options$QueryOption;)Lcom/google/cloud/spanner/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$AutoClosingReadContext.executeQuery(Lcom/google/cloud/spanner/Statement;[Lcom/google/cloud/spanner/Options$QueryOption;)Lcom/google/cloud/spanner/ResultSet;','SessionPool.executeQuery(Statement;Options$QueryOption;)Lcom/google/cloud/spanner/ResultSet;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$AutoClosingReadContext.read(Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$AutoClosingReadContext.read(Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;','SessionPool.read(String;KeySet;Iterable;Options$ReadOption;)Lcom/google/cloud/spanner/ResultSet;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SpannerImpl$TransactionContextImpl.executeUpdate(Lcom/google/cloud/spanner/Statement;)J';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SpannerImpl$TransactionContextImpl.executeUpdate(Lcom/google/cloud/spanner/Statement;)J','SpannerImpl.executeUpdate(Statement;)J',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.DatabaseClientImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.DatabaseClientImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','DatabaseClientImpl.writeAtLeastOnce(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.DatabaseClientImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.DatabaseClientImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','DatabaseClientImpl.write(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SpannerImpl$SessionImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SpannerImpl$SessionImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','SpannerImpl.write(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SpannerImpl$SessionImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SpannerImpl$SessionImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','SpannerImpl.writeAtLeastOnce(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$PooledSession.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$PooledSession.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','SessionPool.write(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.google.cloud.spanner.SessionPool$PooledSession.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SPANNER Backend','com.google.cloud.spanner.SessionPool$PooledSession.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;','SessionPool.writeAtLeastOnce(Iterable;)Lcom/google/cloud/Timestamp;',45,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDC_PERCENTILES';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDC_PERCENTILES','','','80,85,90,95,99','80,85,90,95,99','')
+`
show_error
   fi
 fi

#Update ndc_def_value and ndc_key_val for the keyword NDC_THRESHOLD_TIME_TO_MARK_APP_INACTIVE
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_def_value = '10M 10M', ndc_key_val = '10M 10M' where ndc_key_name = 'NDC_THRESHOLD_TIME_TO_MARK_APP_INACTIVE' AND ndc_key_id = 87;
ALTER TABLE config_$CONTROLLER_NAME.ndc_keywords ALTER COLUMN ndc_key_val TYPE varchar(4096);
ALTER TABLE config_$CONTROLLER_NAME.ndc_keyword_asso ALTER COLUMN key_value TYPE varchar(4096);
+`
show_error

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.bt_http_body
ADD COLUMN rule_id bigint,
ADD COLUMN parent_rule_id bigint,
ADD COLUMN bt_pattern_id bigint;

ALTER TABLE config_$CONTROLLER_NAME.bt_http_hdr
ADD COLUMN rule_id bigint,
ADD COLUMN parent_rule_id bigint,
ADD COLUMN bt_pattern_id bigint;

ALTER TABLE config_$CONTROLLER_NAME.bt_method
ADD COLUMN rule_id bigint,
ADD COLUMN parent_rule_id bigint,
ADD COLUMN bt_pattern_id bigint;

ALTER TABLE config_$CONTROLLER_NAME.bt_response_hdr
ADD COLUMN rule_id bigint,
ADD COLUMN parent_rule_id bigint,
ADD COLUMN bt_pattern_id bigint;

ALTER TABLE config_$CONTROLLER_NAME.bt_pattern
ADD COLUMN bt_method boolean default false,
ADD COLUMN bt_response boolean default false,
ADD COLUMN bt_request boolean default false,
ADD COLUMN http_body boolean default false,
ADD COLUMN bt_rule_id bigint,
ADD COLUMN parent_rule_id bigint;

ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ALTER bt_id DROP NOT NULL;
+`
show_error

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.ndc_keywords SET ndc_key_name = 'NDC_PERCENTILES'  WHERE ndc_def_value = '80,85,90,95,99' AND ndc_key_name = 'NDC_BT_PERCENTILES';
UPDATE config_$CONTROLLER_NAME.ndc_keywords SET ndc_key_type = ''  WHERE ndc_key_name = 'NDC_PERCENTILES';
+`
show_error

 #Check key_name NVAutoInjectionRuleFile exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'tDigestPercentileBT';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'tDigestPercentileBT','0','512','5','2%20100%20100%2010793%201','pre-custom','1');
+`
show_error
   fi
 fi

  #Check key_name NVAutoInjectionRuleFile exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'tDigestPercentileIP';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'tDigestPercentileIP','0','512','5','2%20100%20100%2010794%201','pre-custom','1');
+`
show_error
   fi
 fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDC_T_DIGEST_DEBUG_INFO_DUMP';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")

 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDC_T_DIGEST_DEBUG_INFO_DUMP','0','1','0','0','NDC')
+`
show_error
   fi
 fi

 #=====================Changes for supporting Advance Custom Entry end point for Java agent=============================
 #Check backend_type_id 46 exists in config_$CONTROLLER_NAME.backend_type table or not
 KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id =46 ;")
 MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;") 
 if [ $? -eq 0 ]
 then
 if [ "X$KEY_ID" != "X46" ]
 then
 Error=` psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (46,'Advance Custom Backend','Advance Custom','advCustomCallout:','None','Java');
 INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,46,1,false,false,false);
+`
 show_error
 fi
 fi

 #Check key_name enableProcessNotificationPhase exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableProcessNotificationPhase';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableProcessNotificationPhase','0','1','2','0','pre-custom','4');
+`
show_error
   fi
 fi

 #Check key_name enableDumpAsyncId exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableDumpAsyncId';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableDumpAsyncId','0','1','2','0','pre-custom','2');
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '0%205m%202%20100%20100%2010793%201', type = 'normal' WHERE key_name = 'tDigestPercentileBT';
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '0%205m%202%20100%20100%2010794%201', type = 'normal' WHERE key_name = 'tDigestPercentileIP';
DELETE FROM config_$CONTROLLER_NAME.ndc_keywords WHERE ndc_key_name in ('NDC_BT_PERCENTILE_TIERS', 'NDC_ENABLE_INSTANCE_LEVEL_PERCENTILE', 'NDC_IP_PERCENTILE_TIERS');
UPDATE config_$CONTROLLER_NAME.keywords SET agent_mode = '3' WHERE key_name in ('tDigestPercentileBT', 'tDigestPercentileIP');
+`
show_error

 #Check key_name enableOptimizedInstrumentation exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableOptimizedInstrumentation';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableOptimizedInstrumentation','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi

 #Check key_name enableJmsInterfaceCapturing exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableJmsInterfaceCapturing';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableJmsInterfaceCapturing','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.activemq';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JMS Active Backend','org.apache.activemq','org.apache.activemq',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.ibm.msg.client.jms';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JMS IBM Backend','com.ibm.msg.client.jms','com.ibm.msg.client.jms',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'weblogic.jms.client';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JMS IBM Backend','weblogic.jms.client','weblogic.jms.client',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

 #Check key_name enableJdbcInterfaceCapturing exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableJdbcInterfaceCapturing';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableJdbcInterfaceCapturing','0','1','2','0','pre-custom','1');
+`
show_error
   fi
 fi
 
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.mysql';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC MySQL Backend','com.mysql','com.mysql',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.postgres';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Postgres Backend','org.postgres','org.postgres',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.ibm';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC IBM Backend','com.ibm','com.ibm',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Oracle Backend','oracle.jdbc','oracle.jdbc',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'weblogic.wsee.saaj.SOAPConnectionImpl.call(Ljavax/xml/soap/SOAPMessage;Ljava/lang/Object;)Ljavax/xml/soap/SOAPMessage;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','weblogic.wsee.saaj.SOAPConnectionImpl.call(Ljavax/xml/soap/SOAPMessage;Ljava/lang/Object;)Ljavax/xml/soap/SOAPMessage;','SOAPConnectionImpl.call(SOAPMessage;Object;)Ljavax/xml/soap/SOAPMessage;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.net.Socket.connect(Ljava/net/SocketAddress;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','java.net.Socket.connect(Ljava/net/SocketAddress;)V','Socket.connect(SocketAddress;)V',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.net.Socket.connect(Ljava/net/SocketAddress;I)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','java.net.Socket.connect(Ljava/net/SocketAddress;I)V','Socket.connect(SocketAddress;I)V',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(Ljava/util/concurrent/RunnableScheduledFuture;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Thread Backend','java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(Ljava/util/concurrent/RunnableScheduledFuture;)V','ScheduledThreadPoolExecutor.delayedExecute(RunnableScheduledFuture;)V',15,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.mongodb.MongoCollectionImpl';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO end point','com.mongodb.MongoCollectionImpl','MongoCollectionImpl : mongoDB',11,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.mongodb.client.internal.MongoCollectionImpl';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO end point','com.mongodb.client.internal.MongoCollectionImpl','MongoCollectionImpl : mongoDB',11,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#=====================Changes for supporting AsyncHttpService service entry for Java agent=============================
#Check backend_type_id 15 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =15 ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X15" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (15, 'description', 'AsyncHTTPService');
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart()V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart()V','HttpServerOperations.onHandlerStart',15,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'reactor.netty.http.server.HttpServerOperations.onInboundNext(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','reactor.netty.http.server.HttpServerOperations.onInboundNext(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V','HttpServerOperations.onInboundNext',15,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#=====================Changes for supporting UnderTowEntry service entry for Java agent=============================
#Check backend_type_id 16 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =16 ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X16" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (16, 'description', 'UnderTowEntry');
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.undertow.servlet.handlers.ServletHandler.handleRequest(Lio/undertow/server/HttpServerExchange;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','io.undertow.servlet.handlers.ServletHandler.handleRequest(Lio/undertow/server/HttpServerExchange;)V','ServletHandler.handleRequest',16,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

 #Check key_name tDigestInstanceLevelDump exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'tDigestInstanceLevelDump';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'tDigestInstanceLevelDump','0','1','1','0','normal','3');
+`
show_error
   fi
 fi

 #Check key_name enableNDNFDataTransfer exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableNDNFDataTransfer';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableNDNFDataTransfer','0','2048','5','0','normal','1');
+`
show_error
   fi
 fi
 
 #Check key_name NDNFFlushInterval exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'NDNFFlushInterval';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'NDNFFlushInterval','0','4294967295','4','300000','normal','1');
+`
show_error
   fi
 fi

 #Check key_name bciNDNFDataBufferSetting exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'bciNDNFDataBufferSetting';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'bciNDNFDataBufferSetting','0','2048','5','50%20256000','normal','1');
+`
show_error
   fi
 fi

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set type = 'normal'  where key_name = 'enableUpdateLogMsgForNF';
Update config_$CONTROLLER_NAME.entry_type set entry_type_name = 'AsyncHttpService'  where entry_type_id =15 ;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.kafka.clients.producer.KafkaProducer.send(Lorg/apache/kafka/clients/producer/ProducerRecord;Lorg/apache/kafka/clients/producer/Callback;)Ljava/util/concurrent/Future;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','org.apache.kafka.clients.producer.KafkaProducer.send(Lorg/apache/kafka/clients/producer/ProducerRecord;Lorg/apache/kafka/clients/producer/Callback;)Ljava/util/concurrent/Future;','KafkaProducer.send(ProducerRecord,Callback;)',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'SERVER_BLACKLIST_SETTINGS';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'SERVER_BLACKLIST_SETTINGS','','','1 60 3 1800','1 60 3 1800','')
+`
show_error
   fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'weblogic.servlet.internal.ChunkOutputWrapper.write([BII)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','weblogic.servlet.internal.ChunkOutputWrapper.write([BII)V','ChunkOutputWrapper.write',14,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#=====================Changes for supporting end points for PHP agent=============================
#Check backend_type_id 47 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 47;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X47" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (47,'MONGO_DB Backend','MONGO_DB','MONGO_DB','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,47,666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.find';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.find','MongoDB\Collection.find',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.updateOne';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.updateOne','MongoDB\Collection.updateOne',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.insertMany';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.insertMany','MongoDB\Collection.insertMany',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.insertOne';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.insertOne','MongoDB\Collection.insertOne',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.deleteOne';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.deleteOne','MongoDB\Collection.deleteOne',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.deleteMany';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.deleteMany','MongoDB\Collection.deleteMany',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check backend_type_id 48 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 48;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X48" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (48,'COUCHBASE_DB Backend','COUCHBASE_DB','COUCHBASE_DB','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,48,666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Couchbase\N1qlQuery.fromString';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','Couchbase\N1qlQuery.fromString','Couchbase\N1qlQuery.fromString',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CouchbaseN1qlQuery.fromString';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','CouchbaseN1qlQuery.fromString','CouchbaseN1qlQuery.fromString',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Couchbase\Bucket.insert';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','Couchbase\Bucket.insert','Bucket.insert',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CouchbaseBucket.insert';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','CouchbaseBucket.insert','CouchbaseBucket.insert',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 48,end_point_name='Couchbase\N1qlQuery.fromString',end_point_desc = 'COUCHBASE_DB Callout' WHERE backend_type_id = 44 AND end_point_fqm = 'Couchbase\N1qlQuery.fromString';
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 48,end_point_name='CouchbaseN1qlQuery.fromString',end_point_desc = 'COUCHBASE_DB Callout' WHERE backend_type_id = 44 AND end_point_fqm = 'CouchbaseN1qlQuery.fromString';
Update config_$CONTROLLER_NAME.ndc_keywords set ndc_key_name = 'AUTO_SCALE_ALLOWED_TIER'  where ndc_key_name = 'AUTO_SCALE_ALLOWD_TIER' AND ndc_key_id = 95;
+`
show_error

#Updating enable = true of the given below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = true WHERE end_point_id IN 
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE 
(
end_point_fqm = 'org.springframework.web.client.DefaultResponseErrorHandler.hasError(Lorg/springframework/http/client/ClientHttpResponse;)Z' OR 
end_point_fqm = 'org.apache.cxf.transport.http.URLConnectionHTTPConduit.getResponseCode()I' OR 
end_point_fqm = 'com.datastax.driver.core.SessionManager' OR 
end_point_fqm = 'com.datastax.driver.core.RequestHandler' OR 
end_point_fqm = 'com.hazelcast.client.spi.ClientProxy.invoke(Lcom/hazelcast/client/impl/protocol/ClientMessage;)Ljava/lang/Object;' OR 
end_point_fqm ='com.tibco.tibjms.TibjmsMessageProducer._publish(Ljavax/jms/Destination;Ljavax/jms/Message;ZIIJZLjavax/jms/CompletionListener;)Lcom/tibco/tibjms/TibjmsMessage;' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.batchCallback(Ljava/util/List;[Ljava/lang/Object;Lorg/apache/hadoop/hbase/client/coprocessor/Batch;)V' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.delete(Lorg/apache/hadoop/hbase/client/Delete;)V' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.doPut(Lorg/apache/hadoop/hbase/client/Put;)V' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.checkAndPut([B[B[B[BLorg/apache/hadoop/hbase/client/Put;)Z' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.checkAndDelete([B[B[B[BLorg/apache/hadoop/hbase/client/Delete;)Z' OR 
end_point_fqm = 'org.apache.hadoop.hbase.client.HTable.finishSetup()V' OR 
end_point_fqm = 'com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Lcom/sun/xml/internal/ws/api/message/Packet;)Lcom/sun/xml/internal/ws/api/pipe/NextAction;' OR 
end_point_fqm = 'com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.writeSOAPAction(Ljava/util/Map;Ljava/lang/String;)V' OR 
end_point_fqm = 'com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.writeSOAPAction(Ljava/util/Map;Ljava/lang/String;Lcom/sun/xml/internal/ws/api/message/Packet;)V' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.readRow(Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.readRowUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/Key;Ljava/lang/Iterable;)Lcom/google/cloud/spanner/Struct;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.readUsingIndex(Ljava/lang/String;Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options;)Lcom/google/cloud/spanner/ResultSet;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.executeQuery(Lcom/google/cloud/spanner/Statement;[Lcom/google/cloud/spanner/Options;)Lcom/google/cloud/spanner/ResultSet;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.read(Ljava/lang/String;Lcom/google/cloud/spanner/KeySet;Ljava/lang/Iterable;[Lcom/google/cloud/spanner/Options;)Lcom/google/cloud/spanner/ResultSet;' OR 
end_point_fqm = 'com.google.cloud.spanner.SpannerImpl.executeUpdate(Lcom/google/cloud/spanner/Statement;)J' OR 
end_point_fqm = 'com.google.cloud.spanner.DatabaseClientImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'com.google.cloud.spanner.DatabaseClientImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'com.google.cloud.spanner.SpannerImpl.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'com.google.cloud.spanner.SpannerImpl.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.write(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'com.google.cloud.spanner.SessionPool.writeAtLeastOnce(Ljava/lang/Iterable;)Lcom/google/cloud/Timestamp;' OR 
end_point_fqm = 'weblogic.wsee.saaj.SOAPConnectionImpl.call(Ljavax/xml/soap/SOAPMessage;Ljava/lang/Object;)Ljavax/xml/soap/SOAPMessage;' OR 
end_point_fqm = 'java.util.concurrent.ForkJoinPool.forkOrSubmit(Ljava/util/concurrent/ForkJoinTask;)V' OR
end_point_fqm = 'java.util.concurrent.ForkJoinTask.fork()Ljava/util/concurrent/ForkJoinTask;' OR
end_point_fqm = 'java.util.concurrent.ForkJoinTask.doInvoke()I' OR
end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement' OR
end_point_fqm = 'oracle.jdbc.driver.OracleStatement' OR
end_point_fqm = 'org.apache.cxf.jaxrs.client.WebClient.prepareHeaders(Ljava/lang/Class;Ljava/lang/Object;)Ljavax/ws/rs/core/MultivaluedMap;' OR
end_point_fqm = 'org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;' OR
end_point_fqm = 'org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;' OR
end_point_fqm = 'java.net.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V' OR
end_point_fqm = 'java.net.HttpURLConnection.getInputStream()Ljava/io/InputStream;' OR
end_point_fqm = 'weblogic.net.http.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V' OR
end_point_fqm = 'weblogic.net.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;' OR
end_point_fqm = 'org.apache.commons.httpclient.HttpClient.executeMethod(Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/apache/commons/httpclient/HttpState;)I' OR
end_point_fqm = 'redis.clients.jedis.Protocol.process(Lredis/clients/util/RedisInputStream;)Ljava/lang/Object;' OR
end_point_fqm = 'redis.clients.jedis.Connection.sendCommand(Lredis/clients/jedis/Protocol$Command;[[B)Lredis/clients/jedis/Connection;' OR
end_point_fqm = 'org.apache.cxf.jaxrs.client.WebClient.doInvoke(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;)Ljavax/ws/rs/core/Response;' OR
end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper' OR
end_point_fqm = 'com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement' OR
end_point_fqm = 'com.ibm.ws.rsadapter.jdbc.WSJdbcStatement' OR
end_point_fqm = 'com.mysql.jdbc.PreparedStatement' OR
end_point_fqm = 'weblogic.jdbc.common.internal.RmiDataSource' OR
end_point_fqm = 'org.postgresql.jdbc.PgStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;' OR
end_point_fqm = 'org.postgresql.jdbc.PgStatement.execute(Lorg/postgresql/core/CachedQuery;Lorg/postgresql/core/ParameterList;I)V'
) 
AND profile_id=1 
);
+`
show_error

#Updating profile_enable = true of the given below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable = true WHERE entry_id IN 
(
SELECT entry_id FROM config_$CONTROLLER_NAME.service_entry_points WHERE 
(
entry_fqm = 'reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart()V' OR
entry_fqm = 'reactor.netty.http.server.HttpServerOperations.onInboundNext(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V' OR
entry_fqm = 'atg.servlet.pipeline.PipelineableServletImpl.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' OR
entry_fqm = 'atg.servlet.DynamoServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' OR
entry_fqm = 'atg.servlet.sessionsaver.SessionSaverServlet.service(Latg/servlet/DynamoHttpServletRequest;Latg/servlet/DynamoHttpServletResponse;)V' OR
entry_fqm = 'atg.servlet.pipeline.HeadPipelineServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' OR
entry_fqm = 'com.ibm.mq.jms.MQMessageConsumer.onMessage(Ljavax/jms/Message;)V' OR
entry_fqm = 'org.apache.activemq.ActiveMQMessageConsumer.dispatch(Lorg/apache/activemq/command/MessageDispatch;)V' OR
entry_fqm = 'org.springframework.batch.core.job.AbstractJob.execute(Lorg/springframework/batch/core/JobExecution;)V' OR
entry_fqm = 'org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(Ljavax/jms/Session;Ljavax/jms/Message;)V' OR
entry_fqm = 'org.springframework.batch.core.job.SimpleJob.doExecute(Lorg/springframework/batch/core/JobExecution;)V'
)
AND profile_id=1
);
+`
show_error

#Updating enable = false of the given below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'redis.clients.jedis.Jedis' OR
end_point_fqm = 'redis.clients.jedis.BinaryJedis'
)
AND profile_id=1
);
+`
show_error

#Delete the following fqm from tables.
Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
( 
end_point_fqm = 'com.lambdaworks.redis.RedisClient.connectStandalone(Lcom/lambdaworks/redis/codec/RedisCodec;Lcom/lambdaworks/redis/RedisURI;)Lcom/lambdaworks/redis/api/StatefulRedisConnection;' OR
end_point_fqm = 'PDO.prepare'
)
);
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_fqm IN ('com.lambdaworks.redis.RedisClient.connectStandalone(Lcom/lambdaworks/redis/codec/RedisCodec;Lcom/lambdaworks/redis/RedisURI;)Lcom/lambdaworks/redis/api/StatefulRedisConnection;','PDO.prepare');
+`
show_error

#Check backend_type_id 49 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 49;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X49" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (49,'HTTP_CALLOUT Backend','HTTP_CALLOUT','HTTP_CALLOUT','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,49,666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.curl_exec';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT Backend','.curl_exec','.curl_exec',49,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

 #Check key_name enableDBBackendName exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableDBBackendName';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableDBBackendName','0','1','2','0','pre-custom','4');
+`
show_error
   fi
 fi
 
 #Check key_name enableExecutorInterfaceCapturing exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableExecutorInterfaceCapturing';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableExecutorInterfaceCapturing','0','512','5','0%200','pre-custom','1');
+`
show_error
   fi
 fi

#Updating entry_type_name from UnderTowEntry to UNDERTOW.
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.entry_type set entry_type_name = 'UNDERTOW'  where entry_type_id = 16;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.undertow.server.Connectors.executeRootHandler(Lio/undertow/server/HttpHandler;Lio/undertow/server/HttpServerExchange;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM
config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','io.undertow.server.Connectors.executeRootHandler(Lio/undertow/server/HttpHandler;Lio/undertow/server/HttpServerExchange;)V','Connectors.executeRootHandler',16,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.undertow.servlet.spec.AsyncContextImpl.complete()V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM
config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','io.undertow.servlet.spec.AsyncContextImpl.complete()V','AsyncContextImpl.complete()',16,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.squareup.okhttp.Request$Builder.build()Lcom/squareup/okhttp/Request;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','com.squareup.okhttp.Request$Builder.build()Lcom/squareup/okhttp/Request;','Request$Builder.build()Request;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.squareup.okhttp.Call.execute()Lcom/squareup/okhttp/Response;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','com.squareup.okhttp.Call.execute()Lcom/squareup/okhttp/Response;','Call.execute()Response;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'okhttp3.Request$Builder.build()Lokhttp3/Request;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','okhttp3.Request$Builder.build()Lokhttp3/Request;','Request$Builder.build()Request;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'okhttp3.RealCall.execute()Lokhttp3/Response;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','okhttp3.RealCall.execute()Lokhttp3/Response;','RealCall.execute()Response;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

 #Check key_name enableCaptureSocketStackTrace exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableCaptureSocketStackTrace';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableCaptureSocketStackTrace','0','512','5','0%20100','normal','1');
+`
show_error
   fi
 fi
  
 #Check key_name enableCaptureDataOutsideTxn exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableCaptureDataOutsideTxn';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableCaptureDataOutsideTxn','0','512','5','0','normal','1');
+`
show_error
   fi
 fi

 #Check key_name enableMergeThreadCallouts exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableMergeThreadCallouts';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableMergeThreadCallouts','0','1','2','0','normal','1');
+`
show_error
   fi
 fi
  
 #Check key_name dumpThreadIdInSeqblob exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'dumpThreadIdInSeqblob';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'dumpThreadIdInSeqblob','0','1','2','0','normal','1');
+`
show_error
   fi
 fi

 #=====================Changes for supporting kafkap Entry end point for Java agent=============================
 #Check backend_type_id 50 exists in config_$CONTROLLER_NAME.backend_type table or not
 KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id =50 ;")
 MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
 if [ $? -eq 0 ]
 then
 if [ "X$KEY_ID" != "X50" ]
 then
 Error=` psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (50,'kafkap Backend','kafkap','kafkap','None','Java');
 INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,50,1,false,false,false);
+`
 show_error
 fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.kafka.clients.producer.internals.ProduceRequestResult.done()V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'kafkap Backend','org.apache.kafka.clients.producer.internals.ProduceRequestResult.done()V','ProduceRequestResult.done()V',50,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.kafka.clients.producer.KafkaProducer.<init>(Lorg/apache/kafka/clients/producer/ProducerConfig;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/clients/Metadata;Lorg/apache/kafka/clients/KafkaClient;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'kafkap Backend','org.apache.kafka.clients.producer.KafkaProducer.<init>(Lorg/apache/kafka/clients/producer/ProducerConfig;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/clients/Metadata;Lorg/apache/kafka/clients/KafkaClient;)V','KafkaProducer.<init>(ProducerConfig;Serializer;Serializer;Metadata;KafkaClient;)V',50,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.kafka.clients.producer.KafkaProducer.<init>(Ljava/util/Map;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/clients/producer/internals/ProducerMetadata;Lorg/apache/kafka/clients/KafkaClient;Lorg/apache/kafka/clients/producer/internals/ProducerInterceptors;Lorg/apache/kafka/common/utils/Time;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'kafkap Backend','org.apache.kafka.clients.producer.KafkaProducer.<init>(Ljava/util/Map;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/common/serialization/Serializer;Lorg/apache/kafka/clients/producer/internals/ProducerMetadata;Lorg/apache/kafka/clients/KafkaClient;Lorg/apache/kafka/clients/producer/internals/ProducerInterceptors;Lorg/apache/kafka/common/utils/Time;)V','KafkaProducer.<init>(Map;Serializer;Serializer;ProducerMetadata;KafkaClient;ProducerInterceptors;Time;)V',50,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi


#Updating end_point_desc and backend_type_id and enabled.
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.backend_points set end_point_desc = 'kafkap Backend', backend_type_id = 50 where end_point_fqm = 'org.apache.kafka.clients.producer.KafkaProducer.send(Lorg/apache/kafka/clients/producer/ProducerRecord;Lorg/apache/kafka/clients/producer/Callback;)Ljava/util/concurrent/Future;';
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
end_point_fqm = 'org.apache.kafka.clients.producer.KafkaProducer.send(Lorg/apache/kafka/clients/producer/ProducerRecord;Lorg/apache/kafka/clients/producer/Callback;)Ljava/util/concurrent/Future;'
AND profile_id=1
);
+`
show_error

#=====================Changes for supporting kafkac service entry for Java agent=============================
#Check backend_type_id 17 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =17;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X17" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (17, 'description', 'kafkac');
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.poll(J)Lorg/apache/kafka/clients/consumer/ConsumerRecords;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.poll(J)Lorg/apache/kafka/clients/consumer/ConsumerRecords;','KafkaConsumer.poll(J)ConsumerRecords;',17,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.poll(Ljava/time/Duration;)Lorg/apache/kafka/clients/consumer/ConsumerRecords;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.poll(Ljava/time/Duration;)Lorg/apache/kafka/clients/consumer/ConsumerRecords;','KafkaConsumer.poll(Duration;)ConsumerRecords;',17,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.<init>(Lorg/apache/kafka/clients/consumer/ConsumerConfig;Lorg/apache/kafka/common/serialization/Deserializer;Lorg/apache/kafka/common/serialization/Deserializer;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.<init>(Lorg/apache/kafka/clients/consumer/ConsumerConfig;Lorg/apache/kafka/common/serialization/Deserializer;Lorg/apache/kafka/common/serialization/Deserializer;)V','KafkaConsumer.<init>(ConsumerConfig;Deserializer;Deserializer;)V',17,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/time/Duration;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/time/Duration;)V','KafkaConsumer.commitSync(Duration;)V',17,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/util/Map;Ljava/time/Duration;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/util/Map;Ljava/time/Duration;)V','KafkaConsumer.commitSync(Map;Duration;)V',17,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.kafka.clients.consumer.KafkaConsumer.commitAsync(Ljava/util/Map;Lorg/apache/kafka/clients/consumer/OffsetCommitCallback;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.kafka.clients.consumer.KafkaConsumer.commitAsync(Ljava/util/Map;Lorg/apache/kafka/clients/consumer/OffsetCommitCallback;)V','KafkaConsumer.commitAsync(Map;OffsetCommitCallback;)V',17,false,'-','Java');
+`
show_error

Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

 #=====================Changes for supporting Custom Executor Entry end point for Java agent=============================
 #Check backend_type_id 51 exists in config_$CONTROLLER_NAME.backend_type table or not
 KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id =51 ;")
 MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
 if [ $? -eq 0 ]
 then
 if [ "X$KEY_ID" != "X51" ]
 then
 Error=` psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (51,'Custom Executor Backend','Custom Executor','CustomExecutor','None','Java');
 INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,51,1,false,false,false);
+`
 show_error
 fi
 fi

#=====================Changes for supporting kafkaCustom service entry for Java agent=============================
#Check backend_type_id 18 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =18;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X18" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (18, 'description', 'kafkaCustom');
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.service_entry_points ADD COLUMN argument_index bigint;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.restlet.engine.connector.HttpUrlConnectionCall.sendRequest(Lorg/restlet/Request;Lorg/restlet/Response;Lorg/restlet/Uniform;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','org.restlet.engine.connector.HttpUrlConnectionCall.sendRequest(Lorg/restlet/Request;Lorg/restlet/Response;Lorg/restlet/Uniform;)V','HttpUrlConnectionCall.sendRequest(Request;Response;Uniform;)V',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.datastax.oss.driver.api.core.CqlSession';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CASSANDRA end point','com.datastax.oss.driver.api.core.CqlSession','CqlSession : cassandraDB',12,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

 #Check key_name NDTryCatchInstrFilterList exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'NDTryCatchInstrFilterList';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'NDTryCatchInstrFilterList','1','1024','6','NA','normal','1');
+`
show_error
   fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.undertow.servlet.spec.ServletOutputStreamImpl.write([BII)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','io.undertow.servlet.spec.ServletOutputStreamImpl.write([BII)V','ServletOutputStreamImpl.write([BII)V',14,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.undertow.servlet.spec.ServletPrintWriter.write([CII)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','io.undertow.servlet.spec.ServletPrintWriter.write([CII)V','ServletPrintWriter.write([CII)V',14,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN show_all_bt varchar(4096)
+`
show_error

#Updating enable = false of the given below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'java.lang.Throwable.<init>()V' OR
end_point_fqm = 'java.lang.Throwable.<init>(Ljava/lang/String;)V' OR
end_point_fqm = 'java.lang.Throwable.<init>(Ljava/lang/Throwable;)V' OR
end_point_fqm = 'java.lang.Throwable.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V'
)
AND profile_id=1
);
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V','CoyoteAdapter_service',6,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.valves.AbstractAccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.catalina.valves.AbstractAccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V','AbstractAccessLogValve.invoke',8,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Insert a column operation in naming_rule_profile_backendtype_asso
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso add COLUMN operation boolean;
+`
show_error

#Check backend_type_id 52 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 52;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X52" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (52,'LDAP Backend','LDAP','LDAPCallout','LDAP','Java');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid,operation) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,52,1,false,false,false,false);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.modify(Ljava/lang/String;[I[Ljavax/naming/directory/Attribute;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.modify(Ljava/lang/String;[I[Ljavax/naming/directory/Attribute;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.modify(String;Attribute;Control;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error

Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.add(Lcom/sun/jndi/ldap/LdapEntry;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.add(Lcom/sun/jndi/ldap/LdapEntry;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.add(LdapEntry;Control;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.delete(Ljava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.delete(Ljava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.delete(String;Control;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.moddn(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.moddn(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.moddn(String;String;String;Control;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.compare(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.compare(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljavax/naming/ldap/Control;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.compare(String;String;String;Control;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.extendedOp(Ljava/lang/String;[B[Ljavax/naming/ldap/Control;Z)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.extendedOp(Ljava/lang/String;[B[Ljavax/naming/ldap/Control;Z)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.extendedOp(String;Control;Z)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.authenticate(ZLjava/lang/String;Ljava/lang/Object;ILjava/lang/String;[Ljavax/naming/ldap/Control;Ljava/util/Hashtable;)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.authenticate(ZLjava/lang/String;Ljava/lang/Object;ILjava/lang/String;[Ljavax/naming/ldap/Control;Ljava/util/Hashtable;)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.authenticate(String;Object;String;Control;Hashtable;)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.sun.jndi.ldap.LdapClient.search(Ljava/lang/String;IIIIZ[Ljava/lang/String;Ljava/lang/String;I[Ljavax/naming/ldap/Control;Ljava/util/Hashtable;ZI)Lcom/sun/jndi/ldap/LdapResult;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'LDAP Backend','com.sun.jndi.ldap.LdapClient.search(Ljava/lang/String;IIIIZ[Ljava/lang/String;Ljava/lang/String;I[Ljavax/naming/ldap/Control;Ljava/util/Hashtable;ZI)Lcom/sun/jndi/ldap/LdapResult;','LdapClient.search(String;String;String;Control;Hashtable;ZI)Lcom/sun/jndi/ldap/LdapResult;',52,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.jaxws.JaxwsClientCallback.handleResponse(Ljava/util/Map;[Ljava/lang/Object;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.jaxws.JaxwsClientCallback.handleResponse(Ljava/util/Map;[Ljava/lang/Object;)V','JaxwsClientCallback.handleResponse(Map;Object;)V',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.endpoint.ClientImpl.doInvoke(Lorg/apache/cxf/endpoint/ClientCallback;Lorg/apache/cxf/service/model/BindingOperationInfo;[Ljava/lang/Object;Ljava/util/Map;Lorg/apache/cxf/message/Exchange;)[Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.endpoint.ClientImpl.doInvoke(Lorg/apache/cxf/endpoint/ClientCallback;Lorg/apache/cxf/service/model/BindingOperationInfo;[Ljava/lang/Object;Ljava/util/Map;Lorg/apache/cxf/message/Exchange;)[Ljava/lang/Object;','ClientImpl.doInvoke(ClientCallback;BindingOperationInfo;Object;Map;Exchange;)[Ljava/lang/Object;',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.jaxrs.client.JaxrsClientCallback.handleResponse(Ljava/util/Map;[Ljava/lang/Object;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.jaxrs.client.JaxrsClientCallback.handleResponse(Ljava/util/Map;[Ljava/lang/Object;)V','JaxrsClientCallback.handleResponse(Map;Object;)V',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.jaxrs.client.WebClient.doInvokeAsync(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljavax/ws/rs/client/InvocationCallback;)Ljava/util/concurrent/Future;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.jaxrs.client.WebClient.doInvokeAsync(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljava/lang/Class;Ljava/lang/reflect/Type;Ljavax/ws/rs/client/InvocationCallback;)Ljava/util/concurrent/Future;','WebClient.doInvokeAsync(String;Object;Class;Type;Class;Type;InvocationCallback;)Ljava/util/concurrent/Future;',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.jaxrs.client.JaxrsClientCallback.handleException(Ljava/util/Map;Ljava/lang/Throwable;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.jaxrs.client.JaxrsClientCallback.handleException(Ljava/util/Map;Ljava/lang/Throwable;)V','JaxrsClientCallback.handleException(Map;Throwable;)V',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.cxf.jaxws.JaxwsClientCallback.handleException(Ljava/util/Map;Ljava/lang/Throwable;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Async HTTP Backend','org.apache.cxf.jaxws.JaxwsClientCallback.handleException(Ljava/util/Map;Ljava/lang/Throwable;)V','JaxwsClientCallback.handleException(Map;Throwable;)V',1,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

Error=` psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'CASSANDRA' where  backend_type_id = 12;
DELETE from config_$CONTROLLER_NAME.profile_backend_point_asso where end_point_id in (select end_point_id from config_$CONTROLLER_NAME.backend_points where agent = 'Dot Net' AND backend_type_id = 43 AND custom_entry = false);
DELETE from config_$CONTROLLER_NAME.backend_points where agent = 'Dot Net' AND backend_type_id = 43 AND custom_entry = false;
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_entrypointsfile = 'CUSTOM_CALLOUT'  WHERE backend_type_id = 43;
+`
show_error

#Add constraints for below tables
Error=` psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.nde_routing_rules ADD CONSTRAINT UQ_NDEID UNIQUE (nde_id);
ALTER TABLE config_$CONTROLLER_NAME.nde_cluster_config ADD CONSTRAINT UQ_NAME UNIQUE (name);
ALTER TABLE config_$CONTROLLER_NAME.application ADD CONSTRAINT UQ_APP_NAME UNIQUE (app_name);
ALTER TABLE config_$CONTROLLER_NAME.profile ADD CONSTRAINT UQ_PROF_NAME UNIQUE (profile_name);
ALTER TABLE config_$CONTROLLER_NAME.auto_injection_policy_rule ADD CONSTRAINT UQ_RULE_NAME_PROF_ID UNIQUE (rule_name, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.auto_injection_tag_rule ADD CONSTRAINT UQ_AITR_RULE_NAME_PROF_ID UNIQUE (rule_name, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.advance_exception_filter ADD CONSTRAINT UQ_ADV_EXC_PTRN_PROF_ID UNIQUE (advanceexception_pattern, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.error_detection ADD CONSTRAINT UQ_ED_RULE_NAME_PROF_ID UNIQUE (rule_name, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ADD CONSTRAINT UQ_METHOD_NAME_PROF_ID UNIQUE (method_name, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.exception_monitors ADD CONSTRAINT UQ_EXCEPTION_NAME_PROF_ID UNIQUE (exception_name, profile_id);
ALTER TABLE config_$CONTROLLER_NAME.http_stats_condition ADD CONSTRAINT UQ_CONDITION_NAME_PROF_ID UNIQUE (condition_name, profile_id);
+`
show_error

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'SampleApplication.Form1.button1_Click';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','SampleApplication.Form1.button1_Click','Form1.button1_Click', 6,false,'SampleApplication.exe','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi
	
#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'SampleApplication.Form4.button1_Click';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','SampleApplication.Form4.button1_Click','Form4.button1_Click', 6,false,'SampleApplication.exe','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi
	
#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'SampleApplication.Form6.button1_Click';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','SampleApplication.Form6.button1_Click','Form6.button1_Click', 6,false,'SampleApplication.exe','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi
	
#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'SampleApplication.Form1.Exception_Level1_Click';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','SampleApplication.Form1.Exception_Level1_Click','FForm1.Exception_Level1_Click', 6,false,'SampleApplication.exe','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi
	
#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'SampleApplication.Form1.Exception_Level2_Click';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES
($(($MAX_ID + 1)),' ','SampleApplication.Form1.Exception_Level2_Click','Form1.Exception_Level2_Click', 6,false,'SampleApplication.exe','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)), false, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi

#Check backend_type_id 53 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 53;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X53" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (53,'JdkHttpClient Backend','JdkHttpClient','JdkHttpClient','-','Java');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid,operation) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,53,1,false,false,false,false);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.protocol.http.HttpURLConnection';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDK HTTP Client Backend','sun.net.www.protocol.http.HttpURLConnection','sun.net.www.protocol.http.HttpURLConnection',53,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDK HTTP Client Backend','sun.net.www.http.HttpClient','sun.net.www.http.HttpClient',53,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'weblogic.net.http.HttpURLConnection';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDK HTTP Client Backend','weblogic.net.http.HttpURLConnection','weblogic.net.http.HttpURLConnection',53,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'weblogic.net.http.HttpClient';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDK HTTP Client Backend','weblogic.net.http.HttpClient','weblogic.net.http.HttpClient',53,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.write([BII)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
	then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.write([BII)V','HttpOutputStreamImpl.write([BII)V',14,false,'-','Java');
+`
show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'ch.qos.logback.classic.spi.LoggingEvent.<init>()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','ch.qos.logback.classic.spi.LoggingEvent.<init>()V','Logback: ch.qos.logback.classic.spi.LoggingEvent.<init>()V',22,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V','Log4j1: org.apache.log4j.spi.LoggingEvent.<init>(String,Category,Priority,Object,Throwable)',22,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;JLorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;JLorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V','Log4j1: org.apache.log4j.spi.LoggingEvent.<init>(String,Category,JPriority,Object,Throwable)',22,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;JLorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/String;Lorg/apache/log4j/spi/ThrowableInformation;Ljava/lang/String;Lorg/apache/log4j/spi/LocationInfo;Ljava/util/Map;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','org.apache.log4j.spi.LoggingEvent.<init>(Ljava/lang/String;Lorg/apache/log4j/Category;JLorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/String;Lorg/apache/log4j/spi/ThrowableInformation;Ljava/lang/String;Lorg/apache/log4j/spi/LocationInfo;Ljava/util/Map;)V','Log4j1: org.apache.log4j.spi.LoggingEvent.<init>(String,Category,JLevel,Object,String,ThrowableInformation,String,LocationInfo,Map)',22,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(Ljava/lang/String;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/message/Message;Ljava/util/List;Ljava/lang/Throwable;)Lorg/apache/logging/log4j/core/LogEvent;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(Ljava/lang/String;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/message/Message;Ljava/util/List;Ljava/lang/Throwable;)Lorg/apache/logging/log4j/core/LogEvent;','Log4j2: org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(String,Marker,String,Level,Message,List,Throwable)LogEvent',22,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(Ljava/lang/String;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/StackTraceElement;Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/message/Message;Ljava/util/List;Ljava/lang/Throwable;)Lorg/apache/logging/log4j/core/LogEvent;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(Ljava/lang/String;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/StackTraceElement;Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/message/Message;Ljava/util/List;Ljava/lang/Throwable;)Lorg/apache/logging/log4j/core/LogEvent;','Log4j2: org.apache.logging.log4j.core.impl.ReusableLogEventFactory.createEvent(String,Marker,String,StackTraceElement,Level,Message,List,Throwable)LogEvent',22,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Updating enable = true of the given below FQM
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = true WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'com.ibm' 
)
AND profile_id=1
);
+`
show_error

#=====================Changes for supporting jettyEntry service entry for Java agent=============================
#Check backend_type_id 19 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =19;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" != "X19" ]
	then
	Error=` psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (19, 'description', 'jettyEntry');
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.eclipse.jetty.server.handler.HandlerWrapper.handle(Ljava/lang/String;Lorg/eclipse/jetty/server/Request;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
	then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.eclipse.jetty.server.handler.HandlerWrapper.handle(Ljava/lang/String;Lorg/eclipse/jetty/server/Request;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','HandlerWrapper.handle(String;Request;HttpServletRequest;HttpServletResponse;)V',19,false,'-','Java');
+`
	show_error

	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check backend_type_id 20 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =20;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" != "X20" ]
	then
	Error=` psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (20, 'description', 'SpringWebFlux');
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.web.reactive.DispatcherHandler';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.springframework.web.reactive.DispatcherHandler','org.springframework.web.reactive.DispatcherHandler',20,false,'-','Java');
+`
        show_error

        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.quartz.simpl.SimpleThreadPool.runInThread(Ljava/lang/Runnable;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Executor Backend','org.quartz.simpl.SimpleThreadPool.runInThread(Ljava/lang/Runnable;)Z','SimpleThreadPool.runInThread(Runnable;)Z',51,false,'-','Java');
+`
	show_error

	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.mongodb.async.client.MongoCollectionImpl';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO end point','com.mongodb.async.client.MongoCollectionImpl','com.mongodb.async.client.MongoCollectionImpl : mongoDB',11,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'COPY_PROFILES_INSIDE_TEST';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")

 if [ $? -eq 0 ]
 then
   #if keyword does not exist then insert that row in table
   if [ "X$KEY_ID" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'COPY_PROFILES_INSIDE_TEST','','','2 60','2 60','')
+`
show_error
   fi
 fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDC_DELAY_START_INSTRUMENTATION';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")

if [ $? -eq 0 ]
then
	#if keyword does not exist then insert that row in table
	if [ "X$KEY_ID" == "X" ]
	then
	Error=` psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value,ndc_key_val,ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDC_DELAY_START_INSTRUMENTATION','','','0 60s','0 60s','')
+`
show_error
	fi
fi

#Support for HOST,PORT,TOPIC in Kafka backendNamingRule file
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'KAFKA' where  backend_type_id = 50;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true WHERE backend_type_id = 50;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.ibm.ws.http.logging.internal.LoggerOffThread.log(Lcom/ibm/wsspi/bytebuffer/WsByteBuffer;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Log end point','com.ibm.ws.http.logging.internal.LoggerOffThread.log(Lcom/ibm/wsspi/bytebuffer/WsByteBuffer;)Z','LoggerOffThread.log(WsByteBuffer;)Z',13,false,'-','Java');
+`
        show_error

        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'ch.qos.logback.classic.spi.LoggingEvent.<init>(Ljava/lang/String;Lch/qos/logback/classic/Logger;Lch/qos/logback/classic/Level;Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V' AND backend_type_id = 22;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Log Backend','ch.qos.logback.classic.spi.LoggingEvent.<init>(Ljava/lang/String;Lch/qos/logback/classic/Logger;Lch/qos/logback/classic/Level;Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V','LoggingEvent.<init>(String;Logger;Level;String;Throwable;Object;)V',22,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.ReactorClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.http.client.reactive.ReactorClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','ReactorClientHttpConnector.connect(HttpMethod;URI;Function;)Mono;',1,false,'-','Java');
+`
        show_error

        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.solr.client.solrj.SolrRequest.process(Lorg/apache/solr/client/solrj/SolrClient;)Lorg/apache/solr/client/solrj/SolrResponse;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Backend end point','org.apache.solr.client.solrj.SolrRequest.process(Lorg/apache/solr/client/solrj/SolrClient;)Lorg/apache/solr/client/solrj/SolrResponse;','SolrRequest.process(SolrClient;)SolrResponse;',9,false,'-','Java');
+`
        show_error

        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.solr.client.solrj.SolrRequest.process(Lorg/apache/solr/client/solrj/SolrClient;Ljava/lang/String;)Lorg/apache/solr/client/solrj/SolrResponse;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Backend end point','org.apache.solr.client.solrj.SolrRequest.process(Lorg/apache/solr/client/solrj/SolrClient;Ljava/lang/String;)Lorg/apache/solr/client/solrj/SolrResponse;','SolrRequest.process(SolrClient;String;)SolrResponse;',9,false,'-','Java');
+`
        show_error

        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check backend_type_id 54 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 54;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" != "X54" ]
	then
	Error=` psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (54,'Dynamo DB Backend','Dynamo','dynamoDB','-','Java');
	INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid,operation) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,54,1,false,false,false,false);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(Lcom/amazonaws/Request;Lcom/amazonaws/http/HttpResponseHandler;Lcom/amazonaws/http/ExecutionContext;Ljava/net/URI;Ljava/net/URI;)Lcom/amazonaws/Response;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Dynamo DB Backend','com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(Lcom/amazonaws/Request;Lcom/amazonaws/http/HttpResponseHandler;Lcom/amazonaws/http/ExecutionContext;Ljava/net/URI;Ljava/net/URI;)Lcom/amazonaws/Response;','AmazonDynamoDBClient.doInvoke(Request;HttpResponseHandler;ExecutionContext;URI;URI;)Response',54,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.logging.Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Error Log Backend','java.util.logging.Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V','Logger.logp(Level;String;String;Throwable;Supplier)',14,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.logging.Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Error Log Backend','java.util.logging.Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V','Logger.logrb(Level;String;String;String;String;Throwable;)',14,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.logging.Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/util/ResourceBundle;Ljava/lang/String;Ljava/lang/Throwable;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Error Log Backend','java.util.logging.Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/util/ResourceBundle;Ljava/lang/String;Ljava/lang/Throwable;)V','Logger.logrb(Level;String;String;ResourceBundle;String;Throwable)',14,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.logging.Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Error Log Backend','java.util.logging.Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V','Logger.logp(Level;String;String;String;Throwable)',14,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.util.logging.Logger.log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Custom Error Log Backend','java.util.logging.Logger.log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V','Logger.log(Level;String;Throwable)',14,false,'-','Java');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Insert this keyword to append path in ndsettings.txt file for NodeJS agent.
#Check key_name enableIPForNodeJS exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableIPForNodeJS';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
	#if key_name does not exist then insert that row in table
	if [ "X$KEY_NAME" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableIPForNodeJS','0','1','1','0','normal','777777');
+`
	show_error
	fi
fi

#Check backend_type_id 55 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 55;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" != "X55" ]
        then
        Error=` psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (55,'Socket Callout','Socket Callout','SocketCallout','SOCKETCALLOUT','Java');
        INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid,operation) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,55,1,false,false,false,false);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.valves.AccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'','org.apache.catalina.valves.AccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V','AccessLogValve.invoke(Request;Response;)V',8,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check key_name enableMDCLogMsgForNF exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableMDCLogMsgForNF';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
        #if key_name does not exist then insert that row in table
        if [ "X$KEY_NAME" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableMDCLogMsgForNF','0','1','2','0','normal','1');
+`
        show_error
        fi
fi

#Check key_name threadCalloutDepth exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'threadCalloutDepth';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
        #if key_name does not exist then insert that row in table
        if [ "X$KEY_NAME" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'threadCalloutDepth','0','9999','2','0','pre-custom','1');
+`
        show_error
        fi
fi

#Check key_name enableChildFPFilter exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableChildFPFilter';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
        #if key_name does not exist then insert that row in table
        if [ "X$KEY_NAME" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableChildFPFilter','0','30000','4','0','normal','1');
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.http.server.reactive.AbstractServerHttpResponse';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'EntryPoint to capture transaction flow for Spring Webflux.','org.springframework.http.server.reactive.AbstractServerHttpResponse','AbstractServerHttpResponse',20,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'com.rabbitmq.client.impl.ConsumerDispatcher.handleDelivery(Lcom/rabbitmq/client/Consumer;Ljava/lang/String;Lcom/rabbitmq/client/Envelope;Lcom/rabbitmq/client/AMQP$BasicProperties;[B)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'EntryPoint to capture transaction flow for JMS.','com.rabbitmq.client.impl.ConsumerDispatcher.handleDelivery(Lcom/rabbitmq/client/Consumer;Ljava/lang/String;Lcom/rabbitmq/client/Envelope;Lcom/rabbitmq/client/AMQP$BasicProperties;[B)V','ConsumerDispatcher.handleDelivery(Consumer;String;Envelope;AMQP$BasicProperties;[B)V',7,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check backend_type_id 21 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id = 21;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" != "X21" ]
        then
        Error=` psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (21, 'description', 'NETTY');
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Ljava/lang/Object;)Lio/netty/channel/ChannelHandlerContext;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Ljava/lang/Object;)Lio/netty/channel/ChannelHandlerContext;','AbstractChannelHandlerContext.fireChannelRead(Object;)ChannelHandlerContext;',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;','AbstractChannelHandlerContext.writeAndFlush(Object;ChannelPromise;)ChannelFuture;',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.channel.AbstractChannelHandlerContext.write(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;','AbstractChannelHandlerContext.write(Object;ChannelPromise;)ChannelFuture;',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V','HttpObjectEncoder.encode(ChannelHandlerContext;Object;List;)V',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.channel.DefaultChannelPipeline.close(Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.channel.DefaultChannelPipeline.close(Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;','DefaultChannelPipeline.close(ChannelPromise;)ChannelFuture;',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'io.netty.channel.DefaultChannelPipeline.close()Lio/netty/channel/ChannelFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture TCP or HTTP transaction for Netty server.','io.netty.channel.DefaultChannelPipeline.close()Lio/netty/channel/ChannelFuture;','DefaultChannelPipeline.close()ChannelFuture;',21,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'com.cavisson.nsecom.SimpleConsumer.processRecord(Lorg/apache/kafka/clients/consumer/ConsumerRecord;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture kafka custom for kafka consumer records.','com.cavisson.nsecom.SimpleConsumer.processRecord(Lorg/apache/kafka/clients/consumer/ConsumerRecord;)V','SimpleConsumer.processRecord(ConsumerRecord;)V',18,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDP_SQL_QUERY_SIMILARITY_PERCENTAGE';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
if [ $? -eq 0 ]
then
        #if keyword does not exist then insert that row in table
        if [ "X$KEY_ID" == "X" ]
        then
        Error=` psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value, ndc_key_val, ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDP_SQL_QUERY_SIMILARITY_PERCENTAGE','','','0 90.0','0 90.0','')
+`
show_error
        fi
fi

#updating backend_type_id and enable for below FQMs.
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.backend_points SET end_point_desc = 'Socket Callout', backend_type_id = 55 WHERE end_point_fqm in  ('java.net.Socket.connect(Ljava/net/SocketAddress;)V', 'java.net.Socket.connect(Ljava/net/SocketAddress;I)V');

UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN 
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE 
(
end_point_fqm = 'java.net.Socket.connect(Ljava/net/SocketAddress;)V' OR
end_point_fqm = 'java.net.Socket.connect(Ljava/net/SocketAddress;I)V' OR
end_point_fqm = 'com.rabbitmq.client.impl.AMQChannel.transmit(Lcom/rabbitmq/client/Method;)V' OR
end_point_fqm = 'org.apache.openjpa.kernel.DelegatingQuery.execute()Ljava/lang/Object;' OR
end_point_fqm = 'org.apache.openjpa.kernel.DelegatingQuery.execute(Ljava/util/Map;)Ljava/lang/Object;' OR
end_point_fqm = 'org.apache.openjpa.kernel.DelegatingQuery.execute([Ljava/lang/Object;)Ljava/lang/Object;'
)
AND profile_id=1 
);

Update config_$CONTROLLER_NAME.ndc_keywords SET ndc_def_value = '1 1 1 1 1 1 1 1 1 1', ndc_key_val = '1 1 1 1 1 1 1 1 1 1' WHERE ndc_key_id = 86;
+`
show_error

#updating backend_type_detail for below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type 
SET backend_type_detail = 
    CASE backend_type_name  
    	WHEN 'HTTP'  THEN 'Entry Point to capture calls for HTTP backend.' 
    	WHEN 'Web Services' THEN 'Entry Point to capture calls for Web Service.'
    	WHEN 'JDBC' THEN 'Entry Point to capture JDBC Calls.'
	WHEN 'Coherence' THEN 'Entry Point to capture Coherence cache call.'
	WHEN 'RMI' THEN 'Entry Point to capture DB Connection Calls.'
	WHEN 'Mem Cache' THEN 'Entry Point to capture calls for Mem cache HTTP backend.'
	WHEN 'Cloudant' THEN 'Entry Point to capture calls for Cloudant DB.'
	WHEN 'Hadoop' THEN 'Entry Point to capture calls for Hadoop.'
	WHEN 'Custom'  THEN 'Entry Point to capture Custom Calls.' 
    	WHEN 'Redis' THEN 'Entry Point to capture Redis DB Calls.'
    	WHEN 'Mongo' THEN 'Entry Point to capture Mongo DB Calls.'
	WHEN 'Cassandra' THEN 'Entry Point to capture Cassandra DB Calls.'
	WHEN 'Custom Log' THEN 'Entry Point for Custom Logging.'
	WHEN 'Custom Error Log' THEN 'Entry Point to capture Custom Error logs.'
	WHEN 'Thread' THEN 'Entry Point to capture Thread call.'
	WHEN 'Cloudant NoSQL' THEN 'Entry Point to capture Cloudant DB calls.'
	WHEN 'Big Table' THEN 'Entry Point to capture Bigtable DB calls.'
	WHEN 'Log' THEN 'Entry Point to Process Logs.'
	WHEN 'Exception' THEN 'Entry Point to capture Exceptions.'
	WHEN 'XATransaction' THEN 'Entry Point for XATransaction.'
	WHEN 'Neo4j DB Callout' THEN 'Entry Point to capture Neo4j DB calls.'
	WHEN 'JMS' THEN 'Entry Point to capture JMS calls.'
	WHEN 'FTP' THEN 'Entry Point to capture FTP calls.'
	WHEN 'Spanner' THEN 'Entry Point to capture Spanner DB calls.'
	WHEN 'Advance Custom' THEN 'Entry Point to capture Custom calls with some custom info from FQM.'
	WHEN 'kafkap' THEN 'Entry Point to capture Kafka calls.'
	WHEN 'Custom Executor' THEN 'Entry Point to capture Custom Implementation of Executor.'
	WHEN 'LDAP' THEN 'Entry Point to capture LDAP Calls.'
	WHEN 'JdkHttpClient' THEN 'Entry Point to capture calls for HTTP backend.'
	WHEN 'Dynamo' THEN 'Entry Point to capture Dynamo DB calls.'
	WHEN 'Microsoft SQL' THEN 'Entry Point to capture Microsoft SQL calls.'
	WHEN 'Socket Callout' THEN 'Entry Point to capture Socket Calls.'
	WHEN 'Async_Call' THEN 'Entry Point to capture Async Calls.'
	WHEN 'SQL' THEN 'Entry Point to capture SQL Calls.'
	WHEN 'SQL_CALLOUT' THEN 'Entry Point to capture SQL Calls.'
	WHEN 'MONGO_DB' THEN 'Entry Point to capture Mongo DB Calls.'
	WHEN 'COUCHBASE_DB' THEN 'Entry Point to capture Couchbase DB Calls.'
	WHEN 'HTTP_CALLOUT' THEN 'Entry Point to capture calls for HTTP backend.'
	WHEN 'Http_Request' THEN 'Entry Point to capture calls for HTTP Request backend.'
	WHEN 'Winston' THEN 'Entry Point to capture calls for Winston.'
	WHEN 'Console' THEN 'Entry Point to capture calls for Console.'
	WHEN 'Postgresql' THEN 'Entry Point to capture Postgresql DB calls.'
	WHEN 'Zookeeper' THEN 'Entry Point to capture Zookeeper calls.'
	WHEN 'MemCache' THEN 'Entry Point to capture MemCache calls.'
    END
WHERE backend_type_name in ('HTTP','Web Services','JDBC','Coherence','RMI','Mem Cache','Cloudant','Hadoop','Custom','Redis','Mongo','Cassandra','Custom Log','Custom Error Log','Thread','Cloudant NoSQL','Big Table','Log','Exception','XATransaction','Neo4j DB Callout','JMS','FTP','Spanner','Advance Custom','kafkap','Custom Executor','LDAP','JdkHttpClient','Dynamo','Microsoft SQL','Socket Callout','Async_Call','SQL','SQL_CALLOUT','MONGO_DB','COUCHBASE_DB','HTTP_CALLOUT','Http_Request','Winston','Console','Postgresql','Zookeeper','MemCache');
+`
show_error

#updating entry_desc for below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.service_entry_points 
SET entry_desc = 
    CASE entry_fqm  
    	WHEN 'javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V'  THEN 'Entry Point to capture transaction flow for Servlet.' 
    	WHEN 'org.springframework.web.filter.OncePerRequestFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V' THEN 'Entry Point to capture transaction flow for Spring Boot.'
    	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.doPut(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.doDelete(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.doOptions(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'com.tibco.plugin.share.http.servlet.BwServlet.a(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V' THEN 'Entry Point to capture transaction flow for TIBCO.'
	WHEN 'org.eclipse.jetty.servlet.ServletHandler.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for Spring Boot.'
	WHEN 'weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for Weblogic.'
	WHEN 'weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for IBM.'
	WHEN 'com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for IBM.'
	WHEN 'com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lcom/ibm/ws/webcontainer/webapp/WebAppServletInvocationEvent;)V' THEN 'Entry Point to capture transaction flow for IBM.'
	WHEN 'com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for IBM.'
	WHEN 'org.apache.jasper.runtime.HttpJspBase.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for Apache Jasper.'
	WHEN 'org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for JBOSS.'
	WHEN 'org.apache.catalina.valves.AbstractAccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V' THEN 'Entry Point to capture transaction flow for JBOSS.'
	WHEN 'weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for Weblogic.'
	WHEN 'com.caucho.hessian.server.HessianServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for Hessian.'
	WHEN 'org.apache.activemq.ActiveMQMessageConsumer.dispatch(Lorg/apache/activemq/command/MessageDispatch;)V' THEN 'Entry Point to capture JMS calls (Active MQ).'
	WHEN 'com.ibm.mq.jms.MQMessageConsumer.onMessage(Ljavax/jms/Message;)V' THEN 'Entry Point to capture transaction flow for JMS.'
	WHEN 'org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(Ljavax/jms/Session;Ljavax/jms/Message;)V' THEN 'Entry Point to capture transaction flow for JMS.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.<init>(Lorg/apache/kafka/clients/consumer/ConsumerConfig;Lorg/apache/kafka/common/serialization/Deserializer;Lorg/apache/kafka/common/serialization/Deserializer;)V' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.poll(Ljava/time/Duration;)Lorg/apache/kafka/clients/consumer/ConsumerRecords;' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.poll(J)Lorg/apache/kafka/clients/consumer/ConsumerRecords;' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/time/Duration;)V' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/util/Map;Ljava/time/Duration;)V' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'org.apache.kafka.clients.consumer.KafkaConsumer.commitAsync(Ljava/util/Map;Lorg/apache/kafka/clients/consumer/OffsetCommitCallback;)V' THEN 'Entry Point to capture transaction flow for Kafka Consumer.'
	WHEN 'com.sun.jersey.spi.container.servlet.WebComponent.service(Ljava/net/URI;Ljava/net/URI;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)I' THEN 'Entry Point to capture transaction flow for Jersey.'
	WHEN 'org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V' THEN 'Entry Point to Inject NetVision (UX Monitoring) Tag (Tomcat).'
	WHEN 'weblogic.servlet.internal.ChunkOutputWrapper.write([BII)V' THEN 'Entry Point to Inject NetVision (UX Monitoring) Tag (Weblogic).'
	WHEN 'io.undertow.servlet.spec.ServletOutputStreamImpl.write([BII)V' THEN 'Entry Point to Inject NetVision (UX Monitoring) Tag(JBoss(Wildfly).'
	WHEN 'io.undertow.servlet.spec.ServletPrintWriter.write([CII)V' THEN 'Entry Point to Inject NetVision (UX Monitoring) Tag (JBoss(Wildfly)).'
	WHEN 'com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.write([BII)V' THEN 'Entry Point to Inject NetVision (UX Monitoring) Tag (Websphere(Liberty)).'
	WHEN 'io.undertow.servlet.handlers.ServletHandler.handleRequest(Lio/undertow/server/HttpServerExchange;)V' THEN 'Entry Point to capture transaction flow for UnderTow.'
	WHEN 'io.undertow.server.Connectors.executeRootHandler(Lio/undertow/server/HttpHandler;Lio/undertow/server/HttpServerExchange;)V' THEN 'Entry Point to capture transaction flow for UnderTow.'
	WHEN 'io.undertow.servlet.spec.AsyncContextImpl.complete()V' THEN 'Entry Point to capture transaction flow for UnderTow.'
	WHEN 'org.glassfish.jersey.servlet.ServletContainer.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for Jersey.'
	WHEN 'org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V' THEN 'Entry Point to capture transaction flow for Tomcat.'
	WHEN 'org.springframework.batch.core.job.SimpleJob.doExecute(Lorg/springframework/batch/core/JobExecution;)V' THEN 'Entry Point to capture transaction flow for Spring Batch job.'
	WHEN 'org.eclipse.jetty.server.handler.HandlerWrapper.handle(Ljava/lang/String;Lorg/eclipse/jetty/server/Request;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for Jetty.'
	WHEN 'org.springframework.web.reactive.DispatcherHandler' THEN 'Entry Point to capture transaction flow for Spring Webflux.'
	WHEN 'atg.servlet.pipeline.PipelineableServletImpl.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for ATG.'
	WHEN 'atg.servlet.DynamoServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V' THEN 'Entry Point to capture transaction flow for ATG.'
	WHEN 'atg.servlet.sessionsaver.SessionSaverServlet.service(Latg/servlet/DynamoHttpServletRequest;Latg/servlet/DynamoHttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for ATG.'
	WHEN 'atg.servlet.pipeline.HeadPipelineServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V' THEN 'Entry Point to capture transaction flow for ATG.'
	WHEN 'reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart()V' THEN 'Entry Point to capture transaction flow for Netty.'
	WHEN 'reactor.netty.http.server.HttpServerOperations.onInboundNext(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V' THEN 'Entry Point to capture transaction flow for Netty.'
	WHEN 'org.springframework.batch.core.job.AbstractJob.execute(Lorg/springframework/batch/core/JobExecution;)V' THEN 'Entry Point to capture transaction flow for Spring Batch job.'
	WHEN 'org.apache.catalina.valves.AccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V' THEN 'Entry Point to capture transaction flow for JBOSS.'
	WHEN 'System.Web.HttpRuntime.ProcessRequestNotificationPrivate' THEN 'Entry Point for IIS based Application.'
	WHEN 'System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper' THEN 'Entry Point for IIS based Application.'
	WHEN 'System.Web.HttpRuntime.FinishPipelineRequest' THEN 'Entry Point for IIS based Application.'
	WHEN 'System.Web.HttpRuntime.FinishRequest' THEN 'Entry Point for IIS based Application.'
	WHEN 'SampleApplication.Form1.button1_Click' THEN 'Entry Point for Desktop Application.'
	WHEN 'SampleApplication.Form4.button1_Click' THEN 'Entry Point for Desktop Application.'
	WHEN 'SampleApplication.Form6.button1_Click' THEN 'Entry Point for Desktop Application.'
	WHEN 'SampleApplication.Form1.Exception_Level1_Click' THEN 'Entry Point for Desktop Application.'
	WHEN 'SampleApplication.Form1.Exception_Level2_Click' THEN 'Entry Point for Desktop Application.'
	WHEN 'com.rabbitmq.client.impl.ConsumerDispatcher.handleDelivery(Lcom/rabbitmq/client/Consumer;Ljava/lang/String;Lcom/rabbitmq/client/Envelope;Lcom/rabbitmq/client/AMQP$BasicProperties;[B)V' THEN 'Entry Point to capture transaction flow for JMS.'
	WHEN 'org.springframework.http.server.reactive.AbstractServerHttpResponse' THEN 'Entry Point to capture transaction flow for Spring Webflux.'
    END
WHERE entry_fqm in ('javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','org.springframework.web.filter.OncePerRequestFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V','com.tibco.plugin.share.http.servlet.BwServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','com.tibco.plugin.share.http.servlet.BwServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','com.tibco.plugin.share.http.servlet.BwServlet.doPut(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','com.tibco.plugin.share.http.servlet.BwServlet.doDelete(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','com.tibco.plugin.share.http.servlet.BwServlet.doOptions(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','com.tibco.plugin.share.http.servlet.BwServlet.a(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V','org.eclipse.jetty.servlet.ServletHandler.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lcom/ibm/ws/webcontainer/webapp/WebAppServletInvocationEvent;)V','com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','org.apache.jasper.runtime.HttpJspBase.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','org.apache.catalina.valves.AbstractAccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V','weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','com.caucho.hessian.server.HessianServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','org.apache.activemq.ActiveMQMessageConsumer.dispatch(Lorg/apache/activemq/command/MessageDispatch;)V','com.ibm.mq.jms.MQMessageConsumer.onMessage(Ljavax/jms/Message;)V','org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(Ljavax/jms/Session;Ljavax/jms/Message;)V','org.apache.kafka.clients.consumer.KafkaConsumer.<init>(Lorg/apache/kafka/clients/consumer/ConsumerConfig;Lorg/apache/kafka/common/serialization/Deserializer;Lorg/apache/kafka/common/serialization/Deserializer;)V','org.apache.kafka.clients.consumer.KafkaConsumer.poll(Ljava/time/Duration;)Lorg/apache/kafka/clients/consumer/ConsumerRecords;','org.apache.kafka.clients.consumer.KafkaConsumer.poll(J)Lorg/apache/kafka/clients/consumer/ConsumerRecords;','org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/time/Duration;)V','org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(Ljava/util/Map;Ljava/time/Duration;)V','org.apache.kafka.clients.consumer.KafkaConsumer.commitAsync(Ljava/util/Map;Lorg/apache/kafka/clients/consumer/OffsetCommitCallback;)V','com.sun.jersey.spi.container.servlet.WebComponent.service(Ljava/net/URI;Ljava/net/URI;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)I','org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V','weblogic.servlet.internal.ChunkOutputWrapper.write([BII)V','io.undertow.servlet.spec.ServletOutputStreamImpl.write([BII)V','io.undertow.servlet.spec.ServletPrintWriter.write([CII)V','com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.write([BII)V','io.undertow.servlet.handlers.ServletHandler.handleRequest(Lio/undertow/server/HttpServerExchange;)V','io.undertow.server.Connectors.executeRootHandler(Lio/undertow/server/HttpHandler;Lio/undertow/server/HttpServerExchange;)V','io.undertow.servlet.spec.AsyncContextImpl.complete()V','org.glassfish.jersey.servlet.ServletContainer.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V','org.springframework.batch.core.job.SimpleJob.doExecute(Lorg/springframework/batch/core/JobExecution;)V','org.eclipse.jetty.server.handler.HandlerWrapper.handle(Ljava/lang/String;Lorg/eclipse/jetty/server/Request;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','org.springframework.web.reactive.DispatcherHandler','atg.servlet.pipeline.PipelineableServletImpl.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','atg.servlet.DynamoServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V','atg.servlet.sessionsaver.SessionSaverServlet.service(Latg/servlet/DynamoHttpServletRequest;Latg/servlet/DynamoHttpServletResponse;)V','atg.servlet.pipeline.HeadPipelineServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V','reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart()V','reactor.netty.http.server.HttpServerOperations.onInboundNext(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V','org.springframework.batch.core.job.AbstractJob.execute(Lorg/springframework/batch/core/JobExecution;)V','org.apache.catalina.valves.AccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V','System.Web.HttpRuntime.ProcessRequestNotificationPrivate','System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper','System.Web.HttpRuntime.FinishPipelineRequest','System.Web.HttpRuntime.FinishRequest','SampleApplication.Form1.button1_Click','SampleApplication.Form4.button1_Click','SampleApplication.Form6.button1_Click','SampleApplication.Form1.Exception_Level1_Click','SampleApplication.Form1.Exception_Level2_Click');
+`
show_error

#Insert columns and update columns in naming_rule_profile_backendtype_asso
Error=` psql test cavisson 2>&1<<+
		ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ADD COLUMN vendorname boolean, ADD COLUMN brokerid boolean, ADD COLUMN subid boolean;
        UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET vendorname = true, brokerid = true, subid = true WHERE backend_type_id = 27 AND profile_id = 1;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'com.ibm.ws.webcontainer.channel.WCCByteBufferOutputStream.write([BII)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
	then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to Inject NetVision (UX Monitoring) Tag (Websphere)','com.ibm.ws.webcontainer.channel.WCCByteBufferOutputStream.write([BII)V','WCCByteBufferOutputStream.write([BII)V',14,false,'-','Java');
+`
show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check container_id 4 exists in config_$CONTROLLER_NAME.container_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select container_id from config_$CONTROLLER_NAME.container_type where container_id = 4;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_async_type_assoc;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" != "X4" ]
        then
        Error=` psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.container_type(container_id, description, container_type, container_name) VALUES (4, 'Asynchronous Transaction Rules for Websphere application', 'Websphere', 'websphere');
+`
        show_error
	Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_async_type_assoc(assoc_id,container_id,enabled,profile_id) VALUES ($(($PROF_MAX_ID + 1)),4,true,1);      
+`      
        show_error 
        fi
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync()Ljavax/servlet/AsyncContext;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync()Ljavax/servlet/AsyncContext;',4,'start',0);
+`
        show_error 
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)Ljavax/servlet/AsyncContext;',4,'start',0);
+`
        show_error 
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V',4,'dispatch',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch(Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch(Ljava/lang/String;)V',4,'dispatch',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.dispatch()V',4,'dispatch',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.complete()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.WSAsyncContextImpl.complete()V',4,'complete',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch(Ljavax/servlet/ServletContext;Ljava/lang/String;)V',4,'dispatch',2);
+`
        show_error 
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch(Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch(Ljava/lang/String;)V',4,'dispatch',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.AsyncContextImpl.dispatch()V',4,'dispatch',2);
+`
        show_error
        fi   
fi

#Check fqm exists in config_$CONTROLLER_NAME.nd_asynchronous_rule table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select async_rule_id from config_$CONTROLLER_NAME.nd_asynchronous_rule where fqm = 'com.ibm.ws.webcontainer.async.AsyncContextImpl.complete()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(async_rule_id) FROM config_$CONTROLLER_NAME.nd_asynchronous_rule;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.nd_asynchronous_rule (async_rule_id,fqm,container_id,rule_type,dump_mode) VALUES ($(($MAX_ID + 1)),'com.ibm.ws.webcontainer.async.AsyncContextImpl.complete()V',4,'complete',2);
+`
        show_error
        fi   
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CI_DB_driver.simple_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','CI_DB_driver.simple_query','CI_DB_driver.simple_query',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','.query','.query',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CI_DB_mysql_driver._execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','CI_DB_mysql_driver._execute','CI_DB_mysql_driver._execute',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CI_DB_mysqli_driver._execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','CI_DB_mysqli_driver._execute','CI_DB_mysqli_driver._execute',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CI_DB_driver.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','CI_DB_driver.query','CI_DB_driver.query',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '._execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','._execute','._execute',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Cassandra\DefaultSession.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','Cassandra\DefaultSession.execute','Cassandra\DefaultSession.execute',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Cassandra\DefaultSession.executeAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','Cassandra\DefaultSession.executeAsync','Cassandra\DefaultSession.executeAsync',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Cassandra\BatchStatement.add';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','Cassandra\BatchStatement.add','Cassandra\BatchStatement.add',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.pg_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','.pg_query','.pg_query',44,false,'-','Php');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
	show_error
	fi
fi

#Check key_name ndAgentDebugLogging exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'ndAgentDebugLogging';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'ndAgentDebugLogging','0','2','2','1','pre-custom','8');
+`
 show_error
 fi
fi

#Check key_name enableGCMonitoring exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableGCMonitoring';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value ,type,agent_mode) VALUES($(($MAX_ID + 1)),'enableGCMonitoring','0','2048','5','0%2010000','normal','1');
+`
 show_error
 fi
fi

#update columns in naming_rule_profile_backendtype_asso
Error=` psql test cavisson 2>&1<<+
        UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'DB' where  backend_type_id = 44;
        UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'HTTP' where  backend_type_id = 49;
        ALTER TABLE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ADD COLUMN database_name boolean, ADD COLUMN protocol boolean, ADD COLUMN query_parameter boolean;
        UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET database_name = true, host = true WHERE backend_type_id = 44 AND profile_id = 666666;
        UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true WHERE backend_type_id = 49 AND profile_id = 666666;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.oci_execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL Callout','.oci_execute','.oci_execute',44,false,'-','Php');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
        show_error
        fi
fi

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDC_FILE_KEYWORD_CACHE';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
if [ $? -eq 0 ]
then
        #if keyword does not exist then insert that row in table
        if [ "X$KEY_ID" == "X" ]
        then
        Error=` psql test cavisson 2>&1<<+
                INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value, ndc_key_val, ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDC_FILE_KEYWORD_CACHE','','','1 60000','1 60000','')
+`
show_error
        fi
fi

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET agent_mode = '12' WHERE key_name in ('doNotDiscardFlowPaths', 'enableDBBackendName', 'enableProcessNotificationPhase');

UPDATE config_$CONTROLLER_NAME.keywords SET agent_mode = '13' WHERE key_name in ('ASDataBufferMinCount', 'ndBackendMonFile', 'enableExceptionInSeqBlob', 'NDHTTPRepHdrCfgListFullFp', 'NDHTTPRepHdrCfgListL1Fp', 'ndHttpHdrCaptureFileList', 'AgentTraceLevel', 'logLevelOneFpMethod', 'enableThreadMonTraceLevel', 'NDAppLogFile', 'generateExceptionConfFile', 'cavNVURLFile', 'NDInterfaceFile', 'genNewMonRecord', 'BTAggDataArraySize', 'AppLogTraceLevel', 'ControlThreadTraceLevel', 'BCITraceMaxSize', 'ASEnableHotspotRecord', 'maxIPCount', 'enableFPTrace', 'hdrListForValueAsId', 'NDHTTPReqHdrCfgListL1Fp', 'maxHttpBodySize', 'fpVersionID', 'ndPoolFile', 'DBIPName', 'BTRuleOverridePolicy', 'ndEnableTxHotspot', 'ndHelperDepth', 'ndILRewritterFile', 'ndModuleFile', 'ndProcessesFile', 'ndHotspotThreadLimit');

UPDATE config_$CONTROLLER_NAME.keywords SET agent_mode = '15' WHERE key_name in ('ASDataBufferMaxCount', 'ASDataBufferSize', 'bciDataBufferMaxCount', 'maxCharInSeqBlob', 'enableBackendMonTrace', 'enableForcedFPChain', 'bciDataBufferMaxSize', 'NVCookie', 'bciMaxNonServiceMethodsPerFP', 'captureExceptionTraceLevel', 'enableBTMonitorTrace', 'maxBTCount', 'enableDCHeartBeat');
+`
show_error

#Update backend_type_name_rulefile for Socket Callout
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'SocketCallout' WHERE backend_type_id = 55;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'PDO.exec';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_Callout','PDO.exec','PDO.exec',44,false,'-','Php');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),666666);
+`
        show_error
        fi
fi

#Check key_name enableCallBackException exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableCallBackException';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableCallBackException','0','1','2','0','pre-custom','4');
+`
 show_error
 fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'PDOStatement.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_Callout','PDOStatement.execute','PDOStatement.execute',44,false,'-','Php');
+`
        show_error
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),666666);
+`
        show_error
        fi
fi

#Check key_name enableCallBackException exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'ndMethodTracePointFile';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'ndMethodTracePointFile','1','1024','6','NA','normal','1');
+`
 show_error
 fi
fi

#Check key_name enableReactorLibSupport exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableReactorLibSupport';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableReactorLibSupport','0','1','2','0','pre-custom','1');
+`
 show_error
 fi
fi

#Check if entry_type_id 22 exists in config_$CONTROLLER_NAME.entry_type table or not
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id = 22;")
 if [ $? -eq 0 ]
 then
   #if 22 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X22" ]
   then
Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.entry_type (entry_type_id, entry_type_name, entry_type_detail) VALUES (22,'reqResBodyCapture','description');
+`
show_error
   fi
 fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V' and entry_type_id = 22;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for request response body dump for tomcat.','org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V','OutputBuffer.writeBytes([BII)V',22,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.eclipse.jetty.server.HttpOutput.write([BII)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for request response body dump for jetty.','org.eclipse.jetty.server.HttpOutput.write([BII)V','HttpOutput.write([BII)V',22,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.connector.InputBuffer.read([BII)I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for request response body dump for tomcat.','org.apache.catalina.connector.InputBuffer.read([BII)I','InputBuffer.read([BII)I',22,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.eclipse.jetty.server.HttpInput.read([BII)I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for request response body dump for jetty.','org.eclipse.jetty.server.HttpInput.read([BII)I','HttpInput.read([BII)I',22,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.StatefulRedisConnectionImpl.dispatch(Lio/lettuce/core/protocol/RedisCommand;)Lio/lettuce/core/protocol/RedisCommand;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.StatefulRedisConnectionImpl.dispatch(Lio/lettuce/core/protocol/RedisCommand;)Lio/lettuce/core/protocol/RedisCommand;','StatefulRedisConnectionImpl.dispatch(RedisCommand;)RedisCommand;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.RedisClient.connectStatefulAsync(Lio/lettuce/core/StatefulRedisConnectionImpl;Lio/lettuce/core/codec/RedisCodec;Lio/lettuce/core/protocol/Endpoint;Lio/lettuce/core/RedisURI;Ljava/util/function/Supplier;)Lio/lettuce/core/ConnectionFuture';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.RedisClient.connectStatefulAsync(Lio/lettuce/core/StatefulRedisConnectionImpl;Lio/lettuce/core/codec/RedisCodec;Lio/lettuce/core/protocol/Endpoint;Lio/lettuce/core/RedisURI;Ljava/util/function/Supplier;)Lio/lettuce/core/ConnectionFuture','RedisClient.connectStatefulAsync(StatefulRedisConnectionImpl;RedisCodec;Endpoint;RedisURI;Supplier;)ConnectionFuture',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisReactiveCommands.createMono(Ljava/util/function/Supplier;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisReactiveCommands.createMono(Ljava/util/function/Supplier;)Lreactor/core/publisher/Mono;','AbstractRedisReactiveCommands.createMono(Supplier;)Mono;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisReactiveCommands.createFlux(Ljava/util/function/Supplier;)Lreactor/core/publisher/Flux;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisReactiveCommands.createFlux(Ljava/util/function/Supplier;)Lreactor/core/publisher/Flux;','AbstractRedisReactiveCommands.createFlux(Supplier;)Flux;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisReactiveCommands.createFlux(Ljava/util/function/Supplier;Z)Lreactor/core/publisher/Flux;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisReactiveCommands.createFlux(Ljava/util/function/Supplier;Z)Lreactor/core/publisher/Flux;','AbstractRedisReactiveCommands.createFlux(Supplier;Z)Flux;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisReactiveCommands.createMono(Lio/lettuce/core/protocol/CommandType;Lio/lettuce/core/output/CommandOutput;Lio/lettuce/core/protocol/CommandArgs;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisReactiveCommands.createMono(Lio/lettuce/core/protocol/CommandType;Lio/lettuce/core/output/CommandOutput;Lio/lettuce/core/protocol/CommandArgs;)Lreactor/core/publisher/Mono;','AbstractRedisReactiveCommands.createMono(CommandType;CommandOutput;CommandArgs;)Mono;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.RedisChannelHandler.dispatch(Lio/lettuce/core/protocol/RedisCommand;)Lio/lettuce/core/protocol/RedisCommand;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.RedisChannelHandler.dispatch(Lio/lettuce/core/protocol/RedisCommand;)Lio/lettuce/core/protocol/RedisCommand;','RedisChannelHandler.dispatch(RedisCommand;)RedisCommand;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.protocol.Command.completeExceptionally(Ljava/lang/Throwable;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.protocol.Command.completeExceptionally(Ljava/lang/Throwable;)Z','Command.completeExceptionally(Throwable;)Z',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.protocol.Command.complete()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.protocol.Command.complete()V','Command.complete()V',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check if entry_type_id 23 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id = 23;")
if [ $? -eq 0 ]
then
   #if 23 row does not exist then insert that row in table
   if [ "X$KEY_ID" != "X23" ]
   then
     Error=` psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.entry_type (entry_type_id, entry_type_name, entry_type_detail) VALUES (23,'playAsyncEntryPoint','description');
+`
	 show_error
   fi
fi
 
#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z' and entry_type_id = 23;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for capturing play asynchronous transactions.','java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z','java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z',23,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z' and entry_type_id = 23;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
        then
        if [ "X$KEY_ID" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
        INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for capturing play asynchronous transactions.','java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z','java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z',23,false,'-','Java');
        INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
        show_error
        fi
fi

#Check key_name appLoggerType exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'appLoggerType';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'appLoggerType','0','1024','5','-','normal','1');
+`
 show_error
 fi
fi

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN trace_request bigint, ADD COLUMN threshold bigint, ADD COLUMN instrument_level bigint;
+`
show_error

#Check key_name enableBodyCapture exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableBodyCapture';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value ,type,agent_mode) VALUES($(($MAX_ID + 1)),'enableBodyCapture','0','512','5','0%2010000','normal','1');
+`
 show_error
 fi
fi

#Check key_name instrumentationLevelMethod exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'instrumentationLevelMethod';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES($(($MAX_ID + 1)),'instrumentationLevelMethod','1','4','2','1','pre-custom','1');
+`
 show_error
 fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(Lorg/apache/kafka/clients/consumer/ConsumerRecord;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture kafka custom for kafka consumer records.','org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(Lorg/apache/kafka/clients/consumer/ConsumerRecord;)V','RecordMessagingMessageListenerAdapter.onMessage(ConsumerRecord;)V',18,false,'-','Java');
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(Lorg/apache/kafka/clients/consumer/ConsumerRecord;Lorg/springframework/kafka/support/Acknowledgment;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture kafka custom for kafka consumer records.','org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(Lorg/apache/kafka/clients/consumer/ConsumerRecord;Lorg/springframework/kafka/support/Acknowledgment;)V','RecordMessagingMessageListenerAdapter.onMessage(ConsumerRecord;Acknowledgment;)V',18,false,'-','Java');
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeBatchListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Spring Application','org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeBatchListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V','KafkaMessageListenerContainer$ListenerConsumer.invokeBatchListener(ConsumerRecords;)V',17,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
	if [ "X$KEY_ID" == "X" ]
	then
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Spring Application','org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V','KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(ConsumerRecords;)V',17,false,'-','Java');
+`
	show_error
	Error=`psql test cavisson 2>&1<<+
	INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
	show_error
	fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'com.lambdaworks.redis.RedisClient.connectStandalone(Lcom/lambdaworks/redis/codec/RedisCodec;Lcom/lambdaworks/redis/RedisURI;)Lcom/lambdaworks/redis/api/StatefulRedisConnection;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','com.lambdaworks.redis.RedisClient.connectStandalone(Lcom/lambdaworks/redis/codec/RedisCodec;Lcom/lambdaworks/redis/RedisURI;)Lcom/lambdaworks/redis/api/StatefulRedisConnection;','RedisClient.connectStandalone(RedisCodec;RedisURI;)StatefulRedisConnection;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check conditioning column exists in config_$CONTROLLER_NAME.dl_data table or not
 KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select conditioning from config_$CONTROLLER_NAME.dl_data;")
 if [ $? -ne 0 ]
 then
   #if ai_enable column does not exist then insert add that column in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN conditioning varchar(4096);
+`
show_error
   fi
 fi
 
 #Check exp_ui column exists in config_$CONTROLLER_NAME.dl_data table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select exp_ui from config_$CONTROLLER_NAME.dl_data;")
 if [ $? -ne 0 ]
 then
   #if ai_enable column does not exist then insert add that column in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=` psql test cavisson 2>&1<<+
     ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN exp_ui varchar(4096);
+`
show_error
   fi
 fi

#Adding a column in instance table for Memory Profiler status(Running/Complete)
Error=` psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.instance add COLUMN mp_enable boolean;
Update config_$CONTROLLER_NAME.instance set mp_enable = false;
+`
show_error

#Updating entry_name and entry_tye_id in config_$CONTROLLER_NAME.service_entry_points table
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.service_entry_points set entry_name = 'KafkaConsumerinvokeBatchListener', entry_type_id = 6 WHERE entry_fqm = 'org.springframework.kafka.listener.KafkaMessageListenerContainer.invokeBatchListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V';
UPDATE config_$CONTROLLER_NAME.service_entry_points set entry_name = 'KafkaConsumerinvokeRecordListener', entry_type_id = 6 WHERE entry_fqm = 'org.springframework.kafka.listener.KafkaMessageListenerContainer.invokeRecordListener(Lorg/apache/kafka/clients/consumer/ConsumerRecords;)V';
+`

#Adding a column in instance table for Mutex Lock status(Running/Complete)
Error=` psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.instance add COLUMN mutex_enable boolean;
Update config_$CONTROLLER_NAME.instance set mutex_enable = false;
+`
show_error

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'Microsoft.AspNetCore.Hosting.HostingApplication.ProcessRequestAsync';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CORE FRAMEWORK ENTRY POINT','Microsoft.AspNetCore.Hosting.HostingApplication.ProcessRequestAsync','HostingApplication.ProcessRequestAsync',1,false,'Microsoft.AspNetCore.Hosting.dll','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)),true, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
  KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'Microsoft.AspNetCore.Hosting.HostingApplication.DisposeContext';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
  PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
  if [ $? -eq 0 ]
  then
    if [ "X$KEY_ID" == "X" ]
    then
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.service_entry_points(entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CORE FRAMEWORK ENTRY POINT','Microsoft.AspNetCore.Hosting.HostingApplication.DisposeContext','HostingApplication.DisposeContext',12,false,'Microsoft.AspNetCore.Hosting.dll','Dot Net');
+`
    show_error
    Error=`psql test cavisson 2>&1<<+
    INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id, profile_enable, entry_id, profile_id) VALUES ($(($PROF_MAX_ID + 1)),true, $(($MAX_ID + 1)), 888888);
+`
    show_error
    fi
fi

#Check key_name enableCaptureVarForException exists in config_$CONTROLLER_NAME.keywords table or not
  KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableCaptureVarForException';")
  MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
     INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableCaptureVarForException','1','1024','6','NA','normal','1');
+`
show_error
   fi
fi

#Adding log_level column in config_$CONTROLLER_NAME.bt_pattern Table.
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.bt_pattern ADD COLUMN log_level character varying(255);
+`
show_error

#Check key_name enableBciPctLeakyBucket exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableBciPctLeakyBucket';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
        #if key_name does not exist then insert that row in table
        if [ "X$KEY_NAME" == "X" ]
        then
        Error=`psql test cavisson 2>&1<<+
                INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableBciPctLeakyBucket','0','1','2','1','pre-custom','1');
+`
        show_error
        fi
fi

#modifying the default value of enableCpuTime and enableJavaGCMonitor in keywords table for:
Error=` psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set key_def_value = 1 where key_name in ('enableJdbcInterfaceCapturing','enableCpuTime', 'enableJavaGCMonitor');
+`
show_error

#updating profile_backend_point_asso table and enabling false be default for below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'com.microsoft.sqlserver.jdbc.SQLServerStatement' OR
end_point_fqm = 'com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement'
)
AND profile_id=1
);
+`
show_error

#updating profile_backend_point_asso table and enabling true be default for below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = true WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'com.mysql' OR
end_point_fqm = 'org.postgres' OR
end_point_fqm = 'oracle.jdbc'
)
AND profile_id=1
);
+`
show_error

#Insering new backend type CUSTOM_LOG for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 56;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X56" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (56,'Entry Point for Custom Logging.','CUSTOM_LOG','CUSTOM_LOG','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,56,666666);
+`
show_error
fi
fi

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '0%2010m%202%20100%20100%2010793%201' WHERE key_name = 'tDigestPercentileBT';
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '0%2010m%202%20100%20100%2010794%201' WHERE key_name = 'tDigestPercentileIP';
+`
show_error

#Changing the default value of bciNDNFDataBufferSetting from 256kb to 100kb
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '50%20100000' WHERE key_name = 'bciNDNFDataBufferSetting';
+`
show_error

#Changing the default value of enableProcessNotificationPhase from 0 to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'enableProcessNotificationPhase';
+`
show_error

#Insering new backend type FIREBIRD for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 57;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X57" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (57,'Entry Point to capture Firebird Calls.','FIREBIRD','FIREBIRD','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,57,666666);
+`
show_error
fi
fi

#Insering new backend type MEMCACHED for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 58;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X58" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (58,'Entry Point to capture Memcached Calls.','MEMCACHED','MEMCACHED','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,58,666666);
+`
show_error
fi
fi

#Insering new backend type REDIS for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 59;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X59" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (59,'Entry Point to capture Redis Calls','REDIS','REDIS','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,59,666666);
+`
show_error
fi
fi

#Insering new backend type ODBC for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 60;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X60" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (60,'Entry Point to capture ODBC Callout','ODBC','ODBC','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,60,666666);
+`
show_error
fi
fi

#Insering new backend type SQLITE for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 61;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X61" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (61,'Entry Point to capture SQLITE Callout','SQLITE','SQLITE','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,61,666666);
+`
show_error
fi
fi

#Insering new backend type PG for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 62;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X62" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (62,'Entry Point to capture PostgresSQL Callout','PG','PG','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,62,666666);
+`
show_error
fi
fi

#Insering new backend type ORACLE for PHP
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 63;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X63" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (63,'Entry Point to capture ORACLE Callout','ORACLE','ORACLE','None','Php');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,63,666666);
+`
show_error
fi
fi

#========================New Entry Points For SQL, Mongo, Custom Log Callout for PHP agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'PDO.prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PDO Callout','PDO.prepare','PDO.prepare',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.sqlsrv_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Microsoft SQL Server Callout','.sqlsrv_query','sqlsrv_query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

 #Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.sqlsrv_prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Microsoft SQL Server Callout','.sqlsrv_prepare','sqlsrv_prepare',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.odbc_prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ODBC Callout','.odbc_prepare','odbc_prepare',60,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.odbc_exec';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ODBC Callout','.odbc_exec','odbc_exec',60,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SQLite3.exec';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQLite Callout','SQLite3.exec','SQLite3.exec',61,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

 #Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SQLite3.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQLite Callout','SQLite3.query','SQLite3.query',61,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SQLite3.querySingle';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQLite Callout','SQLite3.querySingle','SQLite3.querySingle',61,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'SQLite3.prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQLite Callout','SQLite3.prepare','SQLite3.prepare',61,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mysqli.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Mysql Callout','mysqli.query','mysqli.query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mysqli.prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Mysql Callout','mysqli.prepare','mysqli.prepare',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mysqli.multi_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Mysql Callout','mysqli.multi_query','mysqli.multi_query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.mysqli_multi_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Mysql Callout','.mysqli_multi_query','.mysqli_multi_query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.pg_execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PostgresSQL Callout','.pg_execute','.pg_execute',62,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.pg_prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PostgresSQL Callout','.pg_prepare','.pg_prepare',62,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.oci_parse';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Oracle Callout','.oci_parse','.oci_parse',63,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'wpdb.prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Wordpress Callout','wpdb.prepare','wpdb.prepare',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'wpdb.query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Wordpress Callout','wpdb.query','wpdb.query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'wpdb._do_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Wordpress Callout','wpdb._do_query','wpdb._do_query',44,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.ibase_prepare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Firebird Callout','.ibase_prepare','ibase_prepare',57,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '.ibase_query';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Firebird Callout','.ibase_query','.ibase_query',57,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Memcached.add';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Memcached Callout','Memcached.add','Memcached.add',58,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Memcached.getMulti';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Memcached Callout','Memcached.getMulti','Memcached.getMulti',58,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Memcached.delete';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Memcached Callout','Memcached.delete','Memcached.delete',58,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Memcached.replace';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Memcached Callout','Memcached.replace','Memcached.replace',58,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Memcached.get';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Memcached Callout','Memcached.get','Memcached.get',58,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.set';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.set','Redis.set',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.lrange';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.lrange','Redis.lrange',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.get';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.get','Redis.get',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.lPush';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.lPush','Redis.lPush',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.hSet';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.hSet','Redis.hSet',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.rPush';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.rPush','Redis.rPush',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.lPop';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.lPop','Redis.lPop',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.rPop';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.rPop','Redis.rPop',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.del';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.del','Redis.del',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.incr';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.incr','Redis.incr',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Redis.decr';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout','Redis.decr','Redis.decr',59,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'error_log(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','error_log(string;)','error_log',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Monolog\Logger.info(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','Monolog\Logger.info(string;)','Monolog\Logger.info',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Monolog\Logger.warning(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','Monolog\Logger.warning(string;)','Monolog\Logger.warning',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Monolog\Logger.error(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','Monolog\Logger.error(string;)','Monolog\Logger.error',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'log_message(int;string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','log_message(int;string;)','log_message',56,false,'-','Php',2);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'yii\BaseYii.debug(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','yii\BaseYii.debug(string;)','yii\BaseYii.debug',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'yii\BaseYii.info(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','yii\BaseYii.info(string;)','yii\BaseYii.info',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'yii\BaseYii.warning(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','yii\BaseYii.warning(string;)','yii\BaseYii.warning',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'yii\BaseYii.error(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','yii\BaseYii.error(string;)','yii\BaseYii.error',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'YiiBase.log(string;int)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'Custom Log Callout','YiiBase.log(string;int)','YiiBase.log',56,false,'-','Php',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Driver\Manager.executeBulkWrite';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Driver\Manager.executeBulkWrite','MongoDB\Driver\Manager.executeBulkWrite',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Driver\Manager.executeQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Driver\Manager.executeQuery','MongoDB\Driver\Manager.executeQuery',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.findOne';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.findOne','MongoDB\Collection.findOne',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.findOneAndReplace';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.findOneAndReplace','MongoDB\Collection.findOneAndReplace',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MongoDB\Collection.updateMany';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout','MongoDB\Collection.updateMany','MongoDB\Collection.updateMany',47,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Insering new backend type REDIS for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 67;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X67" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (67,'Entry Point to capture REDIS Calls.','REDIS','REDIS','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,67,888888);
+`
show_error
fi
fi

#Insering new backend type PGSQL for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 68;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X68" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (68,'Entry Point to capture PGSQL Calls.','PGSQL','PGSQL','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,68,888888);
+`
show_error
fi
fi

#Insering new backend type ORACLE for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 69;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X69" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (69,'Entry Point to capture ORACLE Calls.','ORACLE','ORACLE','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,69,888888);
+`
show_error
fi
fi

#Insering new backend type DB2 for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 70;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X70" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (70,'Entry Point to capture DB2 Calls.','DB2','DB2','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,70,888888);
+`
show_error
fi
fi

#========================New Entry Points Redis_Callout for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'RabbitMQ.Client.Impl.ModelBase.BasicPublish';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout for dot net','RabbitMQ.Client.Impl.ModelBase.BasicPublish','RabbitMQ.Client.Impl.ModelBase.BasicPublish',67,false,'RabbitMQ.Client.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'RabbitMQ.Client.IModel.QueueDeclare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout for dot net','RabbitMQ.Client.IModel.QueueDeclare','RabbitMQ.Client.IModel.QueueDeclare',67,false,'RabbitMQ.Client.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'RabbitMQ.Client.IModel.BasicGet';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Redis Callout for dot net','RabbitMQ.Client.IModel.BasicGet','RabbitMQ.Client.IModel.BasicGet',67,false,'RabbitMQ.Client.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#========================New Entry Points SQL_Callout for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.FinishExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.FinishExecuteReader','System.Data.SqlClient.SqlCommand.FinishExecuteReader',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.ExecuteScalar';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.ExecuteScalar','System.Data.SqlClient.SqlCommand.ExecuteScalar',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.ExecuteDbDataReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.ExecuteDbDataReader','System.Data.SqlClient.SqlCommand.ExecuteDbDataReader',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.BeginExecuteNonQueryInternal';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.BeginExecuteNonQueryInternal','System.Data.SqlClient.SqlCommand.BeginExecuteNonQueryInternal',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.ExecuteReaderAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.ExecuteReaderAsync','System.Data.SqlClient.SqlCommand.ExecuteReaderAsync',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.RunExecuteReaderTds';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.RunExecuteReaderTds','System.Data.SqlClient.SqlCommand.RunExecuteReaderTds',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.SqlClient.SqlCommand.BeginExecuteReaderInternal';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.SqlClient.SqlCommand.BeginExecuteReaderInternal','System.Data.SqlClient.SqlCommand.BeginExecuteReaderInternal',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.Common.DataAdapter.Fill';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.Common.DataAdapter.Fill','System.Data.Common.DataAdapter.Fill',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.Common.DataAdapter.Update';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.Common.DataAdapter.Update','System.Data.Common.DataAdapter.Update',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.OleDb.OleDbCommand.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','System.Data.OleDb.OleDbCommand.ExecuteReader','System.Data.OleDb.OleDbCommand.ExecuteReader',17,false,'System.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader','Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader',17,false,'Microsoft.Data.SqlClient.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader','Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader',17,false,'Microsoft.Practices.EnterpriseLibrary.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery','Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery',17,false,'Microsoft.Practices.EnterpriseLibrary.Data.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#========================New Entry Points ASYNC_Call for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Xml.XmlDocument.LoadXml';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','System.Xml.XmlDocument.LoadXml','System.Xml.XmlDocument.LoadXml',18,false,'System.Xml.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Xml.XmlDocument.Load';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','System.Xml.XmlDocument.Load','System.Xml.XmlDocument.Load',18,false,'System.Xml.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Error';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Error','NLog.Logger.Error',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager.HandleException';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager.HandleException','Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager.HandleException',18,false,'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'log4net.Repository.Hierarchy.Logger.Log';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','log4net.Repository.Hierarchy.Logger.Log','log4net.Repository.Hierarchy.Logger.Log',18,false,'log4net.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'log4net.Repository.Hierarchy.Logger.AddAppender';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','log4net.Repository.Hierarchy.Logger.AddAppender','log4net.Repository.Hierarchy.Logger.AddAppender',18,false,'log4net.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Error';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Error','NLog.Logger.Error',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Info';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Info','NLog.Logger.Info',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Warn';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Warn','NLog.Logger.Warn',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Debug';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Debug','NLog.Logger.Debug',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Fatal';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ASYNC_CALL for dot net','NLog.Logger.Fatal','NLog.Logger.Fatal',18,false,'Nlog.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#========================New Entry Points HTTP_CALLOUT for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.SendAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.SendAsync','System.Net.Http.HttpClient.SendAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.HttpWebRequest.BeginSubmitRequest';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.HttpWebRequest.BeginSubmitRequest','System.Net.HttpWebRequest.BeginSubmitRequest',16,false,'System.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.GetAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.GetAsync','System.Net.Http.HttpClient.GetAsync',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.GetStreamAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.GetStreamAsync','System.Net.Http.HttpClient.GetStreamAsync',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.GetStringAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.GetStringAsync','System.Net.Http.HttpClient.GetStringAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.DeleteAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.DeleteAsync','System.Net.Http.HttpClient.DeleteAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.GetByteArrayAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.GetByteArrayAsync','System.Net.Http.HttpClient.GetByteArrayAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.PostAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.PostAsync','System.Net.Http.HttpClient.PostAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Net.Http.HttpClient.PutAsync';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for dot net','System.Net.Http.HttpClient.PutAsync','System.Net.Http.HttpClient.PutAsync.',16,false,'System.Net.Http.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#========================New Entry Points PGSQL_CALLOUT for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'npgsql.NpgsqlCommand.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PGSQL_CALLOUT for dot net','npgsql.NpgsqlCommand.ExecuteReader','npgsql.NpgsqlCommand.ExecuteReader',68,false,'npgsql.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'npgsql.NpgsqlConnection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PGSQL_CALLOUT for dot net','npgsql.NpgsqlConnection.Open','npgsql.NpgsqlConnection.Open',68,false,'npgsql.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#========================New Entry Points ORACLE_CALLOUT for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'System.Data.OracleClient.OracleCommand.ExecuteNonQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ORACLE_CALLOUT for dot net','System.Data.OracleClient.OracleCommand.ExecuteNonQuery','System.Data.OracleClient.OracleCommand.ExecuteNonQuery',69,false,'System.Data.OracleClient.OracleCommand.ExecuteNonQuery','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ORACLE_CALLOUT for dot net','Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery','Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery',69,false,'Oracle.ManagedDataAccess.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ORACLE_CALLOUT for dot net','Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader','Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader',69,false,'Oracle.ManagedDataAccess.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Oracle.ManagedDataAccess.Client.OracleConnection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'ORACLE_CALLOUT for dot net','Oracle.ManagedDataAccess.Client.OracleConnection.Open','Oracle.ManagedDataAccess.Client.OracleConnection.Open',69,false,'Oracle.ManagedDataAccess.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi


#========================New Entry Points DB2_CALLOUT for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'IBM.Data.DB2.DB2Connection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'DB2_CALLOUT for dot net','IBM.Data.DB2.DB2Connection.Open','IBM.Data.DB2.DB2Connection.Open',70,false,'IBM.Data.DB2.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'IBM.Data.DB2.DB2Command.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'DB2_CALLOUT for dot net','IBM.Data.DB2.DB2Command.ExecuteReader','IBM.Data.DB2.DB2Command.ExecuteReader',70,false,'IBM.Data.DB2.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'IBM.Data.DB2.DB2Command.ExecuteNonQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'DB2_CALLOUT for dot net','IBM.Data.DB2.DB2Command.ExecuteNonQuery','IBM.Data.DB2.DB2Command.ExecuteNonQuery',70,false,'IBM.Data.DB2.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Updating the callout types of below fqms
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 69,end_point_name='System.Data.OracleClient.OracleCommand.ExecuteReader',end_point_desc = 'ORACLE_CALLOUT for dot net' WHERE backend_type_id = 17 AND end_point_fqm = 'System.Data.OracleClient.OracleCommand.ExecuteReader';
+`
show_error

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 69,end_point_name='System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal',end_point_desc = 'ORACLE_CALLOUT for dot net' WHERE backend_type_id = 17 AND end_point_fqm = 'System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal';
+`
show_error

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 69,end_point_name='System.Data.OracleClient.OracleConnection.Open',end_point_desc = 'ORACLE_CALLOUT for dot net' WHERE backend_type_id = 17 AND end_point_fqm = 'System.Data.OracleClient.OracleConnection.Open';
+`
show_error

#Updating profile_backend_point_asso table and enabling true be default for below FQMs.
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = true WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'System.Data.OracleClient.OracleConnection.Open' OR
end_point_fqm = 'System.Data.SqlClient.SqlConnection.Open' OR
end_point_fqm = 'System.Net.HttpWebRequest.BeginGetRequestStream'
)
AND profile_id= 888888
);
+`
show_error

#Setting the default value of enableCaptureVarForException
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = 'NA' WHERE key_name = 'enableCaptureVarForException';
+`
show_error

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled = false WHERE end_point_id IN
(
SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE
(
end_point_fqm = 'log4net.Repository.Hierarchy.Logger.Log'
)
AND profile_id= 888888
);
+`
show_error

Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN tag_name varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN tag_value varchar(255);
+`
show_error

#Updating backend_type of below FQM
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 63,end_point_name='.oci_execute',end_point_desc = 'Oracle Callout' WHERE backend_type_id = 44 AND end_point_fqm = '.oci_execute';
+`
show_error

#Support of new Entry Point for Php Agent
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'CouchSimple.send';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','CouchSimple.send','CouchSimple.send',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#Support of new Entry Point for Php Agent
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'PHPOnCouch\Couch.query';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'COUCHBASE_DB Callout','PHPOnCouch\Couch.query','PHPOnCouch\Couch.query',48,false,'-','Php');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),666666);
+`
show_error
fi
fi

#=====================Changes for New HTTP callout support for Java agent=============================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;','Apache5 http client',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#=====================Changes for supporting Akka service entry for Java agent=============================
#Check backend_type_id 15 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =24 ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X24" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (24, 'description', 'Akka');
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'akka.actor.typed.javadsl.Receive.receive(Lakka/actor/typed/TypedActorContext;Ljava/lang/Object;)Lakka/actor/typed/Behavior';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point to capture Akka transactions','akka.actor.typed.javadsl.Receive.receive(Lakka/actor/typed/TypedActorContext;Ljava/lang/Object;)Lakka/actor/typed/Behavior','akka.actor.typed.javadsl.Receive.receive',24,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Changing the default value of enableDBBackendName from 0 to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'enableDBBackendName';
+`
show_error

#Changes To Support enableTracePointMonitor Keyword
#Check key_name enableTracePointMonitor exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableTracePointMonitor';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableTracePointMonitor','0','1','2','0','pre-custom','1');
+`
 show_error
 fi
fi

#Changes for enabling Host Bydefault in HTTP callout for DotNet agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true , url = false WHERE backend_type_id = 16;
+`
show_error

#Insering new backend type CUSTOM_LOG for DotNet
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 71;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X71" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (71,'Entry Point for Custom Logging.','CUSTOM_LOG','CUSTOM_LOG','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,71,888888);
+`
show_error
fi
fi


#Insering new backend type RABBITMQ for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 72;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X72" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (72,'Entry Point to capture RABBITMQ Calls.','RABBITMQ','RABBITMQ','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,72,888888);
+`
show_error
fi
fi

#Updating the callout type of below fqm
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET backend_type_id = 72,end_point_name='RabbitMQ.Client.Impl.ModelBase.BasicPublish',end_point_desc = 'RABBITMQ_CALLOUT for dot net' WHERE backend_type_id = 67 AND end_point_fqm = 'RabbitMQ.Client.Impl.ModelBase.BasicPublish';
+`
show_error

#========================New Entry Points RABBITMQ Callout for Dot Net agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'RabbitMQ.Client.Impl.ModelBase.QueueDeclare';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'RABBITMQ Callout for dot net','RabbitMQ.Client.Impl.ModelBase.QueueDeclare','RabbitMQ.Client.Impl.ModelBase.QueueDeclare',72,false,'RabbitMQ.Client.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi


KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'RabbitMQ.Client.Impl.ModelBase.BasicConsume';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'RABBITMQ Callout for dot net','RabbitMQ.Client.Impl.ModelBase.BasicConsume','RabbitMQ.Client.Impl.ModelBase.BasicConsume',72,false,'RabbitMQ.Client.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Updating entry_type_name and entry_fqm for AkkaEntry
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.entry_type set entry_type_name = 'AkkaEntry' where entry_type_id = 24;
Update config_$CONTROLLER_NAME.service_entry_points set entry_fqm = 'akka.actor.typed.javadsl.Receive.receive(Lakka/actor/typed/TypedActorContext;Ljava/lang/Object;)Lakka/actor/typed/Behavior;' where entry_id = 82 AND entry_type_id = 24;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse';")
Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id = $KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id = $KEY_ID;
+`
show_error


#Updating end_point_fqm for Apache5 http client
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.backend_points set end_point_fqm = 'org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;' where end_point_fqm='org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse';
+`
show_error

#Updating the EntryPointType for RABBITMQ_CALLOUT
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_entrypointsfile = 'RABBITMQ_CALLOUT' where backend_type_id =72;
+`
show_error

#Updating datatype of column tier_group of table nde_routing_rules
Error=` psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.nde_routing_rules alter COLUMN tier_group TYPE varchar(4096);
+`
show_error

#Insering new backend type Oracle for NodeJS
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 73;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X73" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (73,'Entry Point to capture Oracle calls.','Oracle','oracle','ORACLE','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,73,777777);
+`
show_error
fi
fi

#Insering new backend type MySQL for NodeJS
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 74;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X74" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (74,'Entry Point to capture MySQL calls.','MySQL','mysql','MYSQL','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,74,777777);
+`
show_error
fi
fi

#Insering new backend type KafkaJS for NodeJS
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 75;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X75" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (75,'Entry Point to capture KafkaJS calls.','KafkaJS','kafkajs','KAFKAJS','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,75,777777);
+`
show_error
fi
fi

#Insering new backend type Elastic Search for NodeJS
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 76;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X76" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (76,'Entry Point to capture Elastic Search calls.','ElasticSearch','elasticsearch','ElasticSearch','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,76,777777);
+`
show_error
fi
fi


#========================New Entry Points for NodeJS agent===========================
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 73;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Oracle Backend point','Command','Command',73,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 74;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MySQL Backend point','Command','Command',74,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 75;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'KafkaJs Backend point','Command','Command',75,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 76;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Elastic_Search Backend point','Command','Command',76,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Changes To Support enableDBQueryParamValues Keyword
#Check key_name enableDBQueryParamValues exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableDBQueryParamValues';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'enableDBQueryParamValues','0','1','2','0','pre-custom','31','Capture DB Query Parameter Values, it may have performance impact due to increase in traffic and storage');
+`
 show_error
 fi
fi

#Inserting new backend type HTTP for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 77;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X77" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (77,'Entry Point to capture HTTP Calls.','HTTP_CALLOUT','HTTP','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,77,999999);
+`
show_error
fi
fi

#Inserting new backend type SQL for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 78;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X78" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (78,'Entry Point to capture SQL Calls.','SQL_CALLOUT','SQL','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,78,999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'http.client.HTTPConnection.getresponse';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for python','http.client.HTTPConnection.getresponse','http.client.HTTPConnection.getresponse',77,false,'requests','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'tornado.httpclient.AsyncHTTPClient.fetch';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for python','tornado.httpclient.AsyncHTTPClient.fetch','tornado.httpclient.AsyncHTTPClient.fetch',77,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'botocore.client.ClientCreator._create_api_method';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','botocore.client.ClientCreator._create_api_method','botocore.client.ClientCreator._create_api_method',78,false,'botocore','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'botocore.endpoint.Endpoint.make_request';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','botocore.endpoint.Endpoint.make_request','botocore.endpoint.Endpoint.make_request',78,false,'botocore','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MySQLdb.connections.Connection.__init__';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','MySQLdb.connections.Connection.__init__','MySQLdb.connections.Connection.__init__',78,false,'MySQLdb','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'pymysql.connection.Connection.connect';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','pymysql.connection.Connection.connect','pymysql.connection.Connection.connect',78,false,'pymysql','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'psycopg2.connect';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','psycopg2.connect','psycopg2.connect',78,false,'psycopg2','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Inserting new backend type MONGO_DB for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 79;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X79" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (79,'Entry Point to capture MONGO_DB Calls.','MONGO_DB','MONGO_DB','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,79,999999);
+`
show_error
fi
fi

#Inserting new backend type REDIS for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 80;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X80" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (80,'Entry Point to capture REDIS Calls.','REDIS','REDIS','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,80,999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mod.monitoring.CommandListener.succeeded';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout for python','mod.monitoring.CommandListener.succeeded','mod.monitoring.CommandListener.succeeded',79,false,'pymongo','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mod.monitoring.CommandListener.failed';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout for python','mod.monitoring.CommandListener.failed','mod.monitoring.CommandListener.failed',79,false,'pymongo','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'pymongo.monitoring.CommandListener.started';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_DB Callout for python','pymongo.monitoring.CommandListener.started','pymongo.monitoring.CommandListener.started',79,false,'pymongo','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'redis.connection.AbstractConnection.send_packed_command';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS Callout for python','redis.connection.AbstractConnection.send_packed_command','redis.connection.AbstractConnection.send_packed_command',80,false,'redis','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Inserting new backend type CUSTOM_LOG for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 81;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X81" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (81,'Entry Point for Custom Logging.','CUSTOM_LOG','CUSTOM_LOG','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,81,999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'logging.Logger.callhandlers(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'CUSTOM_LOG for python','logging.Logger.callhandlers(string;)','logging.Logger.callhandlers',81,false,'logging','Python',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Inserting new Entry Points of SQL_CALLOUT for Dot Net agent
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Data.SqlClient.SqlConnection.Open';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','Microsoft.Data.SqlClient.SqlConnection.Open','Microsoft.Data.SqlClient.SqlConnection.Open',17,false,'Microsoft.Data.SqlClient.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Microsoft.Data.SqlClient.SqlCommand.ExecuteReader';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for dot net','Microsoft.Data.SqlClient.SqlCommand.ExecuteReader','Microsoft.Data.SqlClient.SqlCommand.ExecuteReader',17,false,'Microsoft.Data.SqlClient.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Changes To Support enableOTELStandard Keyword
#Check key_name enableOTELStandard exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableOTELStandard';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
 then
 #if key_name does not exist then insert that row in table
 if [ "X$KEY_NAME" == "X" ]
 then
 Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableOTELStandard','0','1024','5','0','normal','31');
+`
 show_error
 fi
fi

#Entry Points support for CUSTOM_LOG in Dot Net agent
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Debug(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'CUSTOM_LOG for dot net','NLog.Logger.Debug(string;)','NLog.Logger.Debug',71,false,'NLog.dll','Dot Net',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Info(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'CUSTOM_LOG for dot net','NLog.Logger.Info(string;)','NLog.Logger.Info',71,false,'NLog.dll','Dot Net',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Warn(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'CUSTOM_LOG for dot net','NLog.Logger.Warn(string;)','NLog.Logger.Warn',71,false,'NLog.dll','Dot Net',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'NLog.Logger.Fatal(string;)';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent,argument_index) VALUES ($(($MAX_ID + 1)),'CUSTOM_LOG for dot net','NLog.Logger.Fatal(string;)','NLog.Logger.Fatal',71,false,'NLog.dll','Dot Net',1);
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#=====================Changes for supporting HTTP service entry for Python agent=============================
#Check entry_type_id 25 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =25;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X25" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (25, 'description', 'HTTP_ENTRY');
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'flask.Flask.handle_user_exception';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Flask framework','flask.Flask.handle_user_exception','Flask.handle_user_exception',25,false,'flask','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'flask.Flask.wsgi_app';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Flask framework','flask.Flask.wsgi_app','Flask.wsgi_app',25,false,'flask','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'django.core.handlers.base.BaseHandler.load_middleware';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Django framework','django.core.handlers.base.BaseHandler.load_middleware','BaseHandler.load_middleware',25,false,'Django','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'django.core.handlers.wsgi.WSGIHandler.__call__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Django framework','django.core.handlers.wsgi.WSGIHandler.__call__','WSGIHandler.__call__',25,false,'Django','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'django.core.handlers.base.BaseHandler.handle_uncaught_exception';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Django framework','django.core.handlers.base.BaseHandler.handle_uncaught_exception','BaseHandler.handle_uncaught_exception',25,false,'Django','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'bottle.Bottle.__call__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Bottle framework','bottle.Bottle.__call__','Bottle.__call__',25,false,'bottle','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'bottle.HTTPError.__init__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Bottle framework','bottle.HTTPError.__init__','HTTPError.__init__',25,false,'bottle','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'cherrypy.Application.__call__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Cherry framework','cherrypy.Application.__call__','Application.__call__',25,false,'cherrypy','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'cherrypy._cprequest.Request.handle_error';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Cherry framework','cherrypy._cprequest.Request.handle_error','Request.handle_error',25,false,'cherrypy','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'cherrypy.HTTPError.set_response';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Cherry framework','cherrypy.HTTPError.set_response','HTTPError.set_response',25,false,'cherrypy','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'falcon.App.__call__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Falcon framework','falcon.App.__call__','App.__call__',25,false,'falcon','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'falcon.App._handle_exception';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Falcon framework','falcon.App._handle_exception','App._handle_exception',25,false,'falcon','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'pyramid.Router.__call__';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Pyramid framework','pyramid.Router.__call__','Router.__call__',25,false,'pyramid','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'pyramid.Router.handle_request';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Pyramid framework','pyramid.Router.handle_request','Router.handle_request',25,false,'pyramid','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'tornado.web.FallbackHandler.initialize';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Tornado framework','tornado.web.FallbackHandler.initialize','FallbackHandler.initialize',25,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'tornado.web.RequestHandler._execute';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Tornado framework','tornado.web.RequestHandler._execute','RequestHandler._execute',25,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'tornado.web.RequestHandler.flush';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Tornado framework','tornado.web.RequestHandler.flush','RequestHandler.flush',25,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'tornado.web.RequestHandler._handle_request_exception';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Tornado framework','tornado.web.RequestHandler._handle_request_exception','RequestHandler._handle_request_exception',25,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'tornado.web.RequestHandler.finish';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Tornado framework','tornado.web.RequestHandler.finish','RequestHandler.finish',25,false,'tornado','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Adding columns in dl_data table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN trace_name varchar(255);
ALTER TABLE config_$CONTROLLER_NAME.dl_data add COLUMN measure_trace_list varchar(255);
+`
show_error

#Changes for Default value of stack trace should be 50.
Error=`psql test cavisson 2>&1<<+

UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1%201%200%2050' where  key_id = 16;
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '50' where  key_id = 18;
+`
show_error

#Supporting Backend Naming Rule in RABBITMQ callout for DotNet agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'MQ' where  backend_type_id = 72;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true , port = false ,protocol=false WHERE backend_type_id = 72 AND profile_id = 888888;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MySQLdb.connections.Connection.cursor.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','MySQLdb.connections.Connection.cursor.execute','MySQLdb.connections.Connection.cursor.execute',78,false,'MySQLdb','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Supporting Backend Naming Rule in HTTP callout for Python agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'HTTP' where  backend_type_id = 77;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true WHERE backend_type_id = 77 AND profile_id = 999999;
+`
show_error

#Supporting Backend Naming Rule in SQL callout for Python agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'DB' where  backend_type_id = 78;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true ,  database_name = true , protocol = false WHERE backend_type_id = 78 AND profile_id = 999999;
+`
show_error

#changes regarding default_Go support
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile(profile_id,profile_name,profile_desc,controller_name,agent)
VALUES
(555555,'default_Go','Default profile for Go','-','Go');
+`
show_error

#Inserting new backend type HTTP_CALLOUT for GO
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 82;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X82" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (82,'Entry Point to capture HTTP Calls.','HTTP_CALLOUT','HTTP_CALLOUT','None','Go');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,82,555555);
+`
show_error
fi
fi

#Inserting new backend type SQL_CALLOUT for GO
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 83;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X83" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (83,'Entry Point to capture SQL Calls.','SQL_CALLOUT','SQL_CALLOUT','None','Go');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,83,555555);
+`
show_error
fi
fi

#Inserting new backend type MONGO_CALLOUT for GO
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 84;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X84" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (84,'Entry Point to capture MONGO Calls.','MONGO_CALLOUT','MONGO_CALLOUT','None','Go');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,84,555555);
+`
show_error
fi
fi

#Inserting new backend type PGSQL_CALLOUT for GO
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 85;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X85" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (85,'Entry Point to capture PGSQL Calls.','PGSQL_CALLOUT','PGSQL_CALLOUT','None','Go');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,85,555555);
+`
show_error
fi
fi

#Inserting new backend type CASSANDRA_CALLOUT for GO
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 86;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X86" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (86,'Entry Point to capture CASSANDRA Calls.','CASSANDRA_CALLOUT','CASSANDRA_CALLOUT','None','Go');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,86,555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'http.RoundTripper.RoundTrip';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for Go','http.RoundTripper.RoundTrip','http.RoundTripper.RoundTrip',82,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavlib.conn.QueryContext';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for Go','cavlib.conn.QueryContext','cavlib.conn.QueryContext',83,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavwrapperlib.github.commandMonitor1.started';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_CALLOUT for Go','cavwrapperlib.github.commandMonitor1.started','cavwrapperlib.github.commandMonitor1.started',84,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavwrapperlib.github.commandMonitor.started';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO_CALLOUT for Go','cavwrapperlib.github.commandMonitor.started','cavwrapperlib.github.commandMonitor.started',84,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavlib.queryHook.BeforeQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PGSQL_CALLOUT for Go','cavlib.queryHook.BeforeQuery','cavlib.queryHook.BeforeQuery',85,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavlib.queryHook1.BeforeQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'PGSQL_CALLOUT for Go','cavlib.queryHook1.BeforeQuery','cavlib.queryHook1.BeforeQuery',85,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavwrapperlib.github.Observer.ObserveQuery';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CASSANDRA_CALLOUT for Go','cavwrapperlib.github.Observer.ObserveQuery','cavwrapperlib.github.Observer.ObserveQuery',86,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'cavwrapperlib.github.Observer.ObserveBatch';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CASSANDRA_CALLOUT for Go','cavwrapperlib.github.Observer.ObserveBatch','cavwrapperlib.github.Observer.ObserveBatch',86,false,'cavwrapperlib','Go');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),555555);
+`
show_error
fi
fi

#Supporting Backend Naming Rule in HTTP callout for Go agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'HTTP' where  backend_type_id = 82;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true WHERE backend_type_id = 82 AND profile_id = 555555;
+`
show_error

#Supporting Backend Naming Rule in SQL callout for Go agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'DB' where  backend_type_id = 83;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true ,  database_name = true , protocol = false WHERE backend_type_id = 83 AND profile_id = 555555;
+`
show_error


#=====================Changes for supporting JakartaEE service entry for Java agent=============================
#Check entry_type_id 26 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =26;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X26" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (26, 'description', 'JakartaEE');
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'jakarta.servlet.http.HttpServlet.service(Ljakarta/servlet/http/HttpServletRequest;Ljakarta/servlet/http/HttpServletResponse;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Jakarta Servlet ','jakarta.servlet.http.HttpServlet.service(Ljakarta/servlet/http/HttpServletRequest;Ljakarta/servlet/http/HttpServletResponse;)V','HttpServlet.service(Ljakarta/servlet/http/HttpServletRequest;Ljakarta/servlet/http/HttpServletResponse;)',26,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'jakarta.servlet.http.HttpServlet.service(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Jakarta Servlet ','jakarta.servlet.http.HttpServlet.service(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;)V','HttpServlet.service(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;',26,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;)V';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture transaction flow for Jakarta Servlet ','org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;)V','ApplicationFilterChain.doFilter(Ljakarta/servlet/ServletRequest;Ljakarta/servlet/ServletResponse;)V',26,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Changes for Description field for keywords.
Error=`psql test cavisson 2>&1<<+
alter table config_$CONTROLLER_NAME.keywords alter column key_desc type character varying(500);
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Query for cloudant DB' where  key_name = 'addObjectInQueryForCloudant';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable agent code trace.' where  key_name = 'AgentTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Name of the Logger used by application.' where  key_name = 'appLoggerType';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Applog trace level' where  key_name = 'AppLogTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable allocation of buffers in case AS data send failed' where  key_name = 'ASAllocateDataBuffOnFailure';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Maximum number of allocated AS data buffers' where  key_name = 'ASDataBufferMaxCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Minimum number of allocated AS data buffers' where  key_name = 'ASDataBufferMinCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor Data Buffer Size in kilobytes' where  key_name = 'ASDataBufferSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Minimum stack depth for a thread to considered as hotspot' where  key_name = 'ASDepthFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Provides ability to Ignore BLOCKED threads from Filtering and process directly for comparison of their stacks' where  key_name = 'ASDoNotFilterBlocked';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable dumping flowpath instance for thread in hotspot summary report' where  key_name = 'ASEnableFPSummaryReport';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable hotspot record in dotnet.' where  key_name = 'ASEnableHotspotRecord';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor hotspot mode (0-thread hotspot 1-methodHotspot)' where  key_name = 'ASMethodHotspots';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of thread names (with & as separator) to be excluded from AS data even if they qualify for hotsport threads' where  key_name = 'ASNegativeThreadFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of thread names (with & as separator) to be included in AS data even if they don''t qualify for hotspot threads' where  key_name = 'ASPositiveThreadFilters';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor report Buffer max Size in bytes' where  key_name = 'ASReportBufferMaxSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor report data dumping mode (0-never 1-socket 2-file 3-both)' where  key_name = 'ASReportDumpMode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor interval for reporting hotspot threads to ND Collector' where  key_name = 'ASReportInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Percent data buffers to be freed for resuming auto sensor data, which got suspended when data buffers were full' where  key_name = 'ASResumeDataBuffFreePct';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Duration between capturing two consecutive samples of stack traces of active threads' where  key_name = 'ASSampleInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor option for comparing stack trace of threads (1-Hashcode of stack elements, 2-Value of stack elements)' where  key_name = 'ASStackCompareOption';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto sensor stack depth upto which two stack traces will be compared for a thread across sampling intervals' where  key_name = 'ASStackComparingDepth';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable reporting of count of threads in different states' where  key_name = 'ASStateReport';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto Sensor stack trace count for marking thread as Hotspot' where  key_name = 'ASThresholdMatchCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto sensor trace level' where  key_name = 'ASTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Exception record dumped in logger and Addtry' where  key_name = 'backendErrorDetectionMode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max number of data buffers' where  key_name = 'bciDataBufferMaxCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max data buffer size in bytes' where  key_name = 'bciDataBufferMaxSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Number of data buffers to be increased when current buffers are full' where  key_name = 'bciDataBuffIncreament';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Fraction percent number of requests for which flowpath is generated. In case a URL request has NS generated FP Instance, BCI does nothing.' where  key_name = 'bciInstrSessionPct';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='enable Log capturing on console also' where  key_name = 'BCILoggingMode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='sleep interval for logging threads, default value in long -300 milisecond' where  key_name = 'bciLogSleepInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max number of non service methods in a flowpath' where  key_name = 'bciMaxNonServiceMethodsPerFP';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max number of service methods in a flowpath' where  key_name = 'bciMaxServiceMethodsPerFP';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max NDNF data buffer size in bytes and count of buffer' where  key_name = 'bciNDNFDataBufferSetting';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max trace log size of BCI.' where  key_name = 'BCITraceMaxSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable pagename for JSP service method' where  key_name = 'bciUriLogLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max string length of URI including Query parameter as processed in BCI' where  key_name = 'bciUriMaxLength';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Aggregate Data Size for  Business Transaction Monitor' where  key_name = 'BTAggDataArraySize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contains different error rules based upon status code, redirects etc. using which identification of error catagory is done for a BT. ' where  key_name = 'BTErrorRules';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the rules to be defined for every transactions for the purpose of naming, the rule will be applied at global level for all transaction for now.' where  key_name = 'BTRuleConfig';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Defines Method data Business Transaction override policy. (0 - dont override any thing, 1 - override always, and 2 - override only once at first occurance)' where  key_name = 'BTRuleOverridePolicy';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the rules to be defined for every transactions for the purpose of capturing custom headers.' where  key_name = 'captureCustomData';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture MongoDB Document' where  key_name = 'captureDocumentforMongo';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='enable capturing of message based Exception record.' where  key_name = 'captureErrorLogs';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable BCI Trace level for exceptions capturing' where  key_name = 'captureExceptionTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Request body for full flowpath' where  key_name = 'captureHTTPReqBodyFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Request body for level one flowpath' where  key_name = 'captureHTTPReqBodyL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Request headers for full flowpath' where  key_name = 'captureHTTPReqFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Request headers for level one flowpath' where  key_name = 'captureHTTPReqL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Response body for full flowpath' where  key_name = 'captureHTTPRespBodyFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Response body for level one flowpath' where  key_name = 'captureHTTPRespBodyL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Response headers for full flowpath' where  key_name = 'captureHTTPRespFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture Http Response headers for level one flowpath' where  key_name = 'captureHTTPRespL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable HTTP Session Attribute trace log, default value is 1 ' where  key_name = 'captureHttpSessionTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable HTTP trace log, default is off' where  key_name = 'captureHttpTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='dump all instrumented non service method for level one flowpaths as well.' where  key_name = 'captureMethodForAllFP';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the URL List for which the cookie will be set ' where  key_name = 'cavNVURLFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable capturing of independent query' where  key_name = 'collectIndependentQuery';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable common code control thread trace.' where  key_name = 'ControlThreadTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable correlation btw event and its callback' where  key_name = 'correlateEventCallback';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='HTTP Header Name for Correlation ID' where  key_name = 'correlationIDHeader';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Timeout in minutes while waiting for stop instrumentation on control connection after retry message recieved on new control channel. On this timeout, BCI sends a stop_instrumentation message OK Response and closes all the connections' where  key_name = 'ctrlConnIdleTimeMaxCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Fixed Database integration point name to combine db calls in one itegration points where sometime sqlconnection object doesn''t have proper information or connection object is not available' where  key_name = 'DBIPName';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='After Identifying the category for levelone flowpath if we want to dump all than this keyword will be usefull with val=1' where  key_name = 'doNotDiscardFlowPaths';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enabling default cassandra query dumping' where  key_name = 'dumpDefaultCassandraQuery';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable new format of method exit call stack' where  key_name = 'dumpOnlyMethodExitInFP';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable instrumentation of SQL Query' where  key_name = 'dumpSQLQuery';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable dumping of thread Id in Method Entry and exit' where  key_name = 'dumpThreadIdInSeqblob';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This keyqord will dynamically set threshold for each BT on basis of lastfive samples''s response time.' where  key_name = 'dynamicSlowVslowThreshold';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable adding header record for Endeca' where  key_name = 'enableAddingHdrForEndeca';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable transaction based hotspot' where  key_name = 'enableASTransactionHotspot';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='disable' where  key_name = 'enableAutoDetectPlayEntryPoint';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Backend monitor' where  key_name = 'enableBackendMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Backend Callout trace level' where  key_name = 'enableBackendMonTrace';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable BCI debug log, default is on with low level ' where  key_name = 'enableBciDebug';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable BCI error log, default is off.Syntax- <errorlevel><%20><stackdepth(if level is 3)> : levels - 0 -off, 1- on, 2-on with complete stacktrace, 3- on with specified stack trace (if with 3 no stacktrace depth specified, than BCIAgent will considere for 9999 depth) depth- if level 3 is choosen and depth value is specified than upto that depth stacks of exception will be captured.' where  key_name = 'enableBciError';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable BCI Leaky Bucket For Percentage Feature' where  key_name = 'enableBciPctLeakyBucket';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/disable request responsebody capture' where  key_name = 'enableBodyCapture';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Business Transaction Monitor' where  key_name = 'enableBTMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Business Transaction Monitoring Trace' where  key_name = 'enableBTMonitorTrace';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='callback exception for .Net Agent.' where  key_name = 'enableCallBackException';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Integration call capture outside transaction, also used to provide debug record configurtaion' where  key_name = 'enableCaptureDataOutsideTxn';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable capture network delay' where  key_name = 'enableCaptureNetDelay';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable capture Socket Stacktrace' where  key_name = 'enableCaptureSocketStackTrace';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing Json config for exception variable capturing.' where  key_name = 'enableCaptureVarForException';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable check Adapter in Instrumentation' where  key_name = 'enableCheckAdapter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Child thread related configuration,if it is 0 then filtering is disable,else filter out thread calls based on the value of threshold(Fp Duration).' where  key_name = 'enableChildFPFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Cloudant mode - 1 for Old 2 for New mode where default is 2' where  key_name = 'enableCloudantBackendMode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable Cpu Profiling with different mode ( 0- disable, 1- enable at flowpath / BT level, 2- enable at method level, 3- enable at bot method and flowpath level, 1%201 - enable cpu time capturing for only flowpath level where child flowpath cpu time will also be added in bt monitor data , 3%201 - enable cpu time capturing for method & BT level where child fp genereated by thread callout will also be added in cpu time for bt monitor ' where  key_name = 'enableCpuTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable DB BackendName' where  key_name = 'enableDBBackendName';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture DB Query Parameter Values, it may have performance impact due to increase in traffic and storage' where  key_name = 'enableDBQueryParamValues';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='ndcBciDataConnectionHeartBeat keyword to send hartbeat on data connection' where  key_name = 'enableDCHeartBeat';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable asyncID correlation btw event and its callback' where  key_name = 'enableDumpAsyncId';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable error capturing on redirection page' where  key_name = 'enableErrorRedirectionPage';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='enable capturing of e records in Seq Blob.' where  key_name = 'enableExceptionInSeqBlob';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable exception capturing with advanced mode. 0- disable, 1-enable with source code, 2-enable with variables, 3-enable with sourcecode and variables' where  key_name = 'enableExceptionsWithSourceAndVars';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='enable exceution of executeBatch method for oracle.' where  key_name = 'enableExecuteBatch';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Executor related configuration, space (%20) separated 2 fields: Enable/Disable<0/1> Executor trace level<0-6>' where  key_name = 'enableExecutorInterfaceCapturing';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable exception capturing with advanced mode trace level. 0- disable, more than 0 enable ' where  key_name = 'enableExSrcTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable filtering of jedis methods' where  key_name = 'enableFilterForJedisClient';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable Forced Flowpath Chain with modes 0- disable, 1- enable to not discard any child fp, 2- enable not to discard and also complete child flowpaths' where  key_name = 'enableForcedFPChain';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='method response configuration, space (%20) separated 6 fields:enable/disable<1/0> duration in ms<5> depth of the stack trace<5> maximum count of the stack trace per transaction<%> maximum duration between stack trace in ms <10> enable/disable this feature for call out method only <0/1>' where  key_name = 'enableFPMethodStackTrace';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable Flowpath related special logs like - number of flowpaths for different categories' where  key_name = 'enableFPTrace';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Java GC Monitoring' where  key_name = 'enableGCMonitoring';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Heartbit message debug log level 0 - donot log anything 1 - log only heartbit message , more than 1 log data channel infor and instrumentation busy flag aswell' where  key_name = 'enableHeartBeatLog';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This capturs Hotspot LonkStack info on particular node server.' where  key_name = 'enableHSLongStack';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable Instrumenting all Classes automatically which implements targeted interfaces using NDInterfaceFile keyword' where  key_name = 'enableInterfaceInstr';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Resource URL' where  key_name = 'enableIPForNodeJS';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='generates E record and exception data on the basis of status code.' where  key_name = 'enableIPStatusCode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Java GC Monitoring' where  key_name = 'enableJavaGCMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable generic jdbc capturing' where  key_name = 'enableJdbcInterfaceCapturing';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable generic jms capturing' where  key_name = 'enableJmsInterfaceCapturing';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable JVM Thread monitoring with specified duration and after %20 give targeted cpu time percentage, than at the last field after %20 give 1 for donot delete reported vectors' where  key_name = 'enableJVMThreadMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable MDC based ND-NF integration for application log' where  key_name = 'enableMDCLogMsgForNF';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable merging of parent with child flowpath.' where  key_name = 'enableMergeThreadCallouts';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable Method BreakDown Profiling with different mode ( 0- disable, 1- enable at flowpath / BT level, 2- enable at method level, 3- enable at both method and flowpath level, 1%201 - enable method breakDown time capturing for only flowpath level where child flowpath method breakdown time will also be calculated , 3%201 - enable cpu time capturing for method & BT level where child fp generated by thread callout will also be added in method breakdown time.' where  key_name = 'enableMethodBreakDownTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='e.g enableNDNFDataTransfer=1%20172.24.0.215%3B9200%3B/_nfparse' where  key_name = 'enableNDNFDataTransfer';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Syntax - MethodEntryDepth%20MethodExitDepth%20OnResponseCommit%20SetResponseHeader%20CookieName%20domain%20idle-timeout%20maxFPAllowedInSession' where  key_name = 'enableNDSession';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable auto inject NV Tag' where  key_name = 'enableNVInjectingTag';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable transform thread' where  key_name = 'enableOptimizedInstrumentation';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable OpenTelemetry keyword' where  key_name = 'enableOTELStandard';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable enableProcessNotificationPhase keyword' where  key_name = 'enableProcessNotificationPhase';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable reactor library support' where  key_name = 'enableReactorLibSupport';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the patterns for applying filters for targeted classes' where  key_name = 'enableSourceCodeFilters';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Thread call out' where  key_name = 'enableThreadCallout';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable BCI Trace level for thread cpu monitoring' where  key_name = 'enableThreadMonTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable TracePointMonitor' where  key_name = 'enableTracePointMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable transformation of thread sub class' where  key_name = 'enableTransformThreadSubClass';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable application log messages updation with BCI flowpaths in it.' where  key_name = 'enableUpdateLogMsgForNF';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Queue Time' where  key_name = 'enableWaitSyncQueueTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max stack depth for JSP Service methods as displayed in Flowpath Sequence Diagram' where  key_name = 'entryMethodMaxDepth';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This keyword will give the min, max average time taken by eventLoop.' where  key_name = 'eventLoopMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='enable excluding of methods which are taking more time then keyword value.' where  key_name = 'excludeMethodOnRespTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Interval in milliseconds for flushing raw data on socket' where  key_name = 'flushInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='URL formatting related configuration, space (%20) separated 3 fields: Enable/Disable<0/1> urloffsetvalue<0-256> maxURLChar<0-256> ' where  key_name = 'formatIPResourceURL';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc=' BCIAgent will use value of FPGMode and flowpath will be generated by BCI' where  key_name = 'FPGMode';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Whenever an entry point method is encountered, flowpath age is checked. If exceeds this value, flowpath is cleared and new is started' where  key_name = 'FPMaxAllowedAgeInSec';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Generating Flowpath ID, NOTE:- Not for User' where  key_name = 'fpVersionID';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This keyword will give GC and heap usage info' where  key_name = 'gcProfiler';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the name of exceptions generated in any method' where  key_name = 'generateExceptionConfFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc=' Generate exception in given method generateExceptionInMethod=[numPercentage]%20[FQM(Replace ; with %3B)]' where  key_name = 'generateExceptionInMethod';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable New Backend Monitor With TierID,ServerID' where  key_name = 'genNewMonRecord';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This keyword is just an acknowledgement to BCIAgent for helping him to identify Current NDC/NDP is having new latest patch of NDC, so BCI can send 22,23 records instead 21.If this keyword not present BCI must send 21 records for both prepared and non prepared queries metarecord' where  key_name = 'genNewSQLRecords';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc=' It will Grouped those queries which will take less time to given threshold' where  key_name = 'groupedQueryThreshold';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Comma Separated list of HTTP headers whose value shall be sent as ID in HTTP response discovery record' where  key_name = 'hdrListForValueAsId';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the HTTP header capture conditions' where  key_name = 'HTTPStatsCondCfg';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Exceptions related configuration, space (%20) separated 3 fields: Enable/Disable<0/1> CaptureStackTrace<0/1> StackTraceAsID<0/1> StackTraceDepth<1-9999>' where  key_name = 'instrExceptions';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable application log messages on applog data connection' where  key_name = 'instrLog4J';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Instrumentation profile FQ or relative pathname from $NS_WDIR/instrprof/.whitelist/' where  key_name = 'instrProfile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Timeout in minutes while waiting for instrument profile content. BCI sends an error message  and closes all the connections' where  key_name = 'instrProfileContentMaxIdleTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Capture BCI trace log for instrumenting constraints' where  key_name = 'InstrTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Intrumentation level globally' where  key_name = 'instrumentationLevelMethod';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing jedis method names, which can be added or removed at run time' where  key_name = 'jedisCommands';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Generate flowpaths for all requests, dump exit and entry records of only first instrumented method where FP is neither enabled from NS nor by BCI' where  key_name = 'logLevelOneFpMethod';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable URL discovery (7) and Flowpath mapping (9) records in BCI ND data. Applicable only when logNonNSFlowpath is enabled' where  key_name = 'logNonNSUrlAndQueryRecord';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to set size of Async Map' where  key_name = 'maxAsyncDetailMapSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='If Number of business transactions crosses this value newly urls will be known as other transactions' where  key_name = 'maxBTCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Maximum no. of characters in a sequence block' where  key_name = 'maxCharInSeqBlob';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to set exception message length.' where  key_name = 'maxExceptionMessageLength';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='set max limit for header value, default value is 4096 character in kb - 4KB' where  key_name = 'maxFieldValueLength';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='define maximum size of http request body size' where  key_name = 'maxHttpBodySize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='If Number of IP crosses this value newly discovered IP will be known as Other IPs' where  key_name = 'maxIPCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to set size of query Map' where  key_name = 'maxQueryDetailMapSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='set max limit for header record, default value is 16384 character in kb - 16KB' where  key_name = 'maxRecordValueLength';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to set size of Resource Map' where  key_name = 'maxResourceDetailMapSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Auto sensor max stack depth difference in two samples. if difference is greater than this then do not compare and mark it as not matched' where  key_name = 'maxStackSizeDiff';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to set size of thread based hotspot' where  key_name = 'maxThreadsforTransactionHostspot';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='method response configuration, space (%20) separated 3 fields: Enable/Disable<0/1> normalMethodResponseTime<2> slowVerySlowMethodResponseTime<5>' where  key_name = 'methodResponseTimeFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='0-Disable agent logs/1-Enable logging at server/2-enable logging at Proxy' where  key_name = 'ndAgentDebugLogging';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the Logging Framework List' where  key_name = 'NDAppLogFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the rules to be defined for making transaction async.' where  key_name = 'NDAsyncRuleConfig';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing backend points' where  key_name = 'ndBackendMonFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the rules with definations w.r.t each type of backend calls' where  key_name = 'ndBackendNamingRulesFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing BCI Config files which will be critical for start_instrumentation process' where  key_name = 'ndCriticalFileKeyword';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename contains DD AI Settings' where  key_name = 'ndDynamicDiagnosticsConfFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable transaction hotspot record in dotnet.' where  key_name = 'ndEnableTxHotspot';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing Config class or method names, which can be added or removed at run time' where  key_name = 'NDEntryPointsFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Comma separated list of exceptions to filter out' where  key_name = 'ndExceptionFilterList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the Exception List ' where  key_name = 'ndExceptionMonFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of Filename containing the Exception List ' where  key_name = 'ndExceptionMonFileList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the classes which is throwing exception and NDAgent will not capture them' where  key_name = 'ndExceptionThrowingClassFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of Filename containing the Logging Framework List' where  key_name = 'ndGenLogCaptureFileList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Set helper depth in dotnet.' where  key_name = 'ndHelperDepth';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable hotspot limit in dotnet.' where  key_name = 'ndHotspotThreadLimit';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of Filename containing the HTTP header capture conditions' where  key_name = 'ndHttpCondMonFileList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of Filename containing the configured list of HTTP headers to be captured in HTTP' where  key_name = 'ndHttpHdrCaptureFileList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the configured list of HTTP headers to be captured in HTTP Response for Full Flowpaths' where  key_name = 'NDHTTPRepHdrCfgListFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the configured list of HTTP headers to be captured in HTTP Response for Level 1 Flowpaths' where  key_name = 'NDHTTPRepHdrCfgListL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the configured list of HTTP headers to be captured in HTTP Request for Full Flowpaths' where  key_name = 'NDHTTPReqHdrCfgListFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the configured list of HTTP headers to be captured in HTTP Request for Level 1 Flowpaths' where  key_name = 'NDHTTPReqHdrCfgListL1Fp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='ILRewritte File for DotNet agent ' where  key_name = 'ndILRewritterFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing Config interface method names, which can be added or removed at run time' where  key_name = 'NDInterfaceEntryPointsFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing all targeted Interfaces through which BCI will auto instrument all implementing classes' where  key_name = 'NDInterfaceFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Java GC feature trace level' where  key_name = 'ndMBeanMonTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing the Methods List To Monitor ' where  key_name = 'ndMethodMonFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='List of Filename containing the Methods List To Monitor ' where  key_name = 'ndMethodMonFileList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable BCI Trace level for method monitoring feature' where  key_name = 'ndMethodMonTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing Json data for Trace point, which can be added or removed at run time.' where  key_name = 'ndMethodTracePointFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Module File for DotNet agent and it contains module' where  key_name = 'ndModuleFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Interval in milliseconds for sending Monitor report data message from BCI to ND Collector' where  key_name = 'ndMonitorInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc=' is given that after how much time data is to flushed to NF' where  key_name = 'NDNFFlushInterval';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Pool file for DotNet agent and it constains pools' where  key_name = 'ndPoolFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Processor file for DotNet agent and it contains processes' where  key_name = 'ndProcessesFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Filename containing Json data consisting of black list and white list.' where  key_name = 'NDTryCatchInstrFilterList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This Monitor gives asynchronous events info' where  key_name = 'nodeAsyncEventMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Profile CPU for particular time for nodejs agent, it is in seconds.' where  key_name = 'nodejsCpuProfilingTime';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This Monitor gives server req/res info on particular node server' where  key_name = 'nodeServerMonitor';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the rules for injecting NV Tag' where  key_name = 'NVAutoInjectionRuleFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Cookie name which contains CavSID and CavPI information.' where  key_name = 'NVCookie';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc=' Put delay in given method putDelayInMethod=[time_in_secs]%20[FQM(replace ; with %3B)]' where  key_name = 'putDelayInMethod';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='keyword to remove instrumentation from classes after  auto-Instrumentation session is completed and Retain changes is enabled' where  key_name = 'removeAutoInstrumentations';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='This file will contain all the classes types for which superclass is not object' where  key_name = 'SafetyNetClassTypesFile';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Size of the socket buffer' where  key_name = 'socketBufferSize';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Exclude non prepared queries. Multiple queries may be specified using & as separator' where  key_name = 'SQLNonPreparedQueryFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Exclude prepared queries. Multiple queries may be specified using & as separator.' where  key_name = 'SQLPreparedQueryFilter';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable SQL trace log, default is off' where  key_name = 'SQLTraceLevel';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable btstatuscode accessibility' where  key_name = 'statusCodeAccessible';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='t digest instance level dump keyword' where  key_name = 'tDigestInstanceLevelDump';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='t digest configuraion, <Mode> 1 means normal encoding - no compression; 2 means dump as small bytes (asSmallBytes()), <Delta> - The compression factor, the max fraction of mass that can be owned by one centroid. <K> - Number of centroids in t-digest, <gdf id>, <graph id>.' where  key_name = 'tDigestPercentileBT';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='t digest configuraion, <Mode> 1 means normal encoding - no compression; 2 means dump as small bytes (asSmallBytes()), <Delta> - The compression factor, the max fraction of mass that can be owned by one centroid. <K> - Number of centroids in t-digest, <gdf id> <graph id>.' where  key_name = 'tDigestPercentileIP';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable ThreadCallout Capturing' where  key_name = 'threadCalloutDepth';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='After Every threadCleanUpCount times of monitor interval thread checkup will occur to find dead threads And clean theier objects from BCI memory' where  key_name = 'threadCleanUpCount';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Enable/Disable Capturing of ThreadDump through BCI in new format' where  key_name = 'threadDumpFormat';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Interval in seconds for thread idle time out' where  key_name = 'threadIdleTimeout';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max string length of URI query string as dumped in Flowpath Mapping (9) record' where  key_name = 'uriQueryLength';
UPDATE config_$CONTROLLER_NAME.keywords SET key_desc='Max string length of URL name for BCI discovered URLs as dumped in URL Discovery (7) record' where  key_name = 'urlLength';
+`
show_error

#Support of ByDefault exception error
data_exists=$(psql --user=cavisson -d test -t --no-align -c "select count(*) from config_$CONTROLLER_NAME.exception_monitors where profile_id = 1;")
if [ $data_exists -eq 0 ]
then
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(exception_id) FROM config_work.exception_monitors;")
if [ "X$MAX_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.exception_monitors(exception_id, exception_desc, exception_display_name, exception_name , profile_id) VALUES
(101,'Exceptions thrown in application havoc','Application Havoc Exception','com.cavisson.ndutils.NDHavocException',1)
+`
show_error
else
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.exception_monitors(exception_id, exception_desc, exception_display_name, exception_name , profile_id) VALUES
($(($MAX_ID + 1)),'Exceptions thrown in application havoc','Application Havoc Exception','com.cavisson.ndutils.NDHavocException',1)
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 42;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MemCache Backend','Command','Command',42,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 41;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Zookeeper Backend','Command','Command',41,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi

#Supporting enableGoroutineMonitor Keyword
#Check key_name enableGoroutineMonitor exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableGoroutineMonitor';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableGoroutineMonitor','0','1','2','0','pre-custom','31');
+`
show_error
fi
fi

#Supporting enableGCMonitor Keyword
#Check key_name enableGCMonitor exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableGCMonitor';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode) VALUES ($(($MAX_ID + 1)),'enableGCMonitor','0','1','2','0','pre-custom','31');
+`
show_error
fi
fi

#Changing the default value of ndExceptionMonFile to false
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = 'true' WHERE key_name = 'ndExceptionMonFile';
+`
show_error

#Insert Entry for default_Go in bussiness_trans_global table
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.bussiness_trans_global(bt_global_id, complete, dynamic_req_type, dynamic_req_value, http_method, request_header, request_param, segment_type, segment_uri,segment_value, slow_transaction, uri_type, very_slow_transaction, profile_id, slow_threshold, very_slow_threshold, segment_no) VALUES
(6, false, false,'httpMethod', true, false, false, 'FromFirst', true, 2, 3000, 'segmentOfURI', 5000,555555, '10', '20','');
+`
show_error

#Changing the default value of enableGCMonitor to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'enableGCMonitor';
+`
show_error

#Changing the default value of enableGoroutineMonitor to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'enableGoroutineMonitor';
+`
show_error

#Adding new column monitoring_profile_name in topo_profile_assoc table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.topo_profile_assoc ADD COLUMN monitoring_profile_name varchar(255);
+`
show_error

#Increasing the character limit for method_name in method_monitors table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ALTER COLUMN method_name TYPE character varying(2048);
+`
show_error

#New EntryPoint support for HTTP_CALLOUT in Python Agent
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'http.client.HTTPConnection.putrequest';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP_CALLOUT for python','http.client.HTTPConnection.putrequest','http.client.HTTPConnection.putrequest',77,false,'requests','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Adding new column topo_id in ndc_keyword_asso table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.ndc_keyword_asso ADD COLUMN topo_id bigint;
ALTER TABLE config_$CONTROLLER_NAME.ndc_keyword_asso ADD CONSTRAINT ndc_keyword_asso_topo_id_fk FOREIGN KEY (topo_id) REFERENCES config_$CONTROLLER_NAME.topo_details (topo_id);
+`
show_error

#changes regarding exception_display_name from Application Havoc Exception to NDHavocException in exception_monitors
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.exception_monitors SET exception_display_name = 'NDHavocException' where  exception_display_name ='Application Havoc Exception' ;
+`
show_error

#Changes To Support mergeFlowpathForThreadCalls Keyword

KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'mergeFlowpathForThreadCalls';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'mergeFlowpathForThreadCalls','0','1','2','1','custom','1','Enable/Disable merging of flowpath for thread Callouts');
+`
show_error
fi
fi

#Changing the default value bciMaxServiceMethodsPerFP of to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '5' WHERE key_name = 'bciMaxServiceMethodsPerFP';
+`
show_error

#Disabling OraclePreparedStatement and oracleDB from UI
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = 19;
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = 119;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.io.PrintStream.print(Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CUSTOM LOG end point','java.io.PrintStream.print(Ljava/lang/String;)V','java.io.PrintStream.print(Ljava/lang/String;)V',13,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.io.PrintStream.println(Ljava/lang/String;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'CUSTOM LOG end point','java.io.PrintStream.println(Ljava/lang/String;)V','java.io.PrintStream.println(Ljava/lang/String;)V',13,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Changing the default value dumpThreadIdInSeqblob of to 1
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'dumpThreadIdInSeqblob';
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.execute(Ljava/lang/String;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OracleStatement.execute(Ljava/lang/String;)Z','OracleStatement.execute(Ljava/lang/String;)Z',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OracleStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;','OracleStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.executeUpdate(Ljava/lang/String;)I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OracleStatement.executeUpdate(Ljava/lang/String;)I','OracleStatement.executeUpdate(Ljava/lang/String;)I',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava/sql/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava/sql/ResultSet;','OraclePreparedStatement.executeQuery()Ljava/sql/ResultSet;',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.execute()Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatement.execute()Z','OraclePreparedStatement.execute()Z',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()I','OraclePreparedStatement.executeUpdate()I',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeBatch()[I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatement.executeBatch()[I','OraclePreparedStatement.executeBatch()[I',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery()Ljava/sql/ResultSet;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery()Ljava/sql/ResultSet;','OraclePreparedStatementWrapper.executeQuery()Ljava/sql/ResultSet;',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.execute()Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatementWrapper.execute()Z','OraclePreparedStatementWrapper.execute()Z',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate()I';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'JDBC Connection end point','oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate()I','OraclePreparedStatementWrapper.executeUpdate()I',3,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#To delete Oracle endpoints from DB
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =119 OR end_point_id =19 OR end_point_id =120;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =119 OR end_point_id =19 OR end_point_id =120;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.execute(Ljava/lang/String;)Z';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet;';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OracleStatement.executeUpdate(Ljava/lang/String;)I';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava/sql/ResultSet;';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.execute()Z';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()I';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatement.executeBatch()[I';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery()Ljava/sql/ResultSet;';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.execute()Z';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate()I';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

#Changing the default value of enableDCHeartBeat to 300
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '300' WHERE key_name = 'enableDCHeartBeat';
+`
show_error

#Check entry_type_id 27 exists in config_$CONTROLLER_NAME.entry_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_type_id from config_$CONTROLLER_NAME.entry_type where entry_type_id =27;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X27" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.entry_type(entry_type_id, entry_type_detail, entry_type_name) VALUES (27, 'description', 'PlayServiceEntry');
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'play.core.j.JavaAction.apply(Lplay/api/mvc/Request;)Lscala/concurrent/Future;';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture play framework','play.core.j.JavaAction.apply(Lplay/api/mvc/Request;)Lscala/concurrent/Future;','play.core.j.JavaAction.apply(Lplay/api/mvc/Request;)Lscala/concurrent/Future;',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
ENTRY_FQM='play.api.mvc.Action.$anonfun$apply$4(Lplay/api/mvc/Action;Lplay/api/mvc/RequestHeader;Lscala/util/Either;)Lscala/concurrent/Future;'
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture play framework','$ENTRY_FQM','$ENTRY_FQM',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Inserting new backend type AsyncHttpCallout for JAVA
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 87;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X87" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (87,'Entry Point to capture AsyncHttp Calls.','AsyncHttpCallout','AsyncHttpCallout','None','Java');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,87,1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;','org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;','org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.asynchttpclient.DefaultAsyncHttpClient.execute(Lorg/asynchttpclient/Request;Lorg/asynchttpclient/AsyncHandler;)Lorg/asynchttpclient/ListenableFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','org.asynchttpclient.DefaultAsyncHttpClient.execute(Lorg/asynchttpclient/Request;Lorg/asynchttpclient/AsyncHandler;)Lorg/asynchttpclient/ListenableFuture;','org.asynchttpclient.DefaultAsyncHttpClient.execute(Lorg/asynchttpclient/Request;Lorg/asynchttpclient/AsyncHandler;)Lorg/asynchttpclient/ListenableFuture;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;','play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onCompleted()Ljava/lang/Object;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;)V','play.shaded.ahc.org.asynchttpclient.AsyncCompletionHandler.onThrowable(Ljava/lang/Throwable;)V',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClient.execute(Lplay/shaded/ahc/org/asynchttpclient/Request;Lplay/shaded/ahc/org/asynchttpclient/AsyncHandler;)Lplay/shaded/ahc/org/asynchttpclient/ListenableFuture;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClient.execute(Lplay/shaded/ahc/org/asynchttpclient/Request;Lplay/shaded/ahc/org/asynchttpclient/AsyncHandler;)Lplay/shaded/ahc/org/asynchttpclient/ListenableFuture;','play.shaded.ahc.org.asynchttpclient.DefaultAsyncHttpClient.execute(Lplay/shaded/ahc/org/asynchttpclient/Request;Lplay/shaded/ahc/org/asynchttpclient/AsyncHandler;)Lplay/shaded/ahc/org/asynchttpclient/ListenableFuture;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi


#To delete wrong entry_fqm from service_entry_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm= 'play.api.mvc.Action.(Lplay/api/mvc/Action;Lplay/api/mvc/RequestHeader;Lscala/util/Either;)Lscala/concurrent/Future;';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_service_entry_asso WHERE entry_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.service_entry_points WHERE entry_id =$KEY_ID;
+`
show_error

#Update for Database Product Name should be enabled by default under JDBC in Integration Point Detection in Java
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET databaseproduct_name = true WHERE backend_type_id = 3 AND profile_id = 1;
+`
show_error

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
ENTRY_FQM='play.http.DefaultActionCreator$1.call(Lplay/mvc/Http$Request;)Ljava/util/concurrent/CompletionStage;'
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture play framework','$ENTRY_FQM','$ENTRY_FQM',27,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check entry_fqm exists in config_$CONTROLLER_NAME.service_entry_points table or not
ENTRY_FQM='scala.concurrent.impl.Promise$Transformation'
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(entry_id) FROM config_$CONTROLLER_NAME.service_entry_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.service_entry_points (entry_id,entry_desc,entry_fqm,entry_name,entry_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry point for capturing play asynchronous transactions.','$ENTRY_FQM','$ENTRY_FQM',23,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Disabling Play entrypoints from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = 'play.core.j.JavaAction.apply(Lplay/api/mvc/Request;)Lscala/concurrent/Future;';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#Disabling Oracle entrypoints from UI
ENTRY_FQM='play.api.mvc.Action.$anonfun$apply$4(Lplay/api/mvc/Action;Lplay/api/mvc/RequestHeader;Lscala/util/Either;)Lscala/concurrent/Future;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#changes regarding updating playAsyncEntryPoint entrypoints
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.service_entry_points SET entry_name = 'java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z' where  entry_fqm ='java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z' ;
UPDATE config_$CONTROLLER_NAME.service_entry_points SET entry_name = 'java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z' where  entry_fqm ='java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z' ;
+`
show_error

 Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '0' WHERE key_name = 'enableAutoDetectPlayEntryPoint';
+`
show_error

Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 60;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 61;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 62;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 63;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 111;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 112;
Update config_$CONTROLLER_NAME.profile_backend_point_asso set enabled = false where end_point_id = 113;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'NLog.Logger.Error';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'NLog.Logger.Info';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'NLog.Logger.Warn';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'NLog.Logger.Debug';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'NLog.Logger.Fatal';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#Disabling playAsyncEntryPoint entrypoints from UI
ENTRY_FQM='java.util.concurrent.CompletableFuture.complete(Ljava/lang/Object;)Z'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#Disabling playAsyncEntryPoint entrypoints from UI
ENTRY_FQM='java.util.concurrent.CompletableFuture.completeExceptionally(Ljava/lang/Throwable;)Z'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'redis.connection.Connection.send_packed_command';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'mod.monitoring.CommandListener.started';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#Changes regarding default values of FlowPathData
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '10' WHERE key_name = 'bciInstrSessionPct';
+`
show_error

#Changes regarding default values Percentile
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1%2010m%202%20100%20100%2010793%201' WHERE key_name = 'tDigestPercentileBT';
+`
show_error

Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1%2010m%202%20100%20100%2010794%201' WHERE key_name = 'tDigestPercentileIP';
+`
show_error


#Changes regarding default values of Integration Point Settings
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1' WHERE key_name = 'enableIPResourceURL';
+`
show_error

#Changes regarding default values of UX-Monitor Sessions
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1%201%201%201%20CavNV%20-%201800%201000' WHERE key_name = 'enableNDSession';
+`
show_error

#Check keyword exists in config_$CONTROLLER_NAME.keywords table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select ndc_key_id from config_$CONTROLLER_NAME.ndc_keywords where ndc_key_name = 'NDP_MAX_SUC_META_DATA_REQ_COUNT_PER_PARTITION';")
MAX_KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select MAX(ndc_key_id) from config_$CONTROLLER_NAME.ndc_keywords;")
if [ $? -eq 0 ]
then
        #if keyword does not exist then insert that row in table
        if [ "X$KEY_ID" == "X" ]
        then
        Error=` psql test cavisson 2>&1<<+
                INSERT INTO config_$CONTROLLER_NAME.ndc_keywords(ndc_key_id, ndc_key_name, ndc_key_min, ndc_key_max, ndc_def_value, ndc_key_val, ndc_key_type) VALUES ($(($MAX_KEY_ID+1)),'NDP_MAX_SUC_META_DATA_REQ_COUNT_PER_PARTITION','','','100','100','')
+`
show_error
fi
fi

#Check key_name ndAgentDebugSession exists in config_$CONTROLLER_NAME.keywords table or not
   KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'ndAgentDebugSession';")
   MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
 if [ $? -eq 0 ]
 then
   #if key_name does not exist then insert that row in table
   if [ "X$KEY_NAME" == "X" ]
   then
Error=`psql test cavisson 2>&1<<+
 INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'ndAgentDebugSession','0','1','2','0','pre-custom','8','Enable ndAgentDebugSession for Debuging');
+`
show_error
   fi
 fi

#Increasing the character limit for method_display_name in method_monitors table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ALTER COLUMN method_display_name TYPE character varying(2048);
+`
show_error

#Increasing the character limit for module in method_monitors table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ALTER COLUMN module TYPE character varying(2048);
+`
show_error

#Increasing the character limit for method_desc in method_monitors table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.method_monitors ALTER COLUMN method_desc TYPE character varying(500);
+`
show_error

#Increasing the character limit for method_desc in exception_monitors table
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.exception_monitors ALTER COLUMN exception_desc TYPE character varying(500);
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.protocol.http.HttpURLConnection.connect()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.protocol.http.HttpURLConnection.connect()V','sun.net.www.protocol.http.HttpURLConnection.connect()V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.protocol.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.protocol.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;','sun.net.www.protocol.http.HttpURLConnection.getInputStream()Ljava/io/InputStream;',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.protocol.http.HttpURLConnection.getOutputStream()Ljava/io/OutputStream;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.protocol.http.HttpURLConnection.getOutputStream()Ljava/io/OutputStream;','sun.net.www.protocol.http.HttpURLConnection.getOutputStream()Ljava/io/OutputStream;',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.openServer(Ljava/lang/String;I)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.openServer(Ljava/lang/String;I)V','sun.net.www.http.HttpClient.openServer(Ljava/lang/String;I)V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.openServer()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.openServer()V','sun.net.www.http.HttpClient.openServer()V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;)V','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;)V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;)V','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;)V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;Z)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;Z)V','sun.net.www.http.HttpClient.writeRequests(Lsun/net/www/MessageHeader;Lsun/net/www/http/PosterOutputStream;Z)V',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.parseHTTPHeader(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.parseHTTPHeader(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z','sun.net.www.http.HttpClient.parseHTTPHeader(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'sun.net.www.http.HttpClient.parseHTTP(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture HTTP Calls','sun.net.www.http.HttpClient.parseHTTP(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z','sun.net.www.http.HttpClient.parseHTTP(Lsun/net/www/MessageHeader;Lsun/net/ProgressSource;Lsun/net/www/protocol/http/HttpURLConnection;)Z',53,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'sun.net.www.protocol.http.HttpURLConnection';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#To delete wrong end_point_fqm from backend_points
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm= 'sun.net.www.http.HttpClient';")
Error=` psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id =$KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id =$KEY_ID;
+`
show_error

#Changing default value of  formatIPResourceURL keywords
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value='0%200%201024' WHERE key_name='formatIPResourceURL';
+`
show_error

#Disabling entrypoint from UI
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'java.net.HttpURLConnection.setRequestMethod(Ljava/lang/String;)V';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=false WHERE end_point_id = $KEY_ID;
+`
show_error

# To delete the ndAWSAccountSettings keyword present at key_id 233 from DB
   KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_id = 233;")
 if [ $? -eq 0 ]
 then
   if [ "X$KEY_ID" == "X233" ]
   then
Error=`psql test cavisson 2>&1<<+
     DELETE FROM config_$CONTROLLER_NAME.profile_keywords WHERE key_id = ${KEY_ID};
     DELETE FROM config_$CONTROLLER_NAME.keywords WHERE key_id = ${KEY_ID};
+`
show_error
   fi
 fi

#Changing default value of  captureHTTPReqFullFp, captureHTTPRespFullFp and enableNDSession keywords
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value='3%20ALL%201%20255' WHERE key_name='captureHTTPReqFullFp';
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value='2%20ALL%201%201024' WHERE key_name='captureHTTPRespFullFp';
+`
show_error

#Update SpeculativeExecution from UI
ENTRY_FQM='com.datastax.driver.core.RequestHandler$SpeculativeExecution'
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_points SET end_point_fqm='$ENTRY_FQM' WHERE end_point_id = 93;
+`
show_error

#Supporting Backend Naming Rule in MONGO_DB callout for Python agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'MONGO' where  backend_type_id = 79;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true , port = false WHERE backend_type_id = 79 AND profile_id = 999999;
+`
show_error

#Supporting Backend Naming Rule in REDIS callout for Python agent
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.backend_type SET backend_type_name_rulefile = 'REDIS' where  backend_type_id = 80;
UPDATE config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso SET host = true , port = false ,query = false WHERE backend_type_id = 80 AND profile_id = 999999;
+`
show_error

#Disabling Jetty entrypoints from UI
ENTRY_FQM='io.netty.channel.DefaultChannelPipeline.close(Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#Disabling Jetty entrypoints from UI
ENTRY_FQM='io.netty.channel.DefaultChannelPipeline.close()Lio/netty/channel/ChannelFuture;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#Inserting new backend type MONGO_DB for Dot Net
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 88;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X88" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (88,'Entry Point to capture MONGO_DB Calls.','MONGO_DB','MONGO_DB','None','Dot Net');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,88,888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.InsertOneAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.ReplaceOneAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.DeleteManyAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.UpdateOneAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.UpdateManyAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='MongoDB.Driver.MongoCollectionBase`1.DeleteOneAsync'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Entry Point to capture Mongo DB Calls','$ENTRY_FQM','$ENTRY_FQM',88,false,'MongoDB.Driver.dll','Dot Net');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),888888);
+`
show_error
fi
fi

#Disabling Netty entrypoints from UI
ENTRY_FQM='io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Ljava/lang/Object;)Lio/netty/channel/ChannelHandlerContext;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
ENTRY_FQM='io.netty.handler.codec.http.HttpObjectEncoder.encode(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Ljava/util/List;)V'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select entry_id from config_$CONTROLLER_NAME.service_entry_points where entry_fqm = '$ENTRY_FQM';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_service_entry_asso SET profile_enable=false WHERE entry_id = $KEY_ID;
+`
show_error

#Insering new backend type RABBITMQ for Python
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 89;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X89" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type(backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (89,'Entry Point to capture RABBITMQ Calls.','RABBITMQ','RABBITMQ','None','Python');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),false,false,false,false,false,false,false,false,false,false,false,false,false,89,999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'pika.adapters.blocking_connection.BlockingChannel.basic_publish';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'RABBITMQ_CALLOUT for python','pika.adapters.blocking_connection.BlockingChannel.basic_publish','pika.adapters.blocking_connection.BlockingChannel.basic_publish',89,false,'pika','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check backend_type_id 90 exists in config_$CONTROLLER_NAME.backend_type table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select backend_type_id from config_$CONTROLLER_NAME.backend_type where backend_type_id = 90;")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" != "X90" ]
then
Error=` psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_type (backend_type_id,backend_type_detail,backend_type_name,backend_type_name_entrypointsfile,backend_type_name_rulefile,agent) VALUES (90,'Entry Point to capture RABBITMQ Calls.','RABBITMQ','RABBITMQ','RABBITMQ','NodeJS');
INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso (assoc_id,host ,port,prefix ,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_Version,query,user_name,backend_type_id,profile_id) VALUES ($(($MAX_ID + 1)),true,false,false,false,false,false,false,false,false,false,false,false,false,90,777777);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=($(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'Command' AND backend_type_id = 90;"))
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
PROF_MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'RABBITMQ Backend point','Command','Command',90,false,'-','NodeJS');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($PROF_MAX_ID + 1)),true,($MAX_ID + 1),777777);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'okhttp3.internal.connection.RealCall.execute()Lokhttp3/Response;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP Backend','okhttp3.internal.connection.RealCall.execute()Lokhttp3/Response;','okhttp3.internal.connection.RealCall.execute()',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'pymysql.cursors.Cursor.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','pymysql.cursors.Cursor.execute','pymysql.cursors.Cursor.execute',78,false,'pymysql','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'MySQLdb.cursors.BaseCursor.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','MySQLdb.cursors.BaseCursor.execute','MySQLdb.cursors.BaseCursor.execute',78,false,'MySQLdb','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mysql.connector.cursor_cext.CMySQLCursor.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','mysql.connector.cursor_cext.CMySQLCursor.execute','mysql.connector.cursor_cext.CMySQLCursor.execute',78,false,'mysql.connector','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi


#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'mysql.connector.cursor.MySQLCursor.execute';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'SQL_CALLOUT for python','mysql.connector.cursor.MySQLCursor.execute','mysql.connector.cursor.MySQLCursor.execute',78,false,'mysql.connector','Python');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),999999);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'okhttp3.internal.connection.RealCall.enqueue(Lokhttp3/Callback;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','okhttp3.internal.connection.RealCall.enqueue(Lokhttp3/Callback;)V','okhttp3.internal.connection.RealCall.enqueue',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'okhttp3.RealCall.enqueue(Lokhttp3/Callback;)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','okhttp3.RealCall.enqueue(Lokhttp3/Callback;)V','okhttp3.RealCall.enqueue',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#modifying the default value of enableJavaGCMonitor in keywords table:
Error=` psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set key_def_value = 0 where key_name = 'enableJavaGCMonitor';
+`
show_error

#Supporting IPRuleConfig Keyword
#Check key_name IPRuleConfig exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'IPRuleConfig';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'IPRuleConfig','1','1024','5','NA','normal','31','This file will contain all the rules to be defined for every intergration point for the purpose of naming, the rule will be applied at global level for all transaction for now');
+`
show_error
fi
fi

#Adding Entry Points to capture AsyncHttp Calls
#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.get()Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.get()Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.get()Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Lplay/libs/ws/BodyWritable;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Lplay/libs/ws/BodyWritable;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Lplay/libs/ws/BodyWritable;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Ljava/lang/String;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Ljava/lang/String;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Ljava/lang/String;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Lcom/fasterxml/jackson/databind/JsonNode;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Lcom/fasterxml/jackson/databind/JsonNode;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Lcom/fasterxml/jackson/databind/JsonNode;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Lorg/w3c/dom/Document;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Lorg/w3c/dom/Document;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Lorg/w3c/dom/Document;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/InputStream;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/InputStream;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/InputStream;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/File;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/File;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Ljava/io/File;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.post(Lakka/stream/javadsl/Source;)Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.post(Lakka/stream/javadsl/Source;)Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.post(Lakka/stream/javadsl/Source;)Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.StandaloneAhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.StandaloneAhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.StandaloneAhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'play.libs.ws.ahc.AhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'AsyncHttpCallout end point','play.libs.ws.ahc.AhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;','play.libs.ws.ahc.AhcWSRequest.execute()Ljava/util/concurrent/CompletionStage;',87,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Update key default value for the keyword enableExecutorInterfaceCapturing
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set key_def_value='1%200' where key_name = 'enableExecutorInterfaceCapturing';
+`
show_error

# To delete the keyword enableJavaGCMonitor
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select key_id from config_$CONTROLLER_NAME.keywords where key_name ='enableJavaGCMonitor';")
Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_keywords WHERE key_id = ${KEY_ID};
DELETE FROM config_$CONTROLLER_NAME.keywords WHERE key_id = ${KEY_ID};
+`
show_error

#Supporting enableTrxCtxRestore Keyword
#Check key_name enableTrxCtxRestore exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableTrxCtxRestore';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'enableTrxCtxRestore','0','1','1','1','pre-custom','1','Enable restore of previous transaction context if it is valid in current transaction');
+`
show_error
fi
fi

#Supporting enableNewThreadCallout Keyword
#Check key_name enableNewThreadCallout exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableNewThreadCallout';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'enableNewThreadCallout','0','1','1','1','pre-custom','1','Enable features of new thread callout enhancements');
+`
show_error
fi
fi

#Supporting enableWrappingThreadCallout Keyword
#Check key_name enableWrappingThreadCallout exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'enableWrappingThreadCallout';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'enableWrappingThreadCallout','0','512','4','0%200','pre-custom','1','Enable wrapping of all runnable and callable instances submitted to thread pool');
+`
show_error
fi
fi

#Updating default value of keyword - enableCaptureDataOutsideTxn
Error=`psql test cavisson 2>&1<<+
Update config_$CONTROLLER_NAME.keywords set key_def_value = '0%200' where key_name = 'enableCaptureDataOutsideTxn';
+`
show_error


#Changes regarding NDTryCatchInstrFilterList and instrExceptions default value
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = 'java.*&&javax.*&&com.sun.*##0##0' WHERE key_name= 'NDTryCatchInstrFilterList';
UPDATE config_$CONTROLLER_NAME.keywords SET key_def_value = '1%201%200%2050%202' WHERE key_name= 'instrExceptions';
+`
show_error

#Supporting ExceptionMaxCount Keyword
#Check key_name ExceptionMaxCount exists in config_$CONTROLLER_NAME.keywords table or not
KEY_NAME=$(psql --user=cavisson -d test -t --no-align -c "select key_name from config_$CONTROLLER_NAME.keywords where key_name = 'ExceptionMaxCount';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(key_id) from config_$CONTROLLER_NAME.keywords;")
if [ $? -eq 0 ]
then
#if key_name does not exist then insert that row in table
if [ "X$KEY_NAME" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.keywords (key_id,key_name,key_min,key_max,kmd_id,key_def_value,type,agent_mode,key_desc) VALUES ($(($MAX_ID + 1)),'ExceptionMaxCount','50','5000','1','500','pre-custom','1','Enable/Disable Exception Count keyword');
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='java.lang.Throwable.<init>(Ljava/lang/String;Ljava/lang/Throwable;ZZ)V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'Exception end point','java.lang.Throwable.<init>(Ljava/lang/String;Ljava/lang/Throwable;ZZ)V','Exception: <init>(String,Throwable,boolean,boolean)V',23,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#To Update the Logger.error backend point interface
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_interface_id from config_$CONTROLLER_NAME.backend_points_interface where end_point_interface_fqm='org.slf4j.Logger.error'")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_interface_asso SET enabled = true WHERE end_point_interface_id= ($KEY_ID) AND profile_id = 1;
+`
show_error

# To delete the exception monitors
Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.IllegalArgumentException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.IllegalStateException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.NoSuchMethodExceptionXMLConfigurationException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.ClassNotFoundException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.security.PrivilegedActionException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.ArithmeticException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.RuntimeException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.rmi.NotBoundException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'org.postgresql.util.PSQLException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.io.IOException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.NegativeArraySizeException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'javax.crypto.BadPaddingException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'com.mongodb.MongoSocketException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.net.UnknownHostException';
DELETE FROM config_$CONTROLLER_NAME.exception_monitors WHERE exception_name = 'java.lang.NullPointerException';
+`
show_error

#Changing the character length of column end_point_name of table backend_points
Error=`psql test cavisson 2>&1<<+
ALTER TABLE config_$CONTROLLER_NAME.backend_points ALTER COLUMN end_point_name TYPE varchar(4096);
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(Ljava/lang/String;Ljavax/xml/transform/Transformer;Ljavax/xml/transform/Source;Lorg/springframework/ws/client/core/WebServiceMessageCallback;Lorg/springframework/ws/client/core/SourceExtractor;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(Lorg/springframework/ws/context/MessageContext;Lorg/springframework/ws/transport/WebServiceConnection;Lorg/springframework/ws/client/core/WebServiceMessageCallback;Lorg/springframework/ws/client/core/WebServiceMessageExtractor;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(Ljava/lang/String;Ljava/lang/Object;Lorg/springframework/ws/client/core/WebServiceMessageCallback;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(Ljava/lang/String;Ljava/lang/Object;Lorg/springframework/ws/client/core/WebServiceMessageCallback;)Ljava/lang/Object;','org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(Ljava/lang/String;Ljava/lang/Object;Lorg/springframework/ws/client/core/WebServiceMessageCallback;)Ljava/lang/Object;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/ClassicHttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/ClassicHttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/HttpHost;Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/ClassicHttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;Lorg/apache/hc/core5/http/io/HttpClientResponseHandler;)Ljava/lang/Object;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;Lorg/apache/hc/core5/http/protocol/HttpContext;)Lorg/apache/hc/core5/http/HttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/HttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/HttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/core5/http/HttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm ='org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;','org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(Lorg/apache/hc/core5/http/ClassicHttpRequest;)Lorg/apache/hc/client5/http/impl/classic/CloseableHttpResponse;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

# Define the query to fetch all matching end_point_ids
QUERY="SELECT end_point_id FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_fqm = 'org.springframework.web.client.RestTemplate.doExecute(Ljava/net/URI;Ljava/lang/String;Lorg/springframework/http/HttpMethod;Lorg/springframework/web/client/RequestCallback;Lorg/springframework/web/client/ResponseExtractor;)Ljava/lang/Object;';"

# Fetch all matching end_point_id(s) as a space-separated list
KEY_IDS=$(psql --user=cavisson -d test -t --no-align -c "$QUERY")
for KEY_ID in $KEY_IDS; do
Error=`psql test cavisson 2>&1<<+
DELETE FROM config_$CONTROLLER_NAME.profile_backend_point_asso WHERE end_point_id = $KEY_ID;
DELETE FROM config_$CONTROLLER_NAME.backend_points WHERE end_point_id = $KEY_ID;
+`
show_error
done

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.springframework.web.client.RestTemplate.doExecute(Ljava/net/URI;Ljava/lang/String;Lorg/springframework/http/HttpMethod;Lorg/springframework/web/client/RequestCallback;Lorg/springframework/web/client/ResponseExtractor;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','Spring 6.0 REST Template Client',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/HttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='jdk.internal.net.http.HttpClientFacade.sendAsync(Ljava/net/http/HttpRequest;Ljava/net/http/HttpResponse$BodyHandler;Ljava/net/http/HttpResponse$PushPromiseHandler;)Ljava/util/concurrent/CompletableFuture;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='jdk.internal.net.http.HttpClientFacade.send(Ljava/net/http/HttpRequest;Ljava/net/http/HttpResponse$BodyHandler;)Ljava/net/http/HttpResponse;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','$ENTRY_FQM','$ENTRY_FQM',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.JdkClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.http.client.reactive.JdkClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','org.springframework.http.client.reactive.JdkClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.HttpComponentsClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.http.client.reactive.HttpComponentsClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','org.springframework.http.client.reactive.HttpComponentsClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.test.web.reactive.server.HttpHandlerConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.test.web.reactive.server.HttpHandlerConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','org.springframework.test.web.reactive.server.HttpHandlerConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.JettyClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.http.client.reactive.JettyClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','org.springframework.http.client.reactive.JettyClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.ReactorNetty2ClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'HTTP end point','org.springframework.http.client.reactive.ReactorNetty2ClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;','org.springframework.http.client.reactive.ReactorNetty2ClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;',1,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'org.springframework.http.client.reactive.ReactorClientHttpConnector.connect(Lorg/springframework/http/HttpMethod;Ljava/net/URI;Ljava/util/function/Function;)Lreactor/core/publisher/Mono;';")
Error=`psql test cavisson 2>&1<<+
UPDATE config_$CONTROLLER_NAME.profile_backend_point_asso SET enabled=true WHERE end_point_id = $KEY_ID;
+`
show_error

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisClient.getConnection(Lio/lettuce/core/ConnectionFuture;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisClient.getConnection(Lio/lettuce/core/ConnectionFuture;)Ljava/lang/Object;','io.lettuce.core.AbstractRedisClient.getConnection(Lio/lettuce/core/ConnectionFuture;)Ljava/lang/Object;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.AbstractRedisClient.getConnection(Ljava/util/concurrent/CompletableFuture;)Ljava/lang/Object;';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.AbstractRedisClient.getConnection(Ljava/util/concurrent/CompletableFuture;)Ljava/lang/Object;','io.lettuce.core.AbstractRedisClient.getConnection(Ljava/util/concurrent/CompletableFuture;)Ljava/lang/Object;',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.protocol.AsyncCommand.complete()V';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.protocol.AsyncCommand.complete()V','io.lettuce.core.protocol.AsyncCommand.complete()V',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = 'io.lettuce.core.protocol.AsyncCommand.completeExceptionally(Ljava/lang/Throwable;)Z';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'REDIS end point','io.lettuce.core.protocol.AsyncCommand.completeExceptionally(Ljava/lang/Throwable;)Z','io.lettuce.core.protocol.AsyncCommand.completeExceptionally(Ljava/lang/Throwable;)Z',10,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),false,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(Lcom/mongodb/operation/ReadOperation;Lcom/mongodb/ReadPreference;Lcom/mongodb/ReadConcern;Lcom/mongodb/client/ClientSession;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO end point','$ENTRY_FQM','$ENTRY_FQM',11,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

#Check end_point_fqm exists in config_$CONTROLLER_NAME.backend_points table or not
ENTRY_FQM='com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(Lcom/mongodb/operation/WriteOperation;Lcom/mongodb/ReadConcern;Lcom/mongodb/client/ClientSession;)Ljava/lang/Object;'
KEY_ID=$(psql --user=cavisson -d test -t --no-align -c "select end_point_id from config_$CONTROLLER_NAME.backend_points where end_point_fqm = '$ENTRY_FQM';")
MAX_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(end_point_id) FROM config_$CONTROLLER_NAME.backend_points;")
MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
if [ $? -eq 0 ]
then
if [ "X$KEY_ID" == "X" ]
then
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.backend_points (end_point_id,end_point_desc,end_point_fqm,end_point_name,backend_type_id,custom_entry,module,agent) VALUES ($(($MAX_ID + 1)),'MONGO end point','$ENTRY_FQM','$ENTRY_FQM',11,false,'-','Java');
+`
show_error
Error=`psql test cavisson 2>&1<<+
INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),true,($MAX_ID + 1),1);
+`
show_error
fi
fi

########################################################################################################################################
#                                Below Script name only for reference : UPDATE_ENTRY_POINTS_IN_ALL_PROFILES
#                                Note : Insert all new changes just above this line , the below script is for updating 
#                                       all profiles with newly supported Entry Points
# Fetching all profile_id and agent from table : CONTROLLER_NAME.profile
#Use function replace(agent, ' ','') to avoid white space from agent Dot Net.
#The Entry fetched is in format as : 303|Java or 304|Php or 305|DotNet or 306|Phython or 307|NodeJS
arrProfileIDAndAgent=($(psql --user=cavisson -d test -t --no-align -c "SELECT profile_id,replace(agent, ' ','') FROM config_$CONTROLLER_NAME.profile;"))

# Assigning length of arrProfileIDAndAgent in profileIDAndAgentArrayLength
profileIDAndAgentArrayLength=${#arrProfileIDAndAgent[@]}

#Iterating arrProfileIDAndAgent to get profile_id with agent.
for (( i=1; i<${profileIDAndAgentArrayLength}+1; i++ ));
do
	#Splitting array value by pipe to extract profile_id and agent
       	profile_id=`echo ${arrProfileIDAndAgent[$i-1]} |cut -d '|' -f1`
        agent=`echo ${arrProfileIDAndAgent[$i-1]} |cut -d '|' -f2`	
	if [ "$agent" == "Java" ]
	then
		# Fetching only those entries which are extra in profile_id = 1
		arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=1 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

                # Fetching only those entries which are extra in profile_id = 1
                arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=1 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
				
		# Fetching only those entries which are extra in profile_id = 1
		arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=1 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 1
		arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=1 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 1
		arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=1 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))

	elif [ "$agent" == "DotNet" ]
	then
                # Fetching only those entries which are extra in profile_id = 888888
                arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=888888 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

                # Fetching only those entries which are extra in profile_id = 888888               
		arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=888888 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 888888
		arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=888888 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 888888
		arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=888888 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 888888
		arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=888888 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))

        elif [ "$agent" == "NodeJS" ]
        then
                # Fetching only those entries which are extra in profile_id = 777777
                arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=777777 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

                # Fetching only those entries which are extra in profile_id = 777777
		arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=777777 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 777777
		arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=777777 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 777777
		arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=777777 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 777777
		arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=777777 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))

        elif [ "$agent" == "Php" ]
        then
                # Fetching only those entries which are extra in profile_id = 666666
                arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=666666 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

		# Fetching only those entries which are extra in profile_id = 666666
                arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=666666 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
				
		# Fetching only those entries which are extra in profile_id = 666666
		arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=666666 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 666666
		arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=666666 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 666666
		arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=666666 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))

	 elif [ "$agent" == "Python" ]
        then
        	# Fetching only those entries which are extra in profile_id = 999999
                arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=999999 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

		# Fetching only those entries which are extra in profile_id = 999999
                arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=999999 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
				
		# Fetching only those entries which are extra in profile_id = 999999
		arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=999999 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 999999
		arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=999999 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
		
		# Fetching only those entries which are extra in profile_id = 999999
		arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=999999 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))
else 
                # Fetching only those entries which are extra in profile_id = 555555
                arrProfileBackendPointAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=555555 and end_point_id not in(select end_point_id from config_$CONTROLLER_NAME.profile_backend_point_asso where profile_id=$profile_id);"))

                # Fetching only those entries which are extra in profile_id = 555555
                arrNamingRuleProfileBackendtypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT databaseproduct_name,databaseproduct_version,driver_name,driver_version,host,port,prefix,query,service_name,table_name,topic_name,url,user_name,backend_type_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=555555 and backend_type_id not in(select backend_type_id from config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso where profile_id=$profile_id);"))
                                
                # Fetching only those entries which are extra in profile_id = 555555
                arrProfileServiceEntryAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT entry_id,profile_enable from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=555555 and entry_id not in(select entry_id from config_$CONTROLLER_NAME.profile_service_entry_asso where profile_id=$profile_id);"))
                
                # Fetching only those entries which are extra in profile_id = 555555
                arrProfileAsyncTypeAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT container_id,enabled from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=555555 and container_id not in(select container_id from config_$CONTROLLER_NAME.profile_async_type_assoc where profile_id=$profile_id);"))
                
                # Fetching only those entries which are extra in profile_id = 555555
                arrProfileBackendPointInterfaceAsso=($(psql --user=cavisson -d test -t --no-align -c "SELECT end_point_interface_id,enabled from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=555555 and end_point_interface_id not in(select end_point_interface_id from config_$CONTROLLER_NAME.profile_backend_point_interface_asso where profile_id=$profile_id);"))
 fi


#Assigning length of arrProfileBackendPointAsso in arrProfileBackendPointAssoLength
arrProfileBackendPointAssoLength=${#arrProfileBackendPointAsso[@]}
	
	#Iterating to read all end_point_id and enabled that are extra in default profile_id .
	for (( j=1; j<${arrProfileBackendPointAssoLength}+1; j++ ));
	do	
		#Splitting array value by pipe to get end_point_id and enabled
		end_point_id=`echo ${arrProfileBackendPointAsso[$j-1]} |cut -d '|' -f1`
		enabled=`echo ${arrProfileBackendPointAsso[$j-1]} |cut -d '|' -f2`
		if [ "$enabled" == "t" ]
		then
    			enabled=true;
		else
    			enabled=false
		fi
		# Fetching Max_assoc_id to insert new entry
		MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_asso;")
		Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_asso(assoc_id,enabled,end_point_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),$enabled,$end_point_id,$profile_id);
+`
		show_error
	done	

	#Assigning length of arrNamingRuleProfileBackendtypeAsso in arrNamingRuleProfileBackendtypeAssoLength
	arrNamingRuleProfileBackendtypeAssoLength=${#arrNamingRuleProfileBackendtypeAsso[@]}
        #Iterating to read all backend_naming_rule that are extra in default profile_id.
        for (( j=1; j<${arrNamingRuleProfileBackendtypeAssoLength}+1; j++ ));
        do
                #Splitting array value by pipe to get all backend_naming_rule
                databaseproduct_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f1`
                databaseproduct_version=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f2`
		driver_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f3`
		driver_version=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f4`
		host=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f5`
		port=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f6`
		prefix=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f7`
		query=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f8`
		service_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f9`
		table_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f10`
		topic_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f11`
		url=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f12`
		user_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f13`
		backend_type_id=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f14`
		projectid=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f15`
		instanceid=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f16`
		databaseid=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f17`
		operation=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f18`
		vendorname=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f19`
		brokerid=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f20`
		subid=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f21`
		database_name=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f22`
                protocol=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f23`
                query_parameter=`echo ${arrNamingRuleProfileBackendtypeAsso[$j-1]} |cut -d '|' -f24`

                [[ "$databaseproduct_name" = "t" ]] && databaseproduct_name=true || databaseproduct_name=false
		[[ "$databaseproduct_version" = "t" ]] && databaseproduct_version=true || databaseproduct_version=false
		[[ "$driver_name" = "t" ]] && driver_name=true || driver_name=false
		[[ "$driver_version" = "t" ]] && driver_version=true || driver_version=false
		[[ "$host" = "t" ]] && host=true || host=false
		[[ "$port" = "t" ]] && port=true || port=false
		[[ "$prefix" = "t" ]] && prefix=true || prefix=false
		[[ "$query" = "t" ]] && query=true || query=false
                [[ "$service_name" = "t" ]] && service_name=true || service_name=false
		[[ "$table_name" = "t" ]] && table_name=true || table_name=false
		[[ "$topic_name" = "t" ]] && topic_name=true || topic_name=false
		[[ "$url" = "t" ]] && url=true || url=false
		[[ "$user_name" = "t" ]] && user_name=true || user_name=false
		[[ "$projectid" = "t" ]] && projectid=true || projectid=false
		[[ "$instanceid" = "t" ]] && instanceid=true || instanceid=false
		[[ "$databaseid" = "t" ]] && databaseid=true || databaseid=false
		[[ "$operation" = "t" ]] && operation=true || operation=false
		[[ "$vendorname" = "t" ]] && vendorname=true || vendorname=false
		[[ "$brokerid" = "t" ]] && brokerid=true || brokerid=false
		[[ "$subid" = "t" ]] && subid=true || subid=false
		[[ "$database_name" = "t" ]] && database_name=true || database_name=false
                [[ "$protocol" = "t" ]] && protocol=true || protocol=false
                [[ "$query_parameter" = "t" ]] && query_parameter=true || query_parameter=false
				
                # Fetching Max_assoc_id to insert new entry
                MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso ;")
                Error=`psql test cavisson 2>&1<<+
                INSERT INTO config_$CONTROLLER_NAME.naming_rule_profile_backendtype_asso(assoc_id,host,port,prefix,service_name,table_name,topic_name,url,databaseproduct_name,databaseproduct_version,driver_name,driver_version,query,user_name,backend_type_id,profile_id,projectid,instanceid,databaseid,operation,vendorname,brokerid,subid,database_name,protocol,query_parameter) VALUES ($(($MAX_ASSO_ID + 1)),$host,$port,$prefix,$service_name,$table_name,$topic_name,$url,$databaseproduct_name,$databaseproduct_version,$driver_name,$driver_version,$query,$user_name,$backend_type_id,$profile_id,$projectid,$instanceid,$databaseid,$operation,$vendorname,$brokerid,$subid,$database_name,$protocol,$query_parameter);
+`
                show_error
        done
		
		#Assigning length of arrProfileServiceEntryAsso in arrProfileServiceEntryAssoLength
arrProfileServiceEntryAssoLength=${#arrProfileServiceEntryAsso[@]}
	
	#Iterating to read all end_point_id and enabled that are extra in default profile_id .
	for (( j=1; j<${arrProfileServiceEntryAssoLength}+1; j++ ));
	do	
		#Splitting array value by pipe to get end_point_id and enabled
		entry_id=`echo ${arrProfileServiceEntryAsso[$j-1]} |cut -d '|' -f1`
		profile_enable=`echo ${arrProfileServiceEntryAsso[$j-1]} |cut -d '|' -f2`
		if [ "$profile_enable" == "t" ]
		then
    			profile_enable=true;
		else
    			profile_enable=false
		fi
		# Fetching Max_assoc_id to insert new entry
		MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(prof_entry_id) FROM config_$CONTROLLER_NAME.profile_service_entry_asso;")
		Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.profile_service_entry_asso(prof_entry_id,profile_enable,entry_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),$profile_enable,$entry_id,$profile_id);
+`
		show_error
	done
	
		#Assigning length of arrProfileAsyncTypeAsso in arrProfileAsyncTypeAssoLength
arrProfileAsyncTypeAssoLength=${#arrProfileAsyncTypeAsso[@]}
	
	#Iterating to read all end_point_id and enabled that are extra in default profile_id .
	for (( j=1; j<${arrProfileAsyncTypeAssoLength}+1; j++ ));
	do	
		#Splitting array value by pipe to get end_point_id and enabled
		container_id=`echo ${arrProfileAsyncTypeAsso[$j-1]} |cut -d '|' -f1`
		enabled=`echo ${arrProfileAsyncTypeAsso[$j-1]} |cut -d '|' -f2`
		if [ "$enabled" == "t" ]
		then
    			enabled=true;
		else
    			enabled=false
		fi
		# Fetching Max_assoc_id to insert new entry
		MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_async_type_assoc;")
		Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.profile_async_type_assoc(assoc_id,enabled,container_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),$enabled,$container_id,$profile_id);
+`
		show_error
	done
	
		#Assigning length of arrProfileBackendPointInterfaceAsso in arrProfileBackendPointInterfaceAssoLength
arrProfileBackendPointInterfaceAssoLength=${#arrProfileBackendPointInterfaceAsso[@]}
	
	#Iterating to read all end_point_id and enabled that are extra in default profile_id .
	for (( j=1; j<${arrProfileBackendPointInterfaceAssoLength}+1; j++ ));
	do	
		#Splitting array value by pipe to get end_point_id and enabled
		end_point_interface_id=`echo ${arrProfileBackendPointInterfaceAsso[$j-1]} |cut -d '|' -f1`
		enabled=`echo ${arrProfileBackendPointInterfaceAsso[$j-1]} |cut -d '|' -f2`
		if [ "$enabled" == "t" ]
		then
    			enabled=true;
		else
    			enabled=false
		fi
		# Fetching Max_assoc_id to insert new entry
		MAX_ASSO_ID=$(psql --user=cavisson -d test -t --no-align -c "SELECT MAX(assoc_id) FROM config_$CONTROLLER_NAME.profile_backend_point_interface_asso;")
		Error=`psql test cavisson 2>&1<<+
		INSERT INTO config_$CONTROLLER_NAME.profile_backend_point_interface_asso(assoc_id,enabled,end_point_interface_id,profile_id) VALUES ($(($MAX_ASSO_ID + 1)),$enabled,$end_point_interface_id,$profile_id);
+`
		show_error
	done

done

#
#                    NOTE : All new changes in this file will be kept above the script which is written for updating all profiles 
#                           with newly introduced Entry Points in table :
#                           
#                           (1) profile_service_entry_asso
#                           (2) naming_rule_profile_backendtype_asso
#                           (3) profile_backend_point_asso
#                           (4) profile_backend_point_interface
#                           (5) profile_async_type_assoc
#                       
#                         For reference we had named the above script name as : UPDATE_ENTRY_POINTS_IN_ALL_PROFILES
#                         so,keep your new code above the same
