예제 #1
0
        public NatsClient(ILog log, INatsConfig natsConfig)
        {
            this.log = log;

            this.natsHost     = natsConfig.Host;
            this.natsPort     = natsConfig.Port;
            this.natsUser     = natsConfig.User;
            this.natsPassword = natsConfig.Password;

            uniqueIdentifier = Guid.NewGuid();
            log.Debug(Resources.NatsClient_Initialized_Fmt, UniqueIdentifier, natsHost, natsPort);
        }
예제 #2
0
        public NatsClient(ILog log, INatsConfig natsConfig)
        {
            this.log  = log;

            this.natsHost     = natsConfig.Host;
            this.natsPort     = natsConfig.Port;
            this.natsUser     = natsConfig.User;
            this.natsPassword = natsConfig.Password;

            uniqueIdentifier = Guid.NewGuid();
            log.Debug(Resources.NatsClient_Initialized_Fmt, UniqueIdentifier, natsHost, natsPort);
        }
예제 #3
0
 public void UseConfig(INatsConfig natsConfig)
 {
     if (startAttempted)
     {
         throw new InvalidOperationException(Resources.NatsClient_CantChangeConfigAfterStart_Message);
     }
     else
     {
         this.natsHost     = natsConfig.Host;
         this.natsPort     = natsConfig.Port;
         this.natsUser     = natsConfig.User;
         this.natsPassword = natsConfig.Password;
     }
 }
예제 #4
0
        public DeaConfig(INatsConfig natsConfig)
        {
            this.deaSection = (DeaSection)ConfigurationManager.GetSection(DeaSection.SectionName);
            this.localIPAddress = Utility.GetLocalIPAddress(deaSection.LocalRoute, natsConfig.Host);

            this.filesServiceUri = new Uri(String.Format("http://*****:*****@"SOFTWARE\Microsoft\InetStp"))
                    {
                        iisInstallPath = subKey.GetValue("InstallPath").ToString();
                    }
                }
                appCmdPath = Path.Combine(iisInstallPath, "appcmd.exe");
                if (File.Exists(appCmdPath))
                {
                    hasAppCmd = true;
                }
                else
                {
                    appCmdPath = null;
                    hasAppCmd = false;
                }
            }
            catch
            {
                appCmdPath = null;
                hasAppCmd = false;
            }
        }
예제 #5
0
        public DeaConfig(INatsConfig natsConfig)
        {
            this.deaSection     = (DeaSection)ConfigurationManager.GetSection(DeaSection.SectionName);
            this.localIPAddress = Utility.GetLocalIPAddress(deaSection.LocalRoute, natsConfig.Host);

            this.filesServiceUri = new Uri(String.Format("http://*****:*****@"SOFTWARE\Microsoft\InetStp"))
                    {
                        iisInstallPath = subKey.GetValue("InstallPath").ToString();
                    }
                }
                appCmdPath = Path.Combine(iisInstallPath, "appcmd.exe");
                if (File.Exists(appCmdPath))
                {
                    hasAppCmd = true;
                }
                else
                {
                    appCmdPath = null;
                    hasAppCmd  = false;
                }
            }
            catch
            {
                appCmdPath = null;
                hasAppCmd  = false;
            }
        }
예제 #6
0
 public void UseConfig(INatsConfig natsConfig)
 {
     if (startAttempted)
     {
         throw new InvalidOperationException(Resources.NatsClient_CantChangeConfigAfterStart_Message);
     }
     else
     {
         this.natsHost     = natsConfig.Host;
         this.natsPort     = natsConfig.Port;
         this.natsUser     = natsConfig.User;
         this.natsPassword = natsConfig.Password;
     }
 }