congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Request$Builder.setAttribute
Code IndexAdd Tabnine to your IDE (free)

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

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

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

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");
  }
}
com.atlassian.httpclient.apiRequest$BuildersetAttribute

Javadoc

Sets an attribute on the request. Attributes are request metadata that are forwarded to the analytics plugin when enabled.

Popular methods of Request$Builder

  • setContentType
  • execute
    Executes this request through the HttpClient service using the given HTTP method.
  • 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.
  • 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
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • getContentResolver (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now