Codota Logo
Request$Builder.execute
Code IndexAdd Codota to your IDE (free)

How to use
execute
method
in
com.atlassian.httpclient.api.Request$Builder

Best Java code snippets using com.atlassian.httpclient.api.Request$Builder.execute (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: com.atlassian.plugins/atlassian-connect-core

    .fail(new FailFunction(url))
    .build();
return request.execute(METHOD_MAPPING.get(method)).transform(responseTransformation);
origin: com.atlassian.plugins/atlassian-connect-server-core

    .fail(new FailFunction(url))
    .build();
return request.execute(METHOD_MAPPING.get(method)).transform(responseTransformation);
origin: com.atlassian.plugins/atlassian-connect-server-core

private Response getSyncHandlerResponse(String addonKey, URI callbackUri, String jsonEventData, Optional<String> authHeader) throws LifecycleCallbackException {
  try {
    Request.Builder request = httpClient.newRequest(callbackUri);
    request.setAttribute("purpose", "web-hook-notification");
    request.setAttribute("pluginKey", addonKey);
    request.setContentType(MediaType.APPLICATION_JSON);
    request.setEntity(jsonEventData);
    if (authHeader.isPresent()) {
      request.setHeader(AUTHORIZATION_HEADER, authHeader.get());
    }
    request.setHeader(HttpHeaderNames.ATLASSIAN_CONNECT_VERSION, getConnectPluginVersion());
    return request.execute(Request.Method.POST).claim();
  } catch (Exception e) {
    log.error("Error contacting remote application at " + callbackUri + "  [" + e.getMessage() + "]", e);
    String message = "Error contacting remote application [" + e.getMessage() + "]";
    Throwable cause = e.getCause();
    if (cause instanceof UnknownHostException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.bad.domain", callbackUri.getHost());
    } else if (cause instanceof SocketTimeoutException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.timeout", removeQuery(callbackUri));
    } else if (cause instanceof SSLException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.ssl", removeQuery(callbackUri), cause.getMessage());
    }
    throw new LifecycleCallbackException(message, "connect.remote.upm.install.exception");
  }
}
origin: com.atlassian.plugins/atlassian-connect-core

  public Either<MarketplaceInstallationError, String> getDescriptorFromMarketplace(String addonKey) {
    try {
      Option<Addon> maybeAddon = MarketplaceClientFactory
          .createMarketplaceClient(URI.create(getMpacUrl()))
          .addons()
          .getByKey(addonKey, AddonQuery.builder().withVersion(true).hosting(Option.some(HostingType.CLOUD)).build());
      if (maybeAddon.isEmpty()) {
        return Either.left(MarketplaceInstallationError.NOT_FOUND);
      }
      Option<AddonVersion> maybeVersion = maybeAddon.get().getVersion();
      if (maybeVersion.isEmpty()) {
        return Either.left(MarketplaceInstallationError.NO_PUBLIC_VERSION_AVAILABLE);
      }
      URI descriptorUri = maybeVersion.get().getArtifactUri().get();
      Request.Builder request = httpClient.newRequest(descriptorUri);
      String json = request.execute(Request.Method.GET).claim().getEntity();

      return Either.right(json);
    } catch (Exception e) {
      log.error("Exception when retrieving add-on from Marketplace", e);
      return Either.left(MarketplaceInstallationError.COMMUNICATION_ERROR);
    }
  }
}
origin: com.atlassian.plugins/atlassian-connect-core

private Response getSyncHandlerResponse(String addonKey, URI callbackUri, String jsonEventData, Optional<String> authHeader) throws LifecycleCallbackException {
  try {
    Request.Builder request = httpClient.newRequest(callbackUri);
    request.setCacheDisabled();
    request.setAttribute("purpose", "web-hook-notification");
    request.setAttribute("pluginKey", addonKey);
    request.setContentType(MediaType.APPLICATION_JSON);
    request.setEntity(jsonEventData);
    if (authHeader.isPresent()) {
      request.setHeader(AUTHORIZATION_HEADER, authHeader.get());
    }
    request.setHeader(HttpHeaderNames.ATLASSIAN_CONNECT_VERSION, getConnectPluginVersion());
    return request.execute(Request.Method.POST).claim();
  } catch (Exception e) {
    log.error("Error contacting remote application at " + callbackUri + "  [" + e.getMessage() + "]", e);
    String message = "Error contacting remote application [" + e.getMessage() + "]";
    Throwable cause = e.getCause();
    if (cause instanceof UnknownHostException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.bad.domain", callbackUri.getHost());
    } else if (cause instanceof SocketTimeoutException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.timeout", removeQuery(callbackUri));
    } else if (cause instanceof SSLException) {
      throw new LifecycleCallbackBadResponseException(message, "connect.install.error.remote.host.ssl", removeQuery(callbackUri), cause.getMessage());
    }
    throw new LifecycleCallbackException(message, "connect.remote.upm.install.exception");
  }
}
origin: com.atlassian.webhooks/atlassian-webhooks-plugin

builder.execute(Request.Method.valueOf(request.getMethod().name()))
    .then(new Promise.TryConsumer<Response>() {
      @Override
com.atlassian.httpclient.apiRequest$Builderexecute

Javadoc

Executes this request through the HttpClient service using the given HTTP method.

Popular methods of Request$Builder

  • setContentType
  • get
    Executes this request through the HttpClient service as a GET operation. The request SHOULD NOT cont
  • setEntity
  • setEntityStream
  • setHeader
  • setAccept
    Sets the Accept header for the request.
  • setAttribute
    Sets an attribute on the request. Attributes are request metadata that are forwarded to the analytic
  • setAttributes
    Sets attributes on the request. Attributes are request metadata that are forwarded to the analytics
  • setHeaders
  • setUri
    Sets this request's URI. Must not be null by the time the request is executed.
  • delete
    Executes this request through the HttpClient service as a DELETE operation. The request SHOULD NOT c
  • post
    Executes this request through the HttpClient service as a POST operation. The request SHOULD contain
  • delete,
  • post,
  • put,
  • setCacheDisabled

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now