public JoinWithOfflineSeedNodeConfig() { Seed = Role("seed"); NonSeed = Role("nonseed"); CommonConfig = DebugConfig(false).WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public void DeployOn(RoleName role, string deployment) { ImmutableList<string> roleDeployments; _deployments.TryGetValue(role, out roleDeployments); _deployments = _deployments.SetItem(role, roleDeployments == null ? ImmutableList.Create(deployment) : roleDeployments.Add(deployment)); }
public ConsistentHashingRouterMultiNodeConfig() { _first = Role("first"); _second = Role("second"); _third = Role("third"); CommonConfig = MultiNodeLoggingConfig.LoggingConfig.WithFallback(DebugConfig(true)) .WithFallback(ConfigurationFactory.ParseString(@" common-router-settings = { router = consistent-hashing-pool nr-of-instances = 10 cluster { enabled = on max-nr-of-instances-per-node = 2 } } akka.actor.deployment { /router1 = ${common-router-settings} /router3 = ${common-router-settings} /router4 = ${common-router-settings} } akka.cluster.publish-stats-interval = 5s ")) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public RoundRobinMultiNodeConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); Fourth = Role("fourth"); CommonConfig = DebugConfig(true); DeployOnAll(@" /service-hello { router = round-robin-pool nr-of-instances = 3 target.nodes = [""@first@"", ""@second@"", ""@third@""] } /service-hello2 { router = round-robin-pool target.nodes = [""@first@"", ""@second@"", ""@third@""] } /service-hello3 { router = round-robin-group routees.paths = [ ""@first@/user/target-first"", ""@second@/user/target-second"", ""@third@/user/target-third""] } "); }
public ClusterClientSpecConfig() { Client = Role("client"); First = Role("first"); Second = Role("second"); Third = Role("third"); Fourth = Role("fourth"); CommonConfig = ConfigurationFactory.ParseString(@" akka.loglevel = DEBUG akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"" akka.remote.log-remote-lifecycle-events = off akka.cluster.auto-down-unreachable-after = 0s akka.cluster.client.heartbeat-interval = 1s akka.cluster.client.acceptable-heartbeat-pause = 3s akka.cluster.client.refresh-contacts-interval = 1s # number-of-contacts must be >= 4 because we shutdown all but one in the end akka.cluster.client.receptionist.number-of-contacts = 4 akka.cluster.client.receptionist.heartbeat-interval = 10s akka.cluster.client.receptionist.acceptable-heartbeat-pause = 10s akka.cluster.client.receptionist.failure-detection-interval = 1s akka.test.filter-leeway = 10s ") .WithFallback(ClusterClientReceptionist.DefaultConfig()) .WithFallback(DistributedPubSub.DefaultConfig()); TestTransport = true; }
public RoleName Role(string name) { if (_roles.Exists(r => r.Name == name)) throw new ArgumentException("non-unique role name " + name); var roleName = new RoleName(name); _roles = _roles.Add(roleName); return roleName; }
public LookupRemoteActorMultiNetSpec() { CommonConfig = DebugConfig(false); Master = Role("master"); Slave = Role("slave"); }
public TestConductorSpecConfig() { Master = Role("master"); Slave = Role("slave"); CommonConfig = DebugConfig(true); TestTransport = true; }
public NodeUpConfig() { First = Role("first"); Second = Role("second"); CommonConfig = DebugConfig(false) .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet()); }
private void Join(RoleName from, RoleName to) { RunOn(() => { Cluster.Join(Node(to).Address); CreateSingleton(); }, from); }
public NodeMembershipSpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet(); }
private void Join(RoleName from, RoleName to) { RunOn(() => { Cluster.Join(Node(to).Address); ClusterClientReceptionist.Get(Sys); }, from); EnterBarrier(from.Name + "-joined"); }
public MembershipChangeListenerUpConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = DebugConfig(false) .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet()); }
/// <summary> /// Excludes the role. /// </summary> /// <param name="query">The query.</param> /// <param name="roleName">Name of the role.</param> /// <returns></returns> public static IQueryable<User> ExcludeRole(this IQueryable<User> query, RoleName? roleName) { if (roleName.HasValue) { var exclude = new string[] { roleName.Value.ToString() }; query = query.Where(u => u.UserRoles.Select(ur => ur.Role.RoleName).Except(exclude).Any()); } return query; }
public ClientDowningNodeThatIsUnreachableMultiNodeConfig(bool failureDetectorPuppet) { First = Role("first"); Second = Role("second"); Third = Role("third"); Fourth = Role("fourth"); CommonConfig= DebugConfig(false).WithFallback(MultiNodeClusterSpec.ClusterConfig(failureDetectorPuppet)); }
public ClusterConsistentHashingGroupSpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = DebugConfig(false) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public MinMembersBeforeUpSpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = ConfigurationFactory.ParseString(@" akka.cluster.min-nr-of-members = 3 ").WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet()); }
public RestartNodeSpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = DebugConfig(true) .WithFallback(ConfigurationFactory.ParseString(@"akka.cluster.auto-down-unreachable-after = 5s")) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public NodeDowningAndBeingRemovedSpecSpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = DebugConfig(false) .WithFallback(ConfigurationFactory.ParseString("akka.cluster.auto-down-unreachable-after = off")) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public UnreachableNodeJoinsAgainConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); Fourth = Role("fourth"); CommonConfig = ConfigurationFactory.ParseString("akka.remote.log-remote-lifecycle-events = off") .WithFallback(DebugConfig(false)).WithFallback(MultiNodeClusterSpec.ClusterConfig()); TestTransport = true; // need to use the throttler and blackhole }
public LeaderDowningNodeThatIsUnreachableConfig(bool failureDectectorPuppet) { First = Role("first"); Second = Role("second"); Third = Role("third"); Fourth = Role("fourth"); CommonConfig = DebugConfig(false) .WithFallback(ConfigurationFactory.ParseString(@"akka.cluster.auto-down-unreachable-after = 2s")) .WithFallback(MultiNodeClusterSpec.ClusterConfig(failureDectectorPuppet)); }
public LeaderElectionSpecConfig(bool failureDectectorPuppet) { Controller = Role("controller"); First = Role("first"); Second = Role("second"); Third = Role("third"); Forth = Role("forth"); CommonConfig = DebugConfig(false) .WithFallback(MultiNodeClusterSpec.ClusterConfig(failureDectectorPuppet)); }
public AttemptSysMsgRedeliverySpecConfig() { First = Role("first"); Second = Role("second"); Third = Role("third"); CommonConfig = DebugConfig(false) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); TestTransport = true; }
public DisallowJoinOfTwoClusterSpecConfig() { a1 = Role("a1"); a2 = Role("a2"); b1 = Role("b1"); b2 = Role("b2"); c1 = Role("c1"); CommonConfig = ConfigurationFactory.ParseString("") .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet()); }
protected ClusterSingletonManagerLeaveSpec(ClusterSingletonManagerLeaveSpecConfig config) : base(config) { _first = config.First; _second = config.Second; _third = config.Third; _echoProxy = new Lazy<IActorRef>(() => Sys.ActorOf(ClusterSingletonProxy.Props( singletonManagerPath: "/user/echo", settings: ClusterSingletonProxySettings.Create(Sys)), "echoProxy")); }
public ClusterConsistentHashingGroupSpecConfig() { _first = Role("first"); _second = Role("second"); _third = Role("third"); CommonConfig = MultiNodeLoggingConfig.LoggingConfig.WithFallback(DebugConfig(false)) .WithFallback(ConfigurationFactory.ParseString(@" akka.cluster.publish-stats-interval = 5s ")) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public SingletonClusterConfig(bool failureDetectorPuppet) { First = Role("first"); Second = Role("second"); CommonConfig = DebugConfig(false) .WithFallback(ConfigurationFactory.ParseString(@" akka.cluster.auto-down-unreachable-after = 0s akka.cluster.failure-detector.threshold = 4 ")) .WithFallback(MultiNodeClusterSpec.ClusterConfig(failureDetectorPuppet)); }
public LeaderLeavingSpecConfig() { _first = Role("first"); _second = Role("second"); _third = Role("third"); CommonConfig = MultiNodeLoggingConfig.LoggingConfig .WithFallback(DebugConfig(true)) .WithFallback(@"akka.cluster.auto-down-unreachable-after = 0s akka.cluster.publish-stats-interval = 25 s") .WithFallback(MultiNodeClusterSpec.ClusterConfigWithFailureDetectorPuppet()); }
public JoinSeedNodeConfig() { _seed1 = Role("seed1"); _seed2 = Role("seed2"); _seed3 = Role("seed3"); _ordinary1 = Role("ordinary1"); _ordinary2 = Role("ordinary2"); CommonConfig = MultiNodeLoggingConfig.LoggingConfig.WithFallback(DebugConfig(true)) .WithFallback(ConfigurationFactory.ParseString(@"akka.cluster.publish-stats-interval = 25s")) .WithFallback(MultiNodeClusterSpec.ClusterConfig()); }
public PiercingShouldKeepQuarantineMultiNodeConfig() { First = Role("first"); Second = Role("second"); CommonConfig = DebugConfig(true) .WithFallback(ConfigurationFactory.ParseString(@" akka.loglevel = INFO akka.remote.log-remote-lifecycle-events = INFO akka.remote.retry-gate-closed-for = 10s ")); }
public NoAbstractClassesConfig() { Dummy = Role("dummy"); }
public async Task <IdentityResult> AddToRoleAsync(string id, RoleName role) => await UserManager.AddToRoleAsync(id, role);
public async Task <bool> AdmitRole(RoleName roleName, User user) => user == null ? false : (await userManager.AddToRoleAsync(user, Utils.EnumToString(roleName))).Succeeded;
protected IEnumerable <RoleName> AllBut(RoleName roleName, IEnumerable <RoleName> roles) { return(roles.Where(x => !x.Equals(roleName))); }
private UserRoleVM GetUserRole(RoleName role, IEnumerable <RoleName> userRoles) { //return new UserRoleVM(role.ToString(), Resx<Resources.Views>.Localizer[role.ToString()], userRoles.Contains(role)); throw new NotImplementedException(); }
public async Task <bool> IsPermitted(RoleName roleName, int userId) { var user = await userManager.FindByIdAsync(userId.ToString()); return(user == null ? false : await userManager.IsInRoleAsync(user, Utils.EnumToString(roleName))); }
private IActorRef Identify(RoleName role, string actorName) { Sys.ActorSelection(Node(role) / "user" / actorName).Tell(new Identify(actorName)); return(ExpectMsg <ActorIdentity>().Subject); }
protected Bugfix4353Spec(Bugfix4353SpecsConfig config) : base(config, typeof(Bugfix4353Spec)) { First = config.First; Second = config.Second; Third = config.Third; }
public static bool IsInRole(this ApplicationUser user, RoleName roleName) { return(user.Roles.Any(x => x.Role.Name == RoleName.TeamManagement)); }
public Role(RoleName name, RoleName food) { Name = name; Food = food; }
public async Task <string> GetRoleId(RoleName roleName) => (await database.RoleRepository.Find(r => r.Name.ToLower() == Utils.EnumToString <RoleName>(roleName).ToLower()))?.Id;
/// <summary> /// Adds a role assignment to a user. Returns a failure response if that user already has the role assigned to them. /// </summary> /// <param name="pConnectionServer" type="Cisco.UnityConnection.RestFunctions.ConnectionServerRest"> /// Connection server that the user being edited lives on. /// </param> /// <param name="pUserObjectId" type="string"> /// Unique ID of the user to add the role to /// </param> /// <param name="pRoleName" type="string"> /// value from the RoleName enum representing the role to add to the user /// </param> /// <returns> /// Instance of the WebCallResults class containing details of the items sent and recieved from the CUPI interface. /// </returns> public static WebCallResult AddRoleToUser(ConnectionServerRest pConnectionServer, string pUserObjectId, RoleName pRoleName) { string strRoleName = GetRoleName(pRoleName); if (string.IsNullOrEmpty(strRoleName)) { WebCallResult res = new WebCallResult { Success = false, ErrorText = "Invalid role enum value passed to AddRoleToUser:"******"Could not find role ObjectId by name in AddRoleToUser:" + strRoleName }; return(res); } return(AddRoleToUser(pConnectionServer, pUserObjectId, strRoleObjectId)); }
public async Task <bool> RevokeRole(RoleName roleName, User user) => RevokeRole(await GetRoleId(roleName), user);
public async Task <bool> AdmitRole(RoleName roleName, User user) => AdmitRole(await GetRoleId(roleName), user);
protected DistributedPubSubMediatorSpec(DistributedPubSubMediatorSpecConfig config) : base(config, typeof(DistributedPubSubMediatorSpec)) { _first = config.First; _second = config.Second; _third = config.Third; }
private string GetDistinctString(bool ShowPathInfo) { LoadUpperRef(); string str = String.Format(@"{0}.{1}", (UpperRef != null && ShowPathInfo ? UpperRef.GetFullEntityPath(".") : ""), RoleName.Trim()); str = str.Trim(".".ToCharArray()); return(str); }
protected IEnumerable <RoleName> AllBut(RoleName roleName) { return(AllBut(roleName, Roles)); }
public override int GetHashCode() { return((ActivityId.ToString() + "|" + RoleName.ToString()).GetHashCode()); }
private void Join(RoleName from, RoleName to) { RunOn(() => cluster.Join(Node(to).Address), from); EnterBarrier(from.Name + "-joined"); }
private ActorSelection Echo(RoleName oldest) { return(Sys.ActorSelection(new RootActorPath(GetAddress(oldest)) / "user" / "echo" / "singleton")); }
public bool IsInRole(string userId, RoleName role) => GetUserRoles(userId).Contains(role);
private ActorSelection GetConsumer(RoleName oldest) { return(Sys.ActorSelection(new RootActorPath(Node(oldest).Address) / "user" / "consumer" / "singleton")); }
public async Task <bool> RevokeRole(RoleName roleName, User user) => user == null ? false : (await userManager.RemoveFromRoleAsync(user, Utils.EnumToString(roleName))).Succeeded;
private void Apply(NewClientAdded create) { _name = new RoleName(create.Name); _normalizedName = new RoleNormalizedName(create.NormalizedName); SetConcurrencyCheckStamp(create.ConcurrencyCheckStamp); }
public static Role Create(int roleId, RoleName roleName, RoleDescription roleDescription, bool isActive) { return(new Role { Id = roleId, RoleName = roleName, RoleDescription = roleDescription, IsActive = isActive }); }
private void Apply(RoleRenamed rename) { _name = new RoleName(rename.Name); _normalizedName = new RoleNormalizedName(rename.NormalizedName); }
public DeeplyInheritedConfig() { DeeplyInheritedChildRole = Role("DeeplyInheritedChildRole"); }
public bool IsPermitted(RoleName roleName, User user) => user.UserRoles.Any(ur => ur.Role.Name == Utils.EnumToString(roleName));
public async Task <bool> RoleExists(RoleName roleName) => await GetRoleId(roleName) != null;
/// <summary> /// Removes a role assignment from a user. Returns a failure response if that user does not have the role assigned to them. /// </summary> /// <param name="pConnectionServer" type="Cisco.UnityConnection.RestFunctions.ConnectionServerRest"> /// Connection server that the user being edited lives on. /// </param> /// <param name="pUserObjectId" type="string"> /// Unique ID of the user to remove the role from /// </param> /// <param name="pRoleName" type="string"> /// value from the RoleName enum representing the role to add to the user /// </param> /// <returns> /// Instance of the WebCallResults class containing details of the items sent and recieved from the CUPI interface. /// </returns> public static WebCallResult RemoveRoleFromUser(ConnectionServerRest pConnectionServer, string pUserObjectId, RoleName pRoleName) { WebCallResult res = new WebCallResult { Success = false }; string strRoleName = GetRoleName(pRoleName); if (string.IsNullOrEmpty(strRoleName)) { res.ErrorText = "Invalid role enum value passed to RemoveRoleFromUser:"******"Role not assigned to user"; return(res); }