public void RedisSourceDefinition_Equals_RedisServiceSource_Null_Expected_False() { var redisSourceDefinition = new RedisSourceDefinition(); const IRedisServiceSource redisServiceSource = null; var isEqual = redisSourceDefinition.Equals(redisServiceSource); Assert.IsFalse(isEqual); }
public void SaveRedisServiceSource(IRedisServiceSource redisServiceSource, Guid serverWorkspaceId) { var con = Connection; var comsController = CommunicationControllerFactory.CreateController(nameof(SaveRedisSource)); var serialiser = new Dev2JsonSerializer(); comsController.AddPayloadArgument(SaveRedisSource.RedisSource, serialiser.SerializeToBuilder(redisServiceSource)); var output = comsController.ExecuteCommand <IExecuteMessage>(con, GlobalConstants.ServerWorkspaceID); if (output.HasError) { throw new WarewolfSaveException(output.Message.ToString(), null); } }
public StringBuilder Execute(Dictionary <string, StringBuilder> values, IWorkspace theWorkspace) { var msg = new ExecuteMessage(); var serializer = new Dev2JsonSerializer(); try { Dev2Logger.Info("Save Redis Resource Service", GlobalConstants.WarewolfInfo); values.TryGetValue(Warewolf.Service.SaveRedisSource.RedisSource, out StringBuilder resourceDefinition); IRedisServiceSource redisSourceDef = serializer.Deserialize <RedisSourceDefinition>(resourceDefinition); if (redisSourceDef.Path == null) { redisSourceDef.Path = string.Empty; } if (redisSourceDef.Path.EndsWith("\\")) { redisSourceDef.Path = redisSourceDef.Path.Substring(0, redisSourceDef.Path.LastIndexOf("\\", StringComparison.Ordinal)); } var redisSource = new RedisSource { ResourceID = redisSourceDef.Id, HostName = redisSourceDef.HostName, Port = redisSourceDef.Port, AuthenticationType = redisSourceDef.AuthenticationType, Password = redisSourceDef.Password, ResourceName = redisSourceDef.Name }; ResourceCat.SaveResource(GlobalConstants.ServerWorkspaceID, redisSource, redisSourceDef.Path); msg.HasError = false; } catch (Exception err) { msg.HasError = true; msg.Message = new StringBuilder(err.Message); Dev2Logger.Error(err, GlobalConstants.WarewolfError); } return(serializer.SerializeToBuilder(msg)); }
public bool Equals(IRedisServiceSource other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } var equals = true; equals &= string.Equals(HostName, other.HostName); equals &= Id == other.Id; equals &= string.Equals(Name, other.Name); equals &= string.Equals(Password, other.Password); equals &= AuthenticationType == other.AuthenticationType; return(equals); }
public void TestConnection(IRedisServiceSource resource) { _updateRepository.TestConnection(resource); }
public void Save(IRedisServiceSource toRedisSource) { _updateRepository.Save(toRedisSource); }
public void TestConnection(IRedisServiceSource redisServiceSource) => UpdateManagerProxy.TestConnection(redisServiceSource);
public void Save(IRedisServiceSource redisServiceSource) => UpdateManagerProxy.SaveRedisServiceSource(redisServiceSource, GlobalConstants.ServerWorkspaceID);