/*
(non-Javadoc)

@see
mtas.solr.handler.component.util.MtasSolrComponent#modifyRequest(org.apache
.solr.handler.component.ResponseBuilder,
org.apache.solr.handler.component.SearchComponent,
org.apache.solr.handler.component.ShardRequest)
352083
public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)) {
      if (sreq.params.getBool(PARAM_MTAS_PREFIX, false)
          && (sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
        // do nothing
      } else {
        // remove prefix for other requests
        Set<String> keys = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_PREFIX);
        sreq.params.remove(PARAM_MTAS_PREFIX);
        for (String key : keys) {
          sreq.params.remove(
              PARAM_MTAS_PREFIX + "." + key + "." + NAME_MTAS_PREFIX_FIELD);
          sreq.params.remove(
              PARAM_MTAS_PREFIX + "." + key + "." + NAME_MTAS_PREFIX_KEY);
        }
      }
    }
  }
1213450
@Override
	public void handleRequest(final Request request) {
		if (!isDisabled()) {
			final SelectToggleModel model = getComponentModel();
			String requestParam = request.getParameter(getId());

			final State newValue;
			if ("all".equals(requestParam)) {
				newValue = State.ALL;
			} else if ("none".equals(requestParam)) {
				newValue = State.NONE;
			} else if ("some".equals(requestParam)) {
				newValue = State.SOME;
			} else {
				newValue = model.state;
			}

			if (!newValue.equals(model.state)) {
				setState(newValue);
			}
			if (!model.clientSide && model.target != null && !State.SOME.equals(newValue)) {
				// We need to change the selections *after* all components
				// Have updated themselves from the request, as they may change
				// their values when their handleRequest methods are called.
				invokeLater(new Runnable() {
					@Override
					public void run() {
						setSelections(model.target, State.ALL.equals(newValue));
					}
				});
			}
		}
	}
219753
private void addQueryParams(final Request request) {
        if (to != null) {
            request.addQueryParam("To", to.toString());
        }

        if (from != null) {
            request.addQueryParam("From", from.toString());
        }

        if (absoluteDateSent != null) {
            request.addQueryParam("DateSent", absoluteDateSent.toString(Request.QUERY_STRING_DATE_TIME_FORMAT));
        } else if (rangeDateSent != null) {
            request.addQueryDateTimeRange("DateSent", rangeDateSent);
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
131626
@Override
  protected TermsByQueryShardResponse shardOperation(TermsByQueryShardRequest shardRequest) throws ElasticsearchException {
    IndexService indexService = indicesService.indexServiceSafe(shardRequest.shardId().getIndex());
    IndexShard indexShard = indexService.shardSafe(shardRequest.shardId().id());
    TermsByQueryRequest request = shardRequest.request();
    OrderByShardOperation orderByOperation = OrderByShardOperation.get(request.getOrderBy(), request.maxTermsPerShard());

    SearchShardTarget shardTarget = new SearchShardTarget(clusterService.localNode().id(),
                                                          shardRequest.shardId().getIndex(),
                                                          shardRequest.shardId().id());

    ShardSearchRequest shardSearchRequest = new ShardSearchLocalRequest(request.types(), request.nowInMillis(),
                                                                        shardRequest.filteringAliases());

    SearchContext context = new DefaultSearchContext(0, shardSearchRequest, shardTarget,
      indexShard.acquireSearcher("termsByQuery"), indexService, indexShard, scriptService,
      pageCacheRecycler, bigArrays, threadPool.estimatedTimeInMillisCounter(), parseFieldMatcher,
      SearchService.NO_TIMEOUT);
    SearchContext.setCurrent(context);

    try {
      MappedFieldType fieldType = context.smartNameFieldType(request.field());
      if (fieldType == null) {
        throw new SearchContextException(context, "[termsByQuery] field '" + request.field() +
                "' not found for types " + Arrays.toString(request.types()));
      }

      IndexFieldData indexFieldData = context.fieldData().getForField(fieldType);

      BytesReference querySource = request.querySource();
      if (querySource != null && querySource.length() > 0) {
        XContentParser queryParser = null;
        try {
          queryParser = XContentFactory.xContent(querySource).createParser(querySource);
          QueryParseContext.setTypes(request.types());
          ParsedQuery parsedQuery = orderByOperation.getParsedQuery(queryParser, indexService);
          if (parsedQuery != null) {
            context.parsedQuery(parsedQuery);
          }
        }
        finally {
          QueryParseContext.removeTypes();
          if (queryParser != null) {
            queryParser.close();
          }
        }
      }

      context.preProcess();

      // execute the search only gathering the hit count and bitset for each segment
      logger.debug("{}: Executes search for collecting terms {}", Thread.currentThread().getName(),
        shardRequest.shardId());

      TermsCollector termsCollector = this.getTermsCollector(request.termsEncoding(), indexFieldData, context);
      if (request.expectedTerms() != null) termsCollector.setExpectedTerms(request.expectedTerms());
      if (request.maxTermsPerShard() != null) termsCollector.setMaxTerms(request.maxTermsPerShard());
      HitStream hitStream = orderByOperation.getHitStream(context);
      TermsSet terms = termsCollector.collect(hitStream);

      logger.debug("{}: Returns terms response with {} terms for shard {}", Thread.currentThread().getName(),
        terms.size(), shardRequest.shardId());

      return new TermsByQueryShardResponse(shardRequest.shardId(), terms);
    }
    catch (Throwable e) {
      logger.error("[termsByQuery] Error executing shard operation", e);
      throw new QueryPhaseExecutionException(context, "[termsByQuery] Failed to execute query", e);
    }
    finally {
      // this will also release the index searcher
      context.close();
      SearchContext.removeCurrent();
    }
  }
1012146
public void modifySubnetAttributes(ModifySubnetAttributesRequest modifySubnetAttributesRequest) {
        checkNotNull(modifySubnetAttributesRequest, "request should not be null.");
        checkStringNotEmpty(modifySubnetAttributesRequest.getSubnetId(), "request subnetId should not be empty.");
        checkStringNotEmpty(modifySubnetAttributesRequest.getName(), "request name should not be empty.");
        if (Strings.isNullOrEmpty(modifySubnetAttributesRequest.getClientToken())) {
            modifySubnetAttributesRequest.setClientToken(this.generateClientToken());
        }
        InternalRequest internalRequest = this.createRequest(
                modifySubnetAttributesRequest, HttpMethodName.PUT,
                SUBNET_PREFIX, modifySubnetAttributesRequest.getSubnetId());
        fillPayload(internalRequest, modifySubnetAttributesRequest);
        internalRequest.addParameter(NetworkAction.modifyAttribute.name(), null);
        internalRequest.addParameter("clientToken", modifySubnetAttributesRequest.getClientToken());
        this.invokeHttpClient(internalRequest, AbstractBceResponse.class);
    }
976321
public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)) {
      if (sreq.params.getBool(PARAM_MTAS_TERMVECTOR, false)) {
        // compute keys
        Set<String> keys = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR);
        if ((sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
          for (String key : keys) {
            String oldNumber = sreq.params.get(PARAM_MTAS_TERMVECTOR + "." + key
                + "." + NAME_MTAS_TERMVECTOR_NUMBER);
            int number;
            if (oldNumber != null) {
              int oldNumberValue = Integer.parseInt(oldNumber);
              number = (oldNumberValue >= 0)
                  ? oldNumberValue * SHARD_NUMBER_MULTIPLIER : oldNumberValue;
            } else {
              number = DEFAULT_NUMBER * SHARD_NUMBER_MULTIPLIER;
            }
            sreq.params.add(
                PARAM_MTAS_TERMVECTOR + "." + key + "."
                    + NAME_MTAS_TERMVECTOR_NUMBER_SHARDS,
                String.valueOf(number));
          }
        } else {
          sreq.params.remove(PARAM_MTAS_TERMVECTOR);
          for (String key : keys) {
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_FIELD);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_KEY);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_PREFIX);
            Set<String> distanceKeys = MtasSolrResultUtil
                .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                    + "." + key + "." + NAME_MTAS_TERMVECTOR_DISTANCE);
            for (String distanceKey : distanceKeys) {
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_KEY);
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_TYPE);
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_BASE);
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey + "."
                  + NAME_MTAS_TERMVECTOR_DISTANCE_MAXIMUM);
              Set<String> distanceParameters = MtasSolrResultUtil
                  .getIdsFromParameters(rb.req.getParams(),
                      PARAM_MTAS_TERMVECTOR + "." + key + "."
                          + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey
                          + "." + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER);
              for (String distanceParameter : distanceParameters) {
                sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceKey + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER + "."
                    + distanceParameter);
              }
            }
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_REGEXP);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_FULL);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_SORT_TYPE);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_SORT_DIRECTION);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_NUMBER);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_NUMBER_SHARDS);
            Set<String> functionKeys = MtasSolrResultUtil
                .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                    + "." + key + "." + NAME_MTAS_TERMVECTOR_FUNCTION);
            for (String functionKey : functionKeys) {
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionKey + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION_EXPRESSION);
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionKey + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION_KEY);
              sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionKey + "."
                  + NAME_MTAS_TERMVECTOR_FUNCTION_TYPE);
            }
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_BOUNDARY);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_LIST);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_LIST_REGEXP);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_IGNORE_REGEXP);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_IGNORE_LIST);
            sreq.params.remove(PARAM_MTAS_TERMVECTOR + "." + key + "."
                + NAME_MTAS_TERMVECTOR_IGNORE_REGEXP);
          }
        }
      }
    }
  }
1019454
private void addQueryParams(final Request request) {
        if (status != null) {
            request.addQueryParam("Status", status);
        }

        if (iccid != null) {
            request.addQueryParam("Iccid", iccid);
        }

        if (ratePlan != null) {
            request.addQueryParam("RatePlan", ratePlan);
        }

        if (eId != null) {
            request.addQueryParam("EId", eId);
        }

        if (simRegistrationCode != null) {
            request.addQueryParam("SimRegistrationCode", simRegistrationCode);
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
749283
public void modifyingRequest( final String requestId ) {
        if ( _log.isDebugEnabled() ) {
            _log.debug( "Registering modifying request: " + requestId );
        }
        incrementOrPut( _blacklist, requestId );
        _readOnlyRequests.remove( requestId );
    }
316370
@Override
    public void addCacheItem(String request, ResponseCtx response) {
        String hash = null;

        try {
            hash = makeHash(request);

            // thread-safety on cache operations
            synchronized (requestCache) {

                // if we have a maxxed cache, remove least used item
                if (requestCache.size() >= CACHE_SIZE) {
                    String key = requestCacheUsageTracker.remove(0);
                    requestCache.remove(key);
                    if (logger.isDebugEnabled()) {
                        logger.debug("Purging cache element");
                    }
                }

                requestCache.put(hash, response);
                requestCacheUsageTracker.add(hash);
                requestCacheTimeTracker.put(hash, new Long(System
                                                           .currentTimeMillis()));
            }

            if (logger.isDebugEnabled()) {
                logger.debug("Adding Cache Item (" + requestCache.size() + "/"
                             + requestCacheUsageTracker.size() + "/"
                             + requestCacheTimeTracker.size() + "): " + hash);
            }
        } catch (Exception e) {
            logger.warn("Error adding cache item: " + e.getMessage(), e);
        }
    }
131856
@Override
  public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    sreq.params.remove(PARAM_MTAS_STATUS + "." + NAME_MTAS_STATUS_KEY);
  }
568942
@Override
    public Request<ModifySubnetAttributeRequest> getDryRunRequest() {
        Request<ModifySubnetAttributeRequest> request = new ModifySubnetAttributeRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
454503
private UpdateRequest buildUpdateModificationRequest(final IRI identifier, final Literal time) {
        final UpdateRequest req = new UpdateRequest();
        final Var modified = Var.alloc(MODIFIED);
        final UpdateDeleteInsert modify = new UpdateDeleteInsert();
        modify.setWithIRI(rdf.asJenaNode(PreferServerManaged));
        modify.getDeleteAcc().addTriple(triple(rdf.asJenaNode(identifier), rdf.asJenaNode(DC.modified), modified));
        modify.getInsertAcc().addTriple(triple(rdf.asJenaNode(identifier), rdf.asJenaNode(DC.modified),
                    rdf.asJenaNode(time)));
        final ElementGroup eg = new ElementGroup();
        final ElementPathBlock epb = new ElementPathBlock();
        epb.addTriple(triple(rdf.asJenaNode(identifier), rdf.asJenaNode(DC.modified), modified));
        eg.addElement(epb);
        modify.setElement(eg);
        req.add(modify);
        return req;
    }
835147
private void addQueryParams(final Request request) {
        if (dateCreatedAfter != null) {
            request.addQueryParam("DateCreatedAfter", dateCreatedAfter.toString());
        }

        if (dateCreatedBefore != null) {
            request.addQueryParam("DateCreatedBefore", dateCreatedBefore.toString());
        }

        if (track != null) {
            request.addQueryParam("Track", track.toString());
        }

        if (publisher != null) {
            request.addQueryParam("Publisher", publisher.toString());
        }

        if (kind != null) {
            request.addQueryParam("Kind", kind.toString());
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
192541
void setRequest(HttpUriRequest request) {
    requestLock.lock();
    try {
      if (this.request != null) {
        throw new SparqlException("Command is already executing a request.");
      }
      this.request = request;
    } finally {
      requestLock.unlock();
    }
  }
1104141
@Override
	public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
		sec.getUserProperties().put(Constants.HANDSHAKEREQUEST, request);
		super.modifyHandshake(sec, request, response);
	}
556687
public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)
        && sreq.params.getBool(PARAM_MTAS_GROUP, false)) {
      if ((sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
        // do nothing
        // Set<String> keys = MtasSolrResultUtil
        // .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_GROUP);
        // for (String key : keys) {
        // sreq.params.remove(
        // PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_NUMBER);
        // sreq.params.remove(
        // PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_START);
        // }
      } else {
        // remove prefix for other requests
        Set<String> keys = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_GROUP);
        sreq.params.remove(PARAM_MTAS_GROUP);
        Set<String> subKeys;
        for (String key : keys) {
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_FIELD);
          sreq.params
              .remove(PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_KEY);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_NUMBER);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_START);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_QUERY_TYPE);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_QUERY_VALUE);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_PREFIX);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_IGNORE);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_MAXIMUM_IGNORE_LENGTH);
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_LEFT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_RIGHT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
        }
      }
    }
  }
1231609
public synchronized void setRequest(HttpServletRequest request) {

        if (perThreadRequest == null) {
            perThreadRequest = new ThreadLocal<HttpServletRequest>();
        }
        perThreadRequest.set(request);
    }