private static Scheduler scheduler = null;
// System type constants
- public final static String ST_FUSION = "fusion";
- public final static String ST_GENERIC = "generic";
+ public static final String ST_GENERIC = "generic";
- public final static String ST_PRISMS = "prisms";
+ public static final String ST_PRISMS = "prisms";
private static String systemType = ST_PRISMS; // default
private static String baseTitle = "ANALYSIS";
- private static String sheet_name = "Raptor Reports";
+ private static String sheetName = "Raptor Reports";
+
+ private static final String ANALYTIC_SYSTEM = "org.onap.portalsdk.analytics.system.";
+
+ private static final String NOT_INITIALIZED = "[SYSTEM ERROR] Globals not initialized";
private static boolean allowSQLBasedReports = true; // whether to allow
// SQL-based report
private static String javaTimeFormat = "MM/dd/yyyy h:m:s a";
- private static String oracleTimeFormat = "%m/%d/%Y %h:%i:%s %p"; // must
- // correspond
- // to
- // the
- // java
- // format
- // modifier
-
private static String raptorVersion = "10.5.1";
private static int flatFileLowerLimit = 0;
private static String sessionParams = "";
- private static boolean displayAllUsers = true;
+ private static boolean displayAllUsers = true;
- private static boolean user_col_def = true;
+ private static boolean userColDef = true;
private static boolean printFooterInDownload = true;
} catch (Exception e) {
logger.error(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] Globals: Unable to load properties ["
+ ConfigLoader.RAPTOR_PROPERTIES + "]. Exception: " + e.getMessage()));
- // throw new RuntimeException(e.getMessage());
}
systemInitialized = true;
try {
appUtils = (IAppUtils) Class.forName(
- "org.onap.portalsdk.analytics.system." + systemType.toLowerCase() + ".AppUtils")
+ ANALYTIC_SYSTEM + systemType.toLowerCase() + ".AppUtils")
.newInstance();
appUtils.initializeAppUtils(servletContext);
dbUtils = (IDbUtils) Class.forName(
- "org.onap.portalsdk.analytics.system." + systemType.toLowerCase() + ".DbUtils")
+ ANALYTIC_SYSTEM + systemType.toLowerCase() + ".DbUtils")
.newInstance();
dbUtils.initializeDbUtils(servletContext);
if(!Globals.getSystemType().equals(Globals.ST_GENERIC)) {
rdbUtils = (RDbUtils) Class.forName(
- "org.onap.portalsdk.analytics.system." + systemType.toLowerCase() + ".RemoteDbUtils")
+ ANALYTIC_SYSTEM + systemType.toLowerCase() + ".RemoteDbUtils")
.newInstance();
rdbUtils.initializeDbUtils(servletContext);
}
throw new RuntimeException(eMsg);
} // catch
- /*try {
- //DataSet ds = DbUtils
- // .executeQuery("SELECT 1 FROM dual WHERE EXISTS (SELECT 1 FROM cr_table_role)");
-
- String p_sql = Globals.getInitializeRoles();
- DataSet ds = DbUtils.executeQuery(p_sql);
-
- restrictTablesByRole = (ds.getRowCount() > 0);
- } catch (Exception e) {
- String eMsg = "[SYSTEM ERROR] Globals: Unable to load Raptor version. Exception: "
- + e.getMessage();
- debugLogger.error("[EXCEPTION ENCOUNTERED IN RAPTOR] " + eMsg, e);
- } // catch
- */
- /*try {
- //DataSet ds = DbUtils.executeQuery("SELECT cr_raptor.get_version FROM dual");
-
- //String n_sql = Globals.getInitializeVersion();
- //DataSet ds = DbUtils.executeQuery(n_sql);
- //raptorVersion = Globals.get
- // if(ds.getRowCount()>0)
- // raptorVersion = " v"+ds.getString(0, 0);
- } catch (Exception e) {
- String eMsg = "[SYSTEM ERROR] Globals: Unable to load Raptor version. Exception: "
- + e.getMessage();
- debugLogger.error("[EXCEPTION ENCOUNTERED IN RAPTOR] " + eMsg, e);
- } // catch*/
-
-
//initiate pdf global config
try {
raptorPdfProperties = ConfigLoader.getProperties(servletContext, ConfigLoader.RAPTOR_PDF_PROPERTIES);
.toUpperCase().startsWith("Y");
showDescrAtRuntime = nvls(raptorProperties.getProperty("show_descr_at_runtime"),
"no").toUpperCase().startsWith("Y");
- // skipChartLabelsToFit =
- // nvls(raptorProperties.getProperty("skip_chart_labels_to_fit"),
- // "no" ).toUpperCase().startsWith("Y");
showNonstandardCharts = nvls(
raptorProperties.getProperty("show_nonstandard_charts"), "no")
.toUpperCase().startsWith("Y");
displayChartByDefault = nvls(
raptorProperties.getProperty("display_chart_by_default"), "yes")
.toUpperCase().startsWith("Y");
- //System.out.println("Params Globals " + raptorProperties.getProperty("print_params_in_download"));
printParamsInDownload = nvls(
raptorProperties.getProperty("print_params_in_download"), "no")
.toUpperCase().startsWith("Y");
- //System.out.println("printParamsInDownload " + printParamsInDownload);
canCopyOnReadOnly = nvls(raptorProperties.getProperty("can_copy_on_read_only"),
"yes").toUpperCase().startsWith("Y");
- // chartLinesAlwaysSolid =
- // nvls(raptorProperties.getProperty("chart_lines_always_solid"),
- // "yes").toUpperCase().startsWith("Y");
- // chartLinesAlwaysSmooth =
- // nvls(raptorProperties.getProperty("chart_lines_always_smooth"),
- // "yes").toUpperCase().startsWith("Y");
displayAllUsers = nvls(
raptorProperties.getProperty("display_all_users"), "yes")
.toUpperCase().startsWith("Y");
raptorProperties.getProperty("request_get_params"), "");
sessionParams = nvls(
raptorProperties.getProperty("session_params"), "");
- user_col_def = nvls(
+ userColDef = nvls(
raptorProperties.getProperty("user_col_def"), "no")
.toUpperCase().startsWith("Y");
- sheet_name = nvls(raptorProperties.getProperty("sheet_name"), "Raptor Reports");
+ sheetName = nvls(raptorProperties.getProperty("sheet_name"), "Raptor Reports");
try {
flatFileLowerLimit = Integer.parseInt(raptorProperties
.getProperty("flat_file_lower_limit"));
} catch (NumberFormatException nfe) {
}
shellScriptDir = nvls(raptorProperties.getProperty("shell_script_dir"), "");
- //queryFolder = nvls(raptorProperties.getProperty("download_query_folder"), AppUtils.getTempFolderPath()+"../raptor/dwnld/query/");
queryFolder = nvls(raptorProperties.getProperty("download_query_folder"),"../raptor/dwnld/query/");
public static ActionMapping getRaptorActionMapping() {
if (!systemInitialized)
- throw new RuntimeException("[SYSTEM ERROR] Globals not initialized");
+ throw new IllegalStateException(NOT_INITIALIZED);
return raptorActionMapping;
} // getRaptorActionMapping
public static String getSystemType() {
if (!systemInitialized)
- throw new RuntimeException("[SYSTEM ERROR] Globals not initialized");
+ throw new IllegalStateException(NOT_INITIALIZED);
return systemType;
} // getSystemType
public static IAppUtils getAppUtils() {
if (!systemInitialized)
- throw new RuntimeException("[SYSTEM ERROR] Globals not initialized");
+ throw new IllegalStateException(NOT_INITIALIZED);
return appUtils;
} // getAppUtils
public static IDbUtils getDbUtils() {
if (!systemInitialized)
- throw new RuntimeException("[SYSTEM ERROR] Globals not initialized");
+ throw new IllegalStateException(NOT_INITIALIZED);
return dbUtils;
} // getDbUtils
public static RDbUtils getRDbUtils() {
if (!systemInitialized)
- throw new RuntimeException("[SYSTEM ERROR] Globals not initialized");
+ throw new IllegalStateException(NOT_INITIALIZED);
return rdbUtils;
} // getDbUtils
}
public static int getCSVDownloadLimit() {
- return Integer.parseInt(nvls(raptorProperties.getProperty("csv_download_limit"), new Integer(getDownloadLimit()).toString()).trim());
+ return Integer.parseInt(nvls(raptorProperties.getProperty("csv_download_limit"),
+ Integer.toString(getDownloadLimit())));
}
public static String getDownloadLimitAsText() {
return showDescrAtRuntime;
}
- // public static boolean getSkipChartLabelsToFit() { return
- // skipChartLabelsToFit; }
public static boolean getShowNonstandardCharts() {
return showNonstandardCharts;
}
return canCopyOnReadOnly;
}
- // public static boolean getChartLinesAlwaysSolid() { return
- // chartLinesAlwaysSolid; }
- // public static boolean getChartLinesAlwaysSmooth() { return
- // chartLinesAlwaysSmooth; }
public static int getMaxDecimalsOnTotals() {
return maxDecimalsOnTotals;
}
return javaTimeFormat;
}
-/* public static String getOracleTimeFormat() {
- return oracleTimeFormat;
- }
-*/
-
public static String getRaptorVersion() {
return raptorVersion;
}
return displayAllUsers;
}
- public static boolean getUserColDef() {
- return user_col_def;
- }
-
- public static String getSheetName() {
- return sheet_name;
- }
+ public static boolean getUserColDef() {
+ return userColDef;
+ }
+
+ public static String getSheetName() {
+return sheetName;
+}
public static int getFlatFileLowerLimit() {
return flatFileLowerLimit;