コード例 #1
0
 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));
         }
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 private void BuildRedisCollectionName(IHandlePromiseActions handlePromiseActions, GenericConfig genericConfig, NewCollectionWorkload newCollectionWorkload, NewCollectionRequest request, GenericResponse arg5)
 {
     request.CollectionName = string.Format("olrt:{0}", request.CollectionName);
 }
コード例 #4
0
        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));
            }
        }