コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (FromAddress != null)
         {
             hashCode = hashCode * 59 + FromAddress.GetHashCode();
         }
         if (HostPrefix != null)
         {
             hashCode = hashCode * 59 + HostPrefix.GetHashCode();
         }
         if (NotifyOnabort != null)
         {
             hashCode = hashCode * 59 + NotifyOnabort.GetHashCode();
         }
         if (NotifyOncomplete != null)
         {
             hashCode = hashCode * 59 + NotifyOncomplete.GetHashCode();
         }
         if (NotifyOncontainercomplete != null)
         {
             hashCode = hashCode * 59 + NotifyOncontainercomplete.GetHashCode();
         }
         if (NotifyUseronly != null)
         {
             hashCode = hashCode * 59 + NotifyUseronly.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
 public AsyncCallbackService(AsyncCallbackRepository repo, AppConf conf) : base(repo, conf)
 {
     HostPrefix = new HostPrefix {
         HostName = Machine.Current.DnsName, Port = RandomNumber.Between(49152, 65535)
     };
     AsyncCallbackRepository = repo;
     _pendingRequests        = new ConcurrentDictionary <string, Action <AsyncExecutionResponse> >();
 }
コード例 #3
0
ファイル: ConsoleActions.cs プロジェクト: dekkerb115/Bam.Net
        public static void StartTrooServer(ConsoleLogger logger, IRepository repo)
        {
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultContentRoot));

            trooServer = new TrooServer(conf, logger, repo)
            {
                HostPrefixes       = new HashSet <HostPrefix>(HostPrefix.FromDefaultConfiguration()),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            trooServer.Start();
        }
コード例 #4
0
        public static void StartGlooServer(ConsoleLogger logger)
        {
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultContentRoot));

            glooServer = new GlooServer(conf, logger, GetArgument("verbose", "Log responses to the console?").IsAffirmative())
            {
                HostPrefixes       = new HashSet <HostPrefix>(HostPrefix.FromDefaultConfiguration("localhost", 9100)),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            glooServer.Start();
        }
コード例 #5
0
 public override void Start()
 {
     HostPrefix[] copy = new HostPrefix[HostPrefixes.Count];
     HostPrefixes.CopyTo(copy);
     ServiceSubdomains.Each(sub =>
     {
         copy.Each(hp =>
         {
             HostPrefixes.Add(hp.FromServiceSubdomain(sub));
         });
     });
     base.Start();
 }
コード例 #6
0
        public static HostPrefix[] GetConfiguredHostPrefixes()
        {
            int  port = int.Parse(DefaultConfiguration.GetAppSetting("Port", "80"));
            bool ssl  = DefaultConfiguration.GetAppSetting("Ssl").IsAffirmative();
            List <HostPrefix> results = new List <HostPrefix>();

            foreach (string hostName in DefaultConfiguration.GetAppSetting("HostNames").Or("localhost").DelimitSplit(",", true))
            {
                HostPrefix hostPrefix = new HostPrefix()
                {
                    HostName = hostName,
                    Port     = port,
                    Ssl      = ssl
                };
                results.Add(hostPrefix);
            }
            return(results.ToArray());
        }
コード例 #7
0
        /// <summary>
        /// Returns true if ComDayCqWorkflowImplEmailEMailNotificationServiceProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComDayCqWorkflowImplEmailEMailNotificationServiceProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComDayCqWorkflowImplEmailEMailNotificationServiceProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     FromAddress == other.FromAddress ||
                     FromAddress != null &&
                     FromAddress.Equals(other.FromAddress)
                     ) &&
                 (
                     HostPrefix == other.HostPrefix ||
                     HostPrefix != null &&
                     HostPrefix.Equals(other.HostPrefix)
                 ) &&
                 (
                     NotifyOnabort == other.NotifyOnabort ||
                     NotifyOnabort != null &&
                     NotifyOnabort.Equals(other.NotifyOnabort)
                 ) &&
                 (
                     NotifyOncomplete == other.NotifyOncomplete ||
                     NotifyOncomplete != null &&
                     NotifyOncomplete.Equals(other.NotifyOncomplete)
                 ) &&
                 (
                     NotifyOncontainercomplete == other.NotifyOncontainercomplete ||
                     NotifyOncontainercomplete != null &&
                     NotifyOncontainercomplete.Equals(other.NotifyOncontainercomplete)
                 ) &&
                 (
                     NotifyUseronly == other.NotifyUseronly ||
                     NotifyUseronly != null &&
                     NotifyUseronly.Equals(other.NotifyUseronly)
                 ));
        }
コード例 #8
0
ファイル: ConsoleActions.cs プロジェクト: dekkerb115/Bam.Net
        public static void StartVyooServer(ConsoleLogger logger)
        {
            DataSettings.Current.SetDefaultDatabaseFor <Session>(out Database userDb);
            userDb.TryEnsureSchema <Session>();
            DataSettings.Current.SetDefaultDatabaseFor <SecureSession>(out Database sessionDb);
            sessionDb.TryEnsureSchema <SecureSession>();
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultRoot));

            AppConf[] appConfigs = conf.AppConfigs;

            List <HostPrefix> hostPrefixes        = new List <HostPrefix>(HostPrefix.FromDefaultConfiguration("localhost", 7400));
            string            hostAppMapsFilePath = Path.Combine(conf.ContentRoot, "apps", hostAppMapsFileName);

            if (File.Exists(hostAppMapsFilePath))
            {
                HostAppMap[] hostAppMaps = HostAppMap.Load(hostAppMapsFilePath);
                if (Arguments.Contains("apps"))
                {
                    string[] appNamesToServe = Arguments["apps"].DelimitSplit(",", ";");
                    appConfigs = conf.AppConfigs.Where(ac => ac.Name.In(appNamesToServe)).ToArray();
                    hostPrefixes.AddRange(hostAppMaps.Where(ham => ham.AppName.In(appNamesToServe)).Select(ham => new HostPrefix {
                        HostName = ham.Host, Port = 80
                    }).ToArray());
                }
                else
                {
                    hostPrefixes.AddRange(HostPrefix.FromHostAppMaps(hostAppMaps));
                }
            }

            vyooServer = new VyooServer(appConfigs, logger, GetArgument("verbose", "Log responses to the console?").IsAffirmative())
            {
                HostPrefixes       = new HashSet <HostPrefix>(hostPrefixes),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            vyooServer.Start();
        }
コード例 #9
0
ファイル: Extensions.cs プロジェクト: ThreeHeadz/Bam.Net
 public static ServiceProxyServer Serve <T>(this T service, HostPrefix hostPrefix, ILogger logger = null, BamConf conf = null) where T : ProxyableService
 {
     return(service.Serve <T>(logger, hostPrefix.HostName, hostPrefix.Port, hostPrefix.Ssl, conf));
 }