Exemple #1
0
        public ACSServer(HostComm hostComm, L3.Cargo.Communications.Common.Logger log, string localCaseListPath, out CaseList caseList)
        {
            string uri = (String)ConfigurationManager.AppSettings["ConnectionUri"];
            string AllowedIPList = (String)ConfigurationManager.AppSettings["AllowedIPList"];

            string path = localCaseListPath;
            string caseListSource = (path == null
                                         ? (String)ConfigurationManager.AppSettings["CaseListSource"]
                                         : "File System"
                                    );
            string Alias = (String)ConfigurationManager.AppSettings["ServerName"];
            m_ProfilesFolder = ConfigurationManager.AppSettings["UserProfiles"];                                  

            bool isReference;

            if (ConfigurationManager.AppSettings["ACSMode"].Equals("Archive"))
            {
                isReference = false;
                if (path == null)
                    path = ConfigurationManager.AppSettings["CaseListFileSystemPath"];
            }
            else
            {
                isReference = true;
                if (path == null)
                    path = ConfigurationManager.AppSettings["ReferenceFileSystemPath"];
            }

            if (caseListSource == "File System")
                caseList = new FSCaseList(log, path, isReference);
            else
                caseList = new DBCaseList(log, path, isReference);

            caseList.configFullSync();
            
            base.Subscribe(caseList);
            base.caseList = caseList;

            bool loginRequired = Boolean.Parse(ConfigurationManager.AppSettings["LoginRequired"]);
            acsCommHost = new NetworkHost(this, new Uri(uri), Alias, AllowedIPList, loginRequired);
            acsCommHost.SendTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingSendTimeoutMin"]);
            acsCommHost.ReceiveTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingReceiveTimeoutMin"]);

            EnableArchiveDecision = Boolean.Parse(ConfigurationManager.AppSettings["EnableArchiveDecision"]);

            caseList.List.CaseListTable.CaseListTableRowChanged += new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_RowChanged);
            caseList.List.CaseListTable.CaseListTableRowDeleting += new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_RowChanged);

            m_HostComm = hostComm;
            m_HostComm.ConnectedToHostEvent += new HostComm.ConnectedToHostHandler(hostComm_ConnectedToHostEvent);            

            m_WSCallbacks = new Dictionary<String, ICaseRequestManagerCallback>();
            m_WSLastPing = new Dictionary<String, DateTime>();

            ClientConnThread = new Thread(new ThreadStart(ClientConnState));
        }
Exemple #2
0
        public WSServer(CargoHostEndPoint cargoHost, string alias, string uri, string allowedIPs, string profileDir, bool enableArchiveDecision) : 
            base()
        {
            m_Shutdown = false;
            m_CargoHostEndPoint = cargoHost;
            m_ProfilesFolder = profileDir;
            m_Alias = alias;
            m_EnableArchiveDecision = enableArchiveDecision;

            m_ClientListLock = new object();
            m_CaseListLock = new object();
            _workstationLoadListLock = new object();
            _updateCaseAssignmentLock = new object();

            m_HostConnThread = new Thread(new ThreadStart(HostConnState));
            m_ClientConnThread = new Thread(new ThreadStart(ClientConnState));

            m_NetworkHost = new NetworkHost(this, new Uri(uri), alias, allowedIPs);
            m_NetworkHost.SendTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingSendTimeoutMin"]);
            m_NetworkHost.ReceiveTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingReceiveTimeoutMin"]);
            m_Callbacks = new WSServerCallbacks();

            m_ManualCodingCallback = new ManualCodingCallback_Impl(this);
            m_AnalystCallback = new AnalystCallback_Impl(this);
            m_CaseChangeCallback = new CaseChangeCallback_Impl(this);

            _workstationLoadBalanceList = new List<LoadBalanceInfo>();

            _loadBalanceCheckTimer = new Timer(new TimerCallback(LoadBalanceCheckTimerCallback), null, Timeout.Infinite, Timeout.Infinite);
            _loadBalanceTimerSet = false;
            _loadBalanceTimerSelectedWorkstation = string.Empty;

            base.Subscribe(base.caseList);
            base.caseList.StartUpdate = true;
        }