Examples of QueryStringDecoder


Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

    req.bodyHandler(new Handler<Buffer>() {
        @Override
      public void handle(Buffer buff) {
        String contentType = req.headers().get("Content-Type");
        if ("application/x-www-form-urlencoded".equals(contentType)) {
          QueryStringDecoder qsd = new QueryStringDecoder(buff.toString(), false);
          Map<String, List<String>> params = qsd.getParameters();

          List<String> loginSessionIdList = params.get(JsonFieldConstants.SESSION_USER_ID);
          List<String> usernameList = params.get(JsonFieldConstants.SESSION_USERNAME);
          if (loginSessionIdList == null || loginSessionIdList.size() == 0 ||
              usernameList == null || usernameList.size() == 0) {
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

  @GET
  @Path("data/explore/tables")
  public void getTables(HttpRequest request, HttpResponder responder) {
    LOG.trace("Received get tables for current user");
    Map<String, List<String>> queryParams = new QueryStringDecoder(request.getUri()).getParameters();
    List<String> databaseNames = queryParams.get("db");
    try {
      responder.sendJson(HttpResponseStatus.OK, exploreService.getTables(
        (databaseNames != null && !databaseNames.isEmpty()) ? databaseNames.get(0) : null));
    } catch (ExploreException e) {
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

  @GET
  @Path("/data/explore/queries")
  public void getQueryLiveHandles(HttpRequest request, HttpResponder responder) {
    try {
      Map<String, List<String>> args = new QueryStringDecoder(request.getUri()).getParameters();

      int limit = args.containsKey("limit") ? Integer.parseInt(args.get("limit").get(0)) : 50;
      long offset = args.containsKey("offset") ? Long.parseLong(args.get("offset").get(0)) : Long.MAX_VALUE;
      String cursor = args.containsKey("cursor") ? args.get("cursor").get(0).toLowerCase() : "next";
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

      if (request.getMethod() != GET) {
          sendError(ctx, METHOD_NOT_ALLOWED);
          return;
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

      if (request.getMethod() != GET) {
          sendError(ctx, METHOD_NOT_ALLOWED);
          return;
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder

    if (this.request != null) {
      // extract any encoded session in url
      this.parseEncodedSessionId();
      // http get
      this.parameters = new HashMap<String, List<String>>();
      QueryStringDecoder qsd = new QueryStringDecoder(this.getURL());
      Map<String, List<String>> qsdParameters = qsd.getParameters();
      if (qsdParameters != null) {
        this.parameters.putAll(qsdParameters);
      }
      // http post
      ChannelBuffer content = request.getContent();
      if (content.readable()) {
        String charsetName = Constants.SC_CHARACTER_SET;
        if (request.containsHeader(HttpHeaders.Names.ACCEPT_CHARSET)) {
          String contentType = request.getHeader(HttpHeaders.Names.ACCEPT_CHARSET);
          charsetName = contentType.indexOf("charset=") > -1 ? contentType.substring(contentType.indexOf("charset=") + 8)
              : charsetName;
        }
        Charset charset = null;
        try {
          charset = Charset.forName(charsetName);
        } catch (Exception e) {
          charset = Charset.forName(Constants.SC_CHARACTER_SET);
          LOGGER.error("invalid charset name = " + charsetName, e);
        }
        String param = content.toString(charset);
        QueryStringDecoder queryStringDecoder = new QueryStringDecoder("/?" + param);
        Map<String, List<String>> postParams = queryStringDecoder.getParameters();
        this.parameters.putAll(postParams);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.