當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonObject.getBoolean方法代碼示例

本文整理匯總了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");
    }
}
 
開發者ID:Stwissel,項目名稱:vertx-sfdc-platformevents,代碼行數:26,代碼來源:CometD.java

示例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)");
    }
}
 
開發者ID:Stwissel,項目名稱:vertx-sfdc-platformevents,代碼行數:18,代碼來源:CometD.java

示例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;
}
 
開發者ID:GwtDomino,項目名稱:domino-event-bus,代碼行數:20,代碼來源:VertxConfigSockJsConfigurator.java

示例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));
    }
}
 
開發者ID:pflima92,項目名稱:jspare-vertx-ms-blueprint,代碼行數:17,代碼來源:OAuth2ServiceImpl.java

示例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;
    }
}
 
開發者ID:Stwissel,項目名稱:vertx-sfdc-platformevents,代碼行數:31,代碼來源:CometD.java

示例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();
}
 
開發者ID:cescoffier,項目名稱:fluid,代碼行數:13,代碼來源:EventBusSink.java


注:本文中的io.vertx.core.json.JsonObject.getBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。