Ejemplo n.º 1
0
 /// <summary>
 /// 获取所有TCP服务的远程对象
 /// </summary>
 public static void InitializeTcpConnection()
 {
     try
     {
         if (IdbOperating == null)
         {
             IdbOperating = DbOperatingTCPClient.InitTCPClient_StorageChl(DbServerIp, dbUtilityTcpPort);
         }
         ITileDbUtilities   = DbUtilitiesTCPClient.InitTCPClient_StorageChl("127.0.0.1", dbUtilityTcpPort);
         IGetDataService    = QDB_GetDataTCPClient.InitTCPClient_StorageChl(DbServerIp, dbUtilityTcpPort);
         ISearcherDbServ    = QDB_SearDbTCPClient.InitTCPClient_StorageChl(DbServerIp, dbUtilityTcpPort);
         ISearcherTileServ  = QDB_SearTileTCPClient.InitTCPClient_StorageChl(DbServerIp, dbUtilityTcpPort);
         IdbServerUtilities = IdbOperating.GetSubDbUtilities(EnumDBType.MIDB);
         ServiceIsConnected = true;
     }
     catch (Exception e)
     {
         throw new Exception("InitializeTcpConnection:获取远程TCP服务异常", e);
     }
 }
Ejemplo n.º 2
0
        private static void create()
        {
            try
            {
                UsingIPAddress = GetIPAddress();

                #region 迁移到服务进程 @jianghua 20170415

                //MySqlConnection con = (MySqlCon != "") ? new MySqlConnection(MySqlCon) : new MySqlConnection();
                //DataTable dt = new DataTable();
                //try
                //{
                //    con.Open();//打开数据连接
                //    MySqlDataAdapter adapter = new MySqlDataAdapter(sql, con);
                //    int dd = adapter.Fill(dt);
                //}
                //catch (Exception ex)
                //{
                //    //throw ex;
                //    if (con.State == ConnectionState.Closed)
                //    {
                //        con.Open();//打开数据连接
                //        MySqlDataAdapter adapter = new MySqlDataAdapter(sql, con);
                //        int dd = adapter.Fill(dt);
                //    }
                //}
                //finally
                //{
                //    con.Close();//关闭数据库连接
                //}

                #endregion

                string sql = "select appSettings.key,appSettings.value from appSettings";
                if (IdbOperating == null)
                {
                    IdbOperating = DbOperatingTCPClient.InitTCPClient_StorageChl(DbServerIp, dbUtilityTcpPort);
                }

                IdbServerUtilities = IdbOperating.GetSubDbUtilities(EnumDBType.MIDB);
                DataSet ds       = IdbServerUtilities.GetDataSet(sql);
                string  tempConn = null;
                foreach (DataRow rows in ds.Tables[0].Rows)
                {
                    Object[] row = rows.ItemArray;
                    if (row[0].ToString() == "DataStorePath")
                    {
                        DataStorePath = row[1].ToString();
                    }
                    else if (row[0].ToString() == "INDUSTRYCODE")
                    {
                        INDUSTRYCODE = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ConnectionString")
                    {
                        ConnectionString = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ConnectionStringOracle")
                    {
                        ConnectionStringOracle = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ConnectionStringEVDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringEVDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringBSDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringBSDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringIPDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringIPDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringINDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringINDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringISDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringISDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringMADB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringMADB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "ConnectionStringRCDB")
                    {
                        tempConn             = row[1].ToString();
                        ConnectionStringRCDB = IdbOperating.GetAbsoluteDbCon(tempConn);
                    }
                    else if (row[0].ToString() == "CorrectRecieveIP")
                    {
                        CorrectRecieveIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "CloudCenterIPAddress")
                    {
                        CloudCenterIPAddress = row[1].ToString();
                    }
                    else if (row[0].ToString() == "FtpServerName")
                    {
                        FtpUserName = row[1].ToString();
                    }
                    else if (row[0].ToString() == "FtpServerPassword")
                    {
                        FtpPassword = row[1].ToString();
                    }
                    else if (row[0].ToString() == "FtpServerPort")
                    {
                        FtpServerPort = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ListenPort")
                    {
                        ListenPort = row[1].ToString();
                    }
                    else if (row[0].ToString() == "NoticeListenPort")
                    {
                        NoticeListenPort = row[1].ToString();
                    }
                    else if (row[0].ToString() == "NoticeSendPort")
                    {
                        NoticeSendPort = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ConsoleServerIP")
                    {
                        ConsoleServerIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "TCPConsolePort")
                    {
                        TCPConsolePort = row[1].ToString();
                    }
                    else if (row[0].ToString() == "SSResponseThreshold")
                    {
                        SSResponseThreshold = row[1].ToString();
                    }
                    else if (row[0].ToString() == "MonitorIP")
                    {
                        MonitorIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ImageCutExePath")
                    {
                        ImageCutExePath = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ServerType_IsCenter")
                    {
                        ServerType_IsCenter = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WS_QDB_GetData")
                    {
                        WS_QDB_GetData = row[1].ToString();
                    }
                    else if (row[0].ToString() == "GetHenuEXE")
                    {
                        GetHenuEXE = row[1].ToString();
                    }
                    else if (row[0].ToString() == "DeployedHadoopIP")
                    {
                        DeployedHadoopIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "JcgxEndPointName")
                    {
                        JcgxEndPointName = row[1].ToString();
                    }
                    else if (row[0].ToString() == "DataBusServerUrl")
                    {
                        DataBusServerUrl = row[1].ToString();
                    }
                    else if (row[0].ToString() == "FileServerIP")
                    {
                        FileServerIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "HJStorageSitesPath")
                    {
                        HJStorageSitesPath = row[1].ToString();
                    }
                    else if (row[0].ToString() == "DataDownLoadPath")
                    {
                        DataDownLoadPath = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WS_QDB_Searcher_APP")
                    {
                        WS_QDB_Searcher_APP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WS_QDB_Searcher_MySQL")
                    {
                        WS_QDB_Searcher_MySQL = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WS_QDB_Searcher_Sqlite")
                    {
                        WS_QDB_Searcher_Sqlite = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WS_QDB_SubmitOrder")
                    {
                        WS_QDB_SubmitOrder = row[1].ToString();
                    }
                    else if (row[0].ToString() == "DeployedHadoopIP_History")
                    {
                        DeployedHadoopIP_History = row[1].ToString();
                    }
                    else if (row[0].ToString() == "JcgxEndPointAddress")
                    {
                        JcgxEndPointAddress = row[1].ToString();
                    }
                    else if (row[0].ToString() == "SnffEndPointAddress")
                    {
                        SnffEndPointAddress = row[1].ToString();
                    }
                    else if (row[0].ToString() == "WPFFEndPointAddress")
                    {
                        WPFFEndPointAddress = row[1].ToString();
                    }
                    else if (row[0].ToString() == "NEWFTPEndPointAddress")
                    {
                        NEWFTPEndPointAddress = row[1].ToString();
                    }

                    else if (row[0].ToString() == "OLDNEWFTPEndPointAddress")
                    {
                        OLDNEWFTPEndPointAddress = row[1].ToString();
                    }

                    else if (row[0].ToString() == "FtpServerIP")
                    {
                        FtpServerIP = row[1].ToString();
                    }
                    else if (row[0].ToString() == "ResultTileZipPath")
                    {
                        ResultTileZipPath = row[1].ToString();
                    }
                    else if (row[0].ToString() == "PreviewPath")
                    {
                        PreviewPath = releasePath(row[1].ToString());
                    }
                }
                Created = true;
            }
            catch (Exception e)
            {
                throw new Exception("create:获取元数据异常", e);
            }
        }