/// <summary>
        /// Validate the DEFAULT_CACHE_CLEANER_THREAD_INTERVAL value provided in the settings file
        /// </summary>
        private void ValidateCacheCleanerThreadInterval()
        {
            String intervalValue = ServerConfigurationDataTypeEnum.DEFAULT_CACHE_CLEANER_THREAD_MILLISECONDS_INTERVAL.GetValue();

            int interval = 0;

            try
            {
                interval = Convert.ToInt32(intervalValue);
            }
            catch (Exception ex)
            {
                MessageData messageData         = new MessageData("fsce00056", Properties.Resources.fsce00056, intervalValue);
                Framework.SystemException sysEx = new Framework.SystemException(messageData, ex);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }
            if (interval <= 0)
            {
                MessageData messageData         = new MessageData("fsce00054", Properties.Resources.fsce00054, interval.ToString());
                Framework.SystemException sysEx = new Framework.SystemException(messageData);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }
        }
        /// <summary>
        /// pqm configuration mandatory check
        /// </summary>
        private void PQMConfigMandatorySettings()
        {
            String checkValue = ServerConfigurationDataTypeEnum.DEFAULT_PQM_CONFIG_MANDATORY_CHECK_ON.GetValue();

            bool checkMandatory = false;

            try
            {
                checkMandatory = Convert.ToBoolean(checkValue);
            }
            catch (Exception ex)
            {
                MessageData messageData         = new MessageData("fsce00059", Properties.Resources.fsce00059, checkValue);
                Framework.SystemException sysEx = new Framework.SystemException(messageData, ex);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }

            if (!checkMandatory)
            {
                return;
            }

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_PQM_CONFIG_URL, "fsce00038", Properties.Resources.fsce00038);
        }
        /// <summary>
        /// check mandatory settings value
        /// </summary>
        /// <param name="settingValue"></param>
        /// <param name="messageCode"></param>
        /// <param name="message"></param>
        /// <exception cref="SystemException"></exception>
        private void CheckMandatorySettings(string settingValue,
                                            string messageCode, string message)
        {
            if (string.IsNullOrWhiteSpace(settingValue))
            {
                MessageData messageData         = new MessageData(messageCode, message, Properties.Resources.fsce00016);
                Framework.SystemException sysEx = new Framework.SystemException(messageData);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }
        }
        /// <summary>
        /// sap configuration mandatory check
        /// </summary>
        private void SAPConfigMandatorySettings()
        {
            String checkValue = ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_MANDATORY_CHECK_ON.GetValue();

            bool checkMandatory = false;

            try
            {
                checkMandatory = Convert.ToBoolean(checkValue);
            }
            catch (Exception ex)
            {
                MessageData messageData         = new MessageData("fsce00058", Properties.Resources.fsce00058, checkValue);
                Framework.SystemException sysEx = new Framework.SystemException(messageData, ex);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }

            if (!checkMandatory)
            {
                return;
            }

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_PLANT_CODE, "fsce00060", Properties.Resources.fsce00060);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_NAME, "fsce00023", Properties.Resources.fsce00023);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LOGON_GROUP, "fsce00024", Properties.Resources.fsce00024);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_MESSAGE_SERVER_HOST, "fsce00025", Properties.Resources.fsce00025);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_ID, "fsce00026", Properties.Resources.fsce00026);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_NUMBER, "fsce00027", Properties.Resources.fsce00027);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_CLIENT, "fsce00030", Properties.Resources.fsce00030);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LANGUAGE, "fsce00031", Properties.Resources.fsce00031);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_POOL_SIZE, "fsce00033", Properties.Resources.fsce00033);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_PEAK_CONNECTIONS_LIMIT, "fsce00034", Properties.Resources.fsce00034);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_TIMEOUT, "fsce00035", Properties.Resources.fsce00035);

            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_CHECKTIME, "fsce00036", Properties.Resources.fsce00036);
        }
        /// <summary>
        /// check mandatory application settings value
        /// </summary>
        /// <param name="settingsdata"></param>
        /// <param name="messageCode"></param>
        /// <param name="message"></param>
        /// <exception cref="SystemException"></exception>
        private void CheckApplicationMandatorySettings(ConfigurationDataTypeEnum settingsdata, string messageCode, string message)
        {
            string settingValue = null;

            try
            {
                settingValue = settingsdata.GetValue();
            }
            catch (Exception ex)
            {
                MessageData messageData         = new MessageData(messageCode, message, Properties.Resources.fsce00017);
                Framework.SystemException sysEx = new Framework.SystemException(messageData, ex);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }
            CheckMandatorySettings(settingValue, messageCode, message);
        }
Esempio n. 6
0
        /// <summary>
        /// check mandatory applicationsettings value
        /// </summary>
        private void CheckServerMandatorySettings(ServerConfigurationDataTypeEnum settingsdata,
                                                  string messageCode, string message)
        {
            try
            {
                string settingValue = settingsdata.GetValue();

                if (string.IsNullOrWhiteSpace(settingValue))
                {
                    MessageData messageData         = new MessageData(messageCode, message, Properties.Resources.fsce00016);
                    Framework.SystemException sysEx = new Framework.SystemException(messageData);

                    InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
                }
            }
            catch (Exception ex)
            {
                MessageData messageData         = new MessageData(messageCode, message, Properties.Resources.fsce00017);
                Framework.SystemException sysEx = new Framework.SystemException(messageData, ex);

                InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
            }
        }
Esempio n. 7
0
        private void CheckMandatorySettingsInXml()
        {
            if (ServerConfigurationDataTypeEnum.MANDATORY_CHECK.GetValue() == "1")
            {
                DataSet dsMandatoryXmlList = new DataSet();

                dsMandatoryXmlList.ReadXml(ServerConfigurationDataTypeEnum.DEFAULT_MANDATORY_CHECK_XML.GetValue());

                if (dsMandatoryXmlList == null || dsMandatoryXmlList.Tables.Count == 0)
                {
                    return;
                }

                DataTable dtMandatory = dsMandatoryXmlList.Tables[0];
                if (dtMandatory.Rows.Count > 0)
                {
                    foreach (DataRow dr in dtMandatory.Rows)
                    {
                        if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_NAME.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_NAME, "fsce00023", Properties.Resources.fsce00023);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LOGON_GROUP.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LOGON_GROUP, "fsce00024", Properties.Resources.fsce00024);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_MESSAGE_SERVER_HOST.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_MESSAGE_SERVER_HOST, "fsce00025", Properties.Resources.fsce00025);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_ID.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_ID, "fsce00026", Properties.Resources.fsce00026);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_NUMBER.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_SYSTEM_NUMBER, "fsce00027", Properties.Resources.fsce00027);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_CLIENT.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_CLIENT, "fsce00030", Properties.Resources.fsce00030);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LANGUAGE.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_LANGUAGE, "fsce00031", Properties.Resources.fsce00031);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_POOL_SIZE.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_POOL_SIZE, "fsce00033", Properties.Resources.fsce00033);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_PEAK_CONNECTIONS_LIMIT.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_PEAK_CONNECTIONS_LIMIT, "fsce00034", Properties.Resources.fsce00034);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_TIMEOUT.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_TIMEOUT, "fsce00035", Properties.Resources.fsce00035);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_CHECKTIME.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_SAP_CONFIG_IDLE_CHECKTIME, "fsce00036", Properties.Resources.fsce00036);
                        }
                        else if (string.Equals(dr["Name"].ToString(), ServerConfigurationDataTypeEnum.DEFAULT_PQM_CONFIG_URL.ToString()))
                        {
                            CheckServerMandatorySettings(ServerConfigurationDataTypeEnum.DEFAULT_PQM_CONFIG_URL, "fsce00038", Properties.Resources.fsce00038);
                        }
                        else
                        {
                            MessageData messageData         = new MessageData("fsce00032", Properties.Resources.fsce00032, dr["Name"].ToString());
                            Framework.SystemException sysEx = new Framework.SystemException(messageData);

                            InitializationSystemExceptionHandler.GetInstance().HandleException(sysEx);
                        }
                    }
                }
            }
        }