private void CreateCollection(IHandlePromiseActions handlePromiseActions, GenericConfig genericConfig, NewCollectionWorkload newCollectionWorkload, NewCollectionRequest request, GenericResponse arg5) { using (var redisManager = new PooledRedisClientManager(new[] { "127.0.0.1:6379" })) using (var redis = redisManager.GetClient()) { redis.SetEntryInHash(request.CollectionName, "visibility", request.Visibility.ToString(CultureInfo.InvariantCulture)); } }
private void ValidateNewCollection(IHandlePromiseActions handlePromiseActions, GenericConfig genericConfig, NewCollectionWorkload newCollectionWorkload, NewCollectionRequest request, GenericResponse arg5) { if (string.IsNullOrEmpty(request.CollectionName)) { handlePromiseActions.Abort(new NullCollectionName()); return; } if (Regex.Match(request.CollectionName, @"^|:olr.*:", RegexOptions.IgnoreCase).Success) { handlePromiseActions.Abort(new InvalidCollectionName(request.CollectionName)); } }
private void BuildCollectionName(IHandlePromiseActions handlePromiseActions, GenericConfig genericConfig, NewCollectionWorkload newCollectionWorkload, NewCollectionRequest request, GenericResponse arg5) { request.CollectionName = request.CollectionName.ToLowerInvariant(); // if (not public), prepend the applicationName if (request.Visibility == 1) { return; } request.CollectionName = string.Format("{0}.{1}", "app", request.CollectionName).ToLowerInvariant(); }
private void BuildRedisCollectionName(IHandlePromiseActions handlePromiseActions, GenericConfig genericConfig, NewCollectionWorkload newCollectionWorkload, NewCollectionRequest request, GenericResponse arg5) { request.CollectionName = string.Format("olrt:{0}", request.CollectionName); }