Package org.vertx.java.core.json

Examples of org.vertx.java.core.json.JsonObject.encode()


        }

        String filename = jsonObject.getString("filename");
        String contentType = jsonObject.getString("contentType");
        JsonObject metadata = jsonObject.getObject("metadata");
        String metadataStr = metadata == null ? null : metadata.encode();
        // TODO Store metadata as a map?

        BoundStatement query = insertFile.bind(id, length, chunkSize, uploadDate, filename, contentType, metadataStr);

        executeQuery(query, message, new FutureCallback<ResultSet>() {
View Full Code Here


        // id is optional
        String id = body.getString(CONST_ID);

        client.prepareIndex(index, type, id)
                .setSource(source.encode())
                .execute(new ActionListener<IndexResponse>() {
                    @Override
                    public void onResponse(IndexResponse indexResponse) {
                        JsonObject reply = new JsonObject()
                                .putString(CONST_INDEX, indexResponse.getIndex())
View Full Code Here

        }

        // Set the query
        JsonObject query = body.getObject("query");
        if (query != null) {
            builder.setQuery(query.encode());
        }

        // Set the filter
        JsonObject filter = body.getObject("filter");
        if (filter != null) {
View Full Code Here

        }

        // Set the filter
        JsonObject filter = body.getObject("filter");
        if (filter != null) {
            builder.setPostFilter(filter.encode());
        }

        // Set facets
        JsonObject facets = body.getObject("facets");
        if (facets != null) {
View Full Code Here

        }

        // Set facets
        JsonObject facets = body.getObject("facets");
        if (facets != null) {
            builder.setFacets(facets.encode().getBytes(CHARSET_UTF8));
        }

        // Set search type
        String searchType = body.getString("search_type");
        if (searchType != null) {
View Full Code Here

        // id is optional
        String id = body.getString(CONST_ID);

        client.prepareIndex(index, type, id)
                .setSource(source.encode())
                .execute(new ActionListener<IndexResponse>() {
                    @Override
                    public void onResponse(IndexResponse indexResponse) {
                        JsonObject reply = new JsonObject()
                                .putString(CONST_INDEX, indexResponse.getIndex())
View Full Code Here

        }

        // Set the query
        JsonObject query = body.getObject("query");
        if (query != null) {
            builder.setQuery(query.encode());
        }

        // Set the filter
        JsonObject filter = body.getObject("filter");
        if (filter != null) {
View Full Code Here

        }

        // Set the filter
        JsonObject filter = body.getObject("filter");
        if (filter != null) {
            builder.setPostFilter(filter.encode());
        }

        // Set facets
        JsonObject facets = body.getObject("facets");
        if (facets != null) {
View Full Code Here

        }

        // Set facets
        JsonObject facets = body.getObject("facets");
        if (facets != null) {
            builder.setFacets(facets.encode().getBytes(CHARSET_UTF8));
        }

        // Set search type
        String searchType = body.getString("search_type");
        if (searchType != null) {
View Full Code Here

                          .end();
                      return;
                    }
                    JsonObject body = ar.result().body();
                    req.response().headers().set("Content-Type", "application/json");
                    req.response().end(body.encode());
                  }
                });
          }
        });
      }
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.