Class RestExecutor

java.lang.Object
com.atlassian.crowd.integration.rest.service.RestExecutor
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
BasicAuthRestExecutor, OAuth2RestExecutor

public abstract class RestExecutor extends Object implements Closeable
This class provides primitive building blocks for using a REST API.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RestExecutor(String baseUrl, org.apache.http.HttpHost httpHost, AuthStrategy authStrategy, org.apache.http.impl.client.CloseableHttpClient client)
     
    RestExecutor(String baseUrl, org.apache.http.HttpHost httpHost, org.apache.http.client.CredentialsProvider credsProvider, org.apache.http.impl.client.CloseableHttpClient client)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected static String
    Returns the "root" WebResource.
    protected static org.apache.http.HttpHost
    createHttpHost(ClientProperties clientProperties)
     
    protected final com.atlassian.crowd.integration.rest.service.RestExecutor.MethodExecutor
    createMethodExecutor(org.apache.http.client.methods.HttpUriRequest request)
     
    protected com.atlassian.crowd.integration.rest.service.RestExecutor.MethodExecutor
    createMethodExecutor(org.apache.http.client.methods.HttpUriRequest request, Set<Integer> statusCodesWithoutErrorEntity)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RestExecutor

      public RestExecutor(String baseUrl, org.apache.http.HttpHost httpHost, org.apache.http.client.CredentialsProvider credsProvider, org.apache.http.impl.client.CloseableHttpClient client)
    • RestExecutor

      public RestExecutor(String baseUrl, org.apache.http.HttpHost httpHost, AuthStrategy authStrategy, org.apache.http.impl.client.CloseableHttpClient client)
  • Method Details

    • createHttpHost

      protected static org.apache.http.HttpHost createHttpHost(ClientProperties clientProperties)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • createBaseUrl

      protected static String createBaseUrl(String url)
      Returns the "root" WebResource. This is the resource that's at the / of the crowd-rest-plugin plugin namespace.
      Parameters:
      url - URL to derive the base URL from
      Returns:
      base URL
    • createMethodExecutor

      protected com.atlassian.crowd.integration.rest.service.RestExecutor.MethodExecutor createMethodExecutor(org.apache.http.client.methods.HttpUriRequest request, Set<Integer> statusCodesWithoutErrorEntity)
    • createMethodExecutor

      protected final com.atlassian.crowd.integration.rest.service.RestExecutor.MethodExecutor createMethodExecutor(org.apache.http.client.methods.HttpUriRequest request)