Examples of asJSON()


Examples of org.apache.sling.discovery.impl.topology.announcement.Announcement.asJSON()

                    // looks like I dont have the receiving instance in my cluster view
                    // then I should also not propagate that announcement anywhere
                    return false;
                }
            });
            final String p = requestValidator.encodeMessage(topologyAnnouncement.asJSON());
           
            if (logger.isDebugEnabled()) {
                logger.debug("ping: topologyAnnouncement json is: " + p);
            }
            requestValidator.trustMessage(method, p);
View Full Code Here

Examples of org.apache.sling.discovery.impl.topology.announcement.Announcement.asJSON()

                replyAnnouncement.setBackoffInterval(backoffInterval);
                if (logger.isDebugEnabled()) {
                    logger.debug("doPost: backoffInterval for client set to "+replyAnnouncement.getBackoffInterval());
                }
            }
            final String p = requestValidator.encodeMessage(replyAnnouncement.asJSON());
            requestValidator.trustMessage(response, request, p);
            // gzip the response if the client accepts this
            final String acceptEncodingHeader = request.getHeader("Accept-Encoding");
            if (acceptEncodingHeader!=null && acceptEncodingHeader.contains("gzip")) {
                // tell the client that the content is gzipped:
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

  protected JsonNode signedOauthGet(final String url,
      final OAuthCalculator calculator) {
    final F.Promise<WSResponse> promise = WS.url(url).sign(calculator).get();
    final WSResponse response = promise.get(getTimeout());
    return response.asJson();
  }

  protected OAuthCalculator getOAuthCalculator(final OAuth1AuthInfo info) {
    final RequestToken token = new RequestToken(info.getAccessToken(),
        info.getAccessTokenSecret());
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

        .url(url)
        .setQueryParameter(OAuth2AuthProvider.Constants.ACCESS_TOKEN,
            info.getAccessToken()).get()
        .get(getTimeout());

    final JsonNode result = r.asJson();
    if (result.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AuthException(result.get(
          OAuth2AuthProvider.Constants.ERROR).asText());
    } else {
      Logger.debug(result.toString());
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

            info.getAccessToken())
        .setQueryParameter("v", VERSION)
        .get()
        .get(getTimeout());

    final JsonNode result = r.asJson();
    if (r.getStatus() >= 400) {
      throw new AuthException(result.get("meta").get("errorDetail").asText());
    } else {
      Logger.debug(result.toString());
      return new FoursquareAuthUser(result.get("response").get("user"), info, state);
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

        .url(url)
        .setQueryParameter(OAuth2AuthProvider.Constants.ACCESS_TOKEN,
            info.getAccessToken()).get()
        .get(getTimeout());

    final JsonNode result = r.asJson();
    if (result.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AuthException(result.get(
          OAuth2AuthProvider.Constants.ERROR).asText());
    } else {
      Logger.debug(result.toString());
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

    final WSResponse r = WS.url(url)
        .setQueryParameter(UIDS_REQUEST_KEY, info.getUserId())
        .setQueryParameter(FIELDS_REQUEST_KEY, fields).get()
        .get(getTimeout());

    final JsonNode result = r.asJson();

    if (result.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AuthException(result.get(
          OAuth2AuthProvider.Constants.ERROR).asText());
    } else {
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

                .url(url)
                .setQueryParameter(Constants.ACCESS_TOKEN,
                        info.getAccessToken()).get()
                .get(getTimeout());

        final JsonNode result = r.asJson();
        if (result.get(Constants.ERROR) != null) {
            throw new AuthException(result.get(
                    Constants.ERROR).asText());
        } else {
            return new GithubAuthUser(result, info, state);
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

        .setQueryParameter(OAuth2AuthProvider.Constants.ACCESS_TOKEN,
            info.getAccessToken())
        .setQueryParameter(FIELDS, fields)
        .get().get(getTimeout());

    final JsonNode result = r.asJson();
    if (result.get(OAuth2AuthProvider.Constants.ERROR) != null) {
      throw new AuthException(result.get(ERROR).get(MESSAGE).asText());
    } else {
      Logger.debug(result.toString());
      return new FacebookAuthUser(result, info, state);
View Full Code Here

Examples of play.libs.ws.WSResponse.asJson()

                .setQueryParameter(TOKEN,
                        info.getAccessToken())
                .get()
                .get(getTimeout());

        final JsonNode result = r.asJson();
        if (r.getStatus() >= 400) {
            throw new AuthException(result.get("meta").get("errorDetail").asText());
        } else {
            Logger.debug(result.toString());
            return new EventBriteAuthUser(result, info, state);
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.