Ejemplo n.º 1
0
        public ClusterRouterGroupSettings(int totalInstances, bool allowLocalRoutees, string useRole, ImmutableHashSet <string> routeesPaths) : base(totalInstances, allowLocalRoutees, useRole)
        {
            RouteesPaths = routeesPaths;
            if (routeesPaths == null || routeesPaths.IsEmpty || string.IsNullOrEmpty(routeesPaths.First()))
            {
                throw new ArgumentException("routeesPaths must be defined", "routeesPaths");
            }

            //validate that all routeesPaths are relative
            foreach (var path in routeesPaths)
            {
                if (RelativeActorPath.Unapply(path) == null)
                {
                    throw new ArgumentException(string.Format("routeesPaths [{0}] is not a valid relative actor path.", path), "routeesPaths");
                }
            }
        }
Ejemplo n.º 2
0
        public ClusterRouterGroupSettings(int totalInstances, IEnumerable <string> routeesPaths, bool allowLocalRoutees, string useRole = null)
            : base(totalInstances, allowLocalRoutees, useRole)
        {
            if (routeesPaths == null || !routeesPaths.Any() || string.IsNullOrEmpty(routeesPaths.First()))
            {
                throw new ArgumentException("RouteesPaths must be defined", nameof(routeesPaths));
            }

            RouteesPaths = routeesPaths;

            // validate that all RouteesPaths are relative
            foreach (var path in routeesPaths)
            {
                if (RelativeActorPath.Unapply(path) == null)
                {
                    throw new ArgumentException($"routeesPaths [{path}] is not a valid relative actor path.", nameof(routeesPaths));
                }
            }
        }
Ejemplo n.º 3
0
 protected IEnumerable <string> Elements(string path)
 {
     return(RelativeActorPath.Unapply(path) ?? new List <string>());
 }