本文整理汇总了Java中io.vertx.core.json.JsonObject.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java JsonObject.getBoolean方法的具体用法?Java JsonObject.getBoolean怎么用?Java JsonObject.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.vertx.core.json.JsonObject
的用法示例。
在下文中一共展示了JsonObject.getBoolean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: step2ResultHandshake
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private void step2ResultHandshake(final HttpResponse<Buffer> postReturn) {
// Don't proceed in a shutdown scenario
if (this.shuttingDown || this.shutdownCompleted) {
this.shutdownCompleted = true;
return;
}
// Handle cookies
this.captureCookies(postReturn.cookies());
// Handle the body
final JsonObject handshakeResult = postReturn.bodyAsJsonArray().getJsonObject(0);
// Check if it worked
if (handshakeResult.getBoolean("successful", false)) {
final String clientIdCandidate = handshakeResult.getString("clientId");
if (clientIdCandidate == null) {
this.logger.error("Handshake didn't provide clientId");
} else {
this.clientId = clientIdCandidate;
this.step3ActionAdvice(handshakeResult);
}
} else {
this.logger.error("Handshake was unsuccessful");
}
}
示例2: step3ResultAdvice
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private void step3ResultAdvice(final HttpResponse<Buffer> postReturn) {
if (this.shuttingDown || this.shutdownCompleted) {
this.shutdownCompleted = true;
return;
}
// Handle cookies
this.captureCookies(postReturn.cookies());
// Handle body
final JsonObject advice = postReturn.bodyAsJsonArray().getJsonObject(0);
if (advice.getBoolean("successful", false)) {
// TODO Extract the advice, especially timeout
this.step4ActionSubscribe();
} else {
this.logger.error("Advice negotiation failed (Step 3)");
}
}
示例3: configure
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
public SockJSHandler configure(VertxContext vertxContext, ServerConfiguration<JsonObject, JsonObject[]> config) {
JsonObject sockJsConfig=config.getJsonObject(CONFIG_KEY, makeDefaultConfig());
BridgeOptions bridgeOptions = configureBridgeOptions(sockJsConfig);
SockJSHandler sockJSHandler = configureSockJsHandler(vertxContext, bridgeOptions, sockJsConfig);
boolean CSRFProteceted=sockJsConfig.getBoolean(CSRF_PROTECTED, false);
if(CSRFProteceted) {
if(config.getString(CSRF_SECRET, EMPTY_CSRF_SECRET).isEmpty() || config.getString(CSRF_SECRET,
EMPTY_CSRF_SECRET).length()<12)
throw new CsrfProtectionEnabledBuInvalidSecretProvided();
vertxContext.router().route().path(VertxBusContext.DEFAULT_EVENTBUS_PATH).handler(CookieHandler.create());
vertxContext.router().route().path(VertxBusContext.DEFAULT_EVENTBUS_PATH).handler(
CSRFHandler.create(config.getString(CSRF_SECRET, EMPTY_CSRF_SECRET)));
}
return sockJSHandler;
}
示例4: retrieve
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
protected OAuth2Auth retrieve() {
JsonObject authConfig = record().getMetadata().copy().mergeIn(record().getLocation());
if (config != null) {
authConfig.mergeIn(config);
}
OAuth2FlowType flow = OAuth2FlowType.valueOf(authConfig.getString("flow.type", "AUTH_CODE").toUpperCase());
if (authConfig.getBoolean("type.keycloak")) {
return OAuth2Auth.createKeycloak(vertx, flow, authConfig);
} else {
return OAuth2Auth.create(vertx, flow, new OAuth2ClientOptions(authConfig));
}
}
示例5: subscriptionResult
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private void subscriptionResult(final AsyncResult<HttpResponse<JsonArray>> ar) {
if (ar.succeeded()) {
// Process the result
this.captureCookies(ar.result().cookies());
final JsonArray receivedData = ar.result().body();
final JsonObject status = receivedData.getJsonObject(receivedData.size() - 1);
if (status.getBoolean("successful", false)) {
// If the array has only one member we didn't get new data
if (receivedData.size() > 1) {
this.processReceivedData(receivedData);
}
// Do it again eventually
if (!this.shuttingDown && !this.shutdownCompleted) {
this.subscriptionFetch();
} else {
this.shutdownCompleted = true;
}
} else {
// We won't continue
this.logger.fatal(status.encodePrettily());
this.shutdownCompleted = true;
}
} else {
// Preliminary stopping here
// needs to be handled
this.logger.fatal(ar.cause());
this.shutdownCompleted = true;
}
}
示例6: EventBusSink
import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public EventBusSink(Vertx vertx, JsonObject json) {
name = json.getString("name");
address = json.getString("address", name);
if (address == null) {
throw new IllegalArgumentException("The name or the address must be set");
}
publish = json.getBoolean("publish", true);
eventBus = vertx.eventBus();
}