Exemplo n.º 1
0
        public OpsGridManager(string tibcoServer, string tibcoUser, string tibcoPwd, int updateFromCacheTimerInterval, string msgFilter,
                              string inbMsgFilter, List <string> pPermKeyList, bool pIsSuperUser)
        {
            try
            {
                managedGridList = new List <DevExpress.XtraGrid.GridControl>();

                sumDataCache     = new List <SummaryData>();
                sumDataCacheCopy = new List <SummaryData>();

                rqmtDataCache     = new List <RqmtData>();
                rqmtDataCacheCopy = new List <RqmtData>();

                inbDocViewCache     = new List <InboundDocsView>();
                inbDocViewCacheCopy = new List <InboundDocsView>();

                assDocDataCache     = new List <AssociatedDoc>();
                assDocDataCacheCopy = new List <AssociatedDoc>();

                tradeRqmtConfirmCache     = new List <TradeRqmtConfirm>();
                tradeRqmtConfirmCacheCopy = new List <TradeRqmtConfirm>();

                listenerManager = new ListenerManager(tibcoServer, tibcoUser, tibcoPwd, pPermKeyList, pIsSuperUser);
                Console.WriteLine("Filter Condition: " + msgFilter);
                listenerManager.AddListner("sempra.ops.opsTracking.summary.update", this.NotifyTradeSummaryArrived, msgFilter);
                listenerManager.AddListner("sempra.ops.opsTracking.rqmt.update", this.NotifyTradeRqmtArrived, "");
                listenerManager.AddListner("sempra.ops.opsTracking.inboundDocs.update", this.NotifyInboundDocsArrived, inbMsgFilter);
                listenerManager.AddListner("sempra.ops.opsTracking.associatedDocs.update", this.NotifyAssociatedDocsArrived, inbMsgFilter);
                listenerManager.AddListner("sempra.ops.opsTracking.tradeRqmtConfirm.update", this.NotifyTradeRqmtConfirmArrived, "");

                opsTrackingClock          = new Timer((updateFromCacheTimerInterval) * 1000);
                opsTrackingClock.Elapsed += new ElapsedEventHandler(opsClockElapsed);


                myFireAlarm   = new FireAlarm();
                myFireHandler = new FireHandlerClass(myFireAlarm);
            }
            catch (Exception ex)
            {
                myFireAlarm.ActivateFireAlarm("Error in the OpsGridManager constructor. " + ex.Message);

                string keyListDisplay = string.Empty;
                if (pPermKeyList.Count > 0)
                {
                    keyListDisplay = string.Join(",", pPermKeyList.ToArray());
                }
                else
                {
                    keyListDisplay = "[NONE]";
                }
                throw new Exception("An error occurred while creating a new instance of OpsGridManager using the following values:" + Environment.NewLine +
                                    "Message Server: " + tibcoServer + ", Message User: "******", Update From Cache Timer Interval: " + updateFromCacheTimerInterval + Environment.NewLine +
                                    "Message Filter: " + msgFilter + ", Inbound Message Filter: " + inbMsgFilter + ", Is User a SuperUser? " + pIsSuperUser + Environment.NewLine +
                                    "Permission Keys: " + keyListDisplay + "." + Environment.NewLine +
                                    "Error CNF-349 in " + PROJ_FILE_NAME + ".OpsGridManager(): " + ex.Message);
            }
        }