本文整理匯總了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();
}