Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();
            this.Resize += new EventHandler(Form1_Resize);
            notifyIcon1.DoubleClick += new EventHandler(notifyIcon1_DoubleClick);
            notifyIcon1.ContextMenuStrip = contextMenuStrip1;
            ConfigLoader cfg = new ConfigLoader();

            ss = cfg.GetSSProxy(cfg.SSurls[0], "FGSMSadmin", "P@$$Word1234567", null);
            t = new Thread(new ThreadStart(getStatusData));
            t.Start();
            this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);
            listBox1.DrawItem += new DrawItemEventHandler(listBox1_DrawItem);
        }
Esempio n. 2
0
 public static PCSBinding GetPCSProxy(string url, string username, string password, ConfigLoader.AuthMode authMode, string pkiinfo)
 {
     ServicePointManager.Expect100Continue = false;
     PCSBinding r = new PCSBinding();
     r.Url = url;
     switch (authMode)
     {
         case ConfigLoader.AuthMode.usernamePassword:
             r.Credentials = new NetworkCredential(username, (password));
             break;
         case ConfigLoader.AuthMode.PKI:
             r.ClientCertificates.Add(FindCert(pkiinfo));
             break;
     }
     return r;
 }
Esempio n. 3
0
        public void Fire()
        {
            config = MessageProcessor.GetConfig;
            if (config == null)
                return;

            if (HasPersistenceFiles())
            {
                Logger.info("Stored files are present, attempting to restablish communications");
                System.Console.WriteLine("Stored files are present, attempting to restablish communications");
                //grab the first one
                AddDataRequestMsg rr = MessageProcessor.ReadItemsFromDisk();
                if (rr != null)
                {
                    bool online = MessageProcessor.ProcessSingleMessage(rr);
                    if (!online)
                    {
                        Logger.warn("Still offline, we'll try again later");
                        System.Console.WriteLine("Still offline, we'll try again later");
                        MessageProcessor.WriteToDisk(rr);
                    }
                    else
                    {
                        Logger.info("We're online, add all items to the cache.");
                        System.Console.WriteLine("We're online, add all items to the cache.");
                        while (HasPersistenceFiles())
                        {
                            rr = MessageProcessor.ReadItemsFromDisk();
                            if (rr != null)
                            {
                                //use standard built in functions to enqueue the data
                                MessageProcessor.ProcessMessage(rr);
                            }
                            //throttling
                            if (MessageProcessor.GetQueueSize() > 100)
                            {

                                Thread.Sleep(5000);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        public static void SetPolicy(string internalurl, bool recordrequest, bool requestresponse)
        {
            if (String.IsNullOrEmpty(internalurl))
                throw new ArgumentNullException("url");
            TransactionalWebServicePolicy tp = new TransactionalWebServicePolicy();
            tp.PolicyType = policyType.Transactional;
            tp.URL = internalurl;
            tp.RecordHeaders = true;
            tp.RecordRequestMessage = recordrequest;
            tp.RecordResponseMessage = requestresponse;
            tp.MachineName = Environment.MachineName.ToLower();
            tp.BuellerEnabled = false;
            ConfigLoader cf = new ConfigLoader();
            PCSBinding svc = GetPCSProxyAdmin(cf.PCSurls[0]);
            SetServicePolicyRequestMsg req = new SetServicePolicyRequestMsg();

            req.classification = new SecurityWrapper();
            req.policy = tp;
            req.URL = internalurl;
            svc.SetServicePolicy(req);
        }
Esempio n. 5
0
        public static void RemoveService(string internalurl)
        {
            ConfigLoader cf = new ConfigLoader();
            PCSBinding svc = GetPCSProxyAdmin(cf.PCSurls[0]);
            DeleteServicePolicyRequestMsg r = new DeleteServicePolicyRequestMsg();

            r.classification = new SecurityWrapper();
            r.deletePerformanceData = true;
            r.URL = internalurl;
            svc.DeleteServicePolicy(r);
        }
Esempio n. 6
0
 /// <summary>
 /// loads config data from the configloader which comes from the machine.config file
 /// Besure to call Dispose when finished with this object
 /// </summary>
 /// <param name="config"></param>
 public UDDIDiscovery(ConfigLoader config)
 {
     this.config = config;
     uddi = new uddiv3(config.UddiInquiryUrl, config.UddiSecurityUrl, config.UddiUsername, config.UddiEncryptedPassword, config.UddiAuthRequired);
 }
Esempio n. 7
0
        private static void Init()
        {
            MessageProcessor m = MessageProcessor.Instance;
            if (!configured || config == null)
            {
                try
                {
                    config = new ConfigLoader();
                }
                catch (Exception ex)
                {
                    _lasterror = ex.Message;
                    ErrorState = true;

                    configured = false;
                    return;
                    //log this
                }
            }

            configured = true;
        }
Esempio n. 8
0
        //     private Boolean errorState = false;
        // private static Hashtable dependencyCache;
        private MessageProcessor()
        {
            if (AppDomain.CurrentDomain != null)
                AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
            //Shutdown = true;
            currentlevel = new SecurityWrapper();
            currentlevel.caveats = "";
            currentlevel.classification = ClassificationType.U;
            Hashtable t2 = new Hashtable();
            threadmap = Hashtable.Synchronized(t2);
            //log = new TraceSource(name);
            //  dependencyCache = new Hashtable();
            //   dependency_queue = new Queue<DependencyContainer>();
            Hashtable t = new Hashtable();
            policyCache = Hashtable.Synchronized(t);
            // publishingThread = new Thread(new ThreadStart(SendPerformanceData));
            //publishingThread.Start();
            publishingThread = new List<Thread>();

            //  dependencyThread = new Thread(new ThreadStart(SendDependencyData));
            //  dependencyThread.Start();
            Queue q = new Queue();
            the_queue = Queue.Synchronized(q);

            try
            {
                config = new ConfigLoader();
                // polservice = config.GetPCSProxy();
                // dcsservice = config.GetDCSProxy();

            }
            catch
            {
                ErrorState = true;
            }
        }
Esempio n. 9
0
 /// <summary>
 /// loads config data from the configloader which comes from the machine.config file
 /// Besure to call Dispose when finished with this object
 /// </summary>
 /// <param name="config"></param>
 public UDDIDiscovery(ConfigLoader config)
 {
     this.config = config;
     uddi        = new uddiv3(config.UddiInquiryUrl, config.UddiSecurityUrl, config.UddiUsername, config.UddiEncryptedPassword, config.UddiAuthRequired);
 }