Package org.vertx.java.core.json

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


                }

                final JsonObject json = new JsonObject(writer.toString());
                final String fragment = uri.getFragment();
                if (fragment != null) {
                    if (json.containsField(fragment)) {
                        return json.getObject(fragment);
                    } else {
                        throw new RuntimeException("Fragment #" + fragment + " not found!");
                    }
                }
View Full Code Here


                }

                final JsonObject json = new JsonObject(writer.toString());
                final String fragment = uri.getFragment();
                if (fragment != null) {
                    if (json.containsField(fragment)) {
                        return json.getObject(fragment);
                    } else {
                        throw new RuntimeException("Fragment #" + fragment + " not found!");
                    }
                }
View Full Code Here

                }

                final JsonObject json = new JsonObject(writer.toString());
                final String fragment = uri.getFragment();
                if (fragment != null) {
                    if (json.containsField(fragment)) {
                        return json.getObject(fragment);
                    } else {
                        throw new RuntimeException("Fragment #" + fragment + " not found!");
                    }
                }
View Full Code Here

        try {
            final JsonObject jwtToken = jwt.decode(token);

            final long now = System.currentTimeMillis();

            if (jwtToken.containsField("iat")) {
                Long iat = jwtToken.getLong("iat");
                // issue at must be in the past
                if (iat >= now) {
                    next.handle(new YokeException(401, "Invalid Token!"));
                    return;
View Full Code Here

                    next.handle(new YokeException(401, "Invalid Token!"));
                    return;
                }
            }

            if (jwtToken.containsField("nbf")) {
                Long nbf = jwtToken.getLong("nbf");
                // not before must be after now
                if (nbf >= now) {
                    next.handle(new YokeException(401, "Invalid Token!"));
                    return;
View Full Code Here

                    next.handle(new YokeException(401, "Invalid Token!"));
                    return;
                }
            }

            if (jwtToken.containsField("exp")) {
                Long exp = jwtToken.getLong("exp");
                // expires must be after now
                if (now > exp) {
                    next.handle(new YokeException(401, "Invalid Token!"));
                    return;
View Full Code Here

          message.fail(-1, "id must be specified");
          return;
        }
        Set<String> sessions = vertx.sharedData()
            .getSet(BridgeHook.getSessionsKey(address + "/" + id + Topic.WATCH));
        if (body.containsField(WebSocketBus.SESSION)) {
          sessions.add(body.getString(WebSocketBus.SESSION));
        }
        JsonArray collaborators = new JsonArray();
        for (String sessionId : sessions) {
          collaborators.addObject(getCollaborator(sessionId));
View Full Code Here

            httpServer.requestHandler(new Handler<HttpServerRequest>() {
                public void handle(final HttpServerRequest req) {
                    app.call(req);
                }
            });
            if (config.containsField("event_bus")) {
                JsonArray allowAll = new JsonArray();
                allowAll.add(new JsonObject());
                JsonObject ebconf = new JsonObject();
                ebconf.putString("prefix", config.getString("event_bus"));
                vertx.createSockJSServer(httpServer).bridge(ebconf, allowAll, allowAll);
View Full Code Here

                httpServer.requestHandler(new Handler<HttpServerRequest>() {
                    public void handle(final HttpServerRequest req) {
                        app.call(req);
                    }
                });
                if (config.containsField("event_bus")) {
                    JsonArray allowAll = new JsonArray();
                    allowAll.add(new JsonObject());

                    JsonArray incomingAllowed;
                    JsonArray outgoingAllowed;
View Full Code Here

                    allowAll.add(new JsonObject());

                    JsonArray incomingAllowed;
                    JsonArray outgoingAllowed;

                    if (config.containsField("event_bus_security")) {
                        JsonObject securitySettings = config.getObject("event_bus_security");
                        incomingAllowed = securitySettings.getArray("incoming", allowAll);
                        outgoingAllowed = securitySettings.getArray("outgoing", allowAll);
                    } else {
                        incomingAllowed = allowAll;
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.