Class RestHttpGemfireAdminTemplate

All Implemented Interfaces:
GemfireAdminOperations

public class RestHttpGemfireAdminTemplate extends FunctionGemfireAdminTemplate
RestHttpGemfireAdminTemplate is class implementing the GemfireAdminOperations interface, extending the FunctionGemfireAdminTemplate to support administrative (management) operations on a Pivotal GemFire or Apache Geode cluster using the Management REST API interface over HTTP. The fallback is using Function execution if the a particular administrative (management) operation is not supported or has not been implemented against the Management REST API interface over HTTP.
Since:
2.0.0
See Also:
  • Field Details

  • Constructor Details

    • RestHttpGemfireAdminTemplate

      public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache)
      Constructs a new instance of RestHttpGemfireAdminTemplate initialized with the given ClientCache and configured with the default HTTP schema, host and port when accessing the Apache Geode or Pivotal GemFire Management REST API interface.
      Parameters:
      clientCache - reference to the ClientCache.
      Throws:
      IllegalArgumentException - if ClientCache is null.
      See Also:
    • RestHttpGemfireAdminTemplate

      public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache, String scheme, String host, int port, boolean followRedirects, List<org.springframework.http.client.ClientHttpRequestInterceptor> clientHttpRequestInterceptors)
      Constructs a new instance of RestHttpGemfireAdminTemplate initialized with the given ClientCache and configured with the specified HTTP scheme, host, port, redirects and ClientHttpRequestInterceptors when accessing the Apache Geode or Pivotal GemFire Management REST API interface.
      Parameters:
      clientCache - reference to the ClientCache
      scheme - String specifying the HTTP scheme to use (e.g. HTTP or HTTPS).
      host - String containing the hostname of the GemFire/Geode Manager.
      port - integer value specifying the port on which the GemFire/Geode Manager HTTP Service is listening for HTTP clients.
      followRedirects - boolean indicating whether HTTP Redirects (with HTTP Status Code 3xx) should be followed.
      clientHttpRequestInterceptors - List of ClientHttpRequestInterceptor used to intercept and decorate the HTTP request and HTTP response.
      Throws:
      IllegalArgumentException - if the ClientCache reference is null.
      See Also:
      • ClientHttpRequestInterceptor
      • ClientCache
    • RestHttpGemfireAdminTemplate

      public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache, String scheme, String host, int port, boolean followRedirects, List<org.springframework.http.client.ClientHttpRequestInterceptor> clientHttpRequestInterceptors, List<RestTemplateConfigurer> restTemplateConfigurers)
      Constructs a new instance of RestHttpGemfireAdminTemplate initialized with the given ClientCache and configured with the specified HTTP scheme, host, port, redirects and ClientHttpRequestInterceptors when accessing the Apache Geode or Pivotal GemFire Management REST API interface.
      Parameters:
      clientCache - reference to the ClientCache
      scheme - String specifying the HTTP scheme to use (e.g. HTTP or HTTPS).
      host - String containing the hostname of the GemFire/Geode Manager.
      port - integer value specifying the port on which the GemFire/Geode Manager HTTP Service is listening for HTTP clients.
      followRedirects - boolean indicating whether HTTP Redirects (with HTTP Status Code 3xx) should be followed.
      clientHttpRequestInterceptors - List of ClientHttpRequestInterceptor used to intercept and decorate the HTTP request and HTTP response.
      Throws:
      IllegalArgumentException - if the ClientCache reference is null.
      See Also:
  • Method Details

    • newClientHttpRequestFactory

      protected <T extends org.springframework.http.client.ClientHttpRequestFactory> T newClientHttpRequestFactory(boolean followRedirects)
      Constructs a new instance of ClientHttpRequestFactory to make HTTP client requests.
      Parameters:
      followRedirects - boolean value indicating whether HTTP redirects (with HTTP Status Code 3xx) should be followed.
      Returns:
      a new ClientHttpRequestFactory.
      See Also:
      • ClientHttpRequestFactory
    • newRestOperations

      protected <T extends org.springframework.web.client.RestOperations> T newRestOperations(org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory, List<org.springframework.http.client.ClientHttpRequestInterceptor> clientHttpRequestInterceptors, List<RestTemplateConfigurer> restTemplateConfigurers)
      Constructs a new instance of the Spring RestTemplate to perform REST API operations over HTTP.
      Parameters:
      clientHttpRequestFactory - ClientHttpRequestFactory used to construct HTTP request objects.
      clientHttpRequestInterceptors - List of ClientHttpRequestInterceptor used to intercept and decorate the HTTP request and HTTP response.
      Returns:
      a new instance of Spring's RestTemplate.
      See Also:
      • ClientHttpRequestInterceptor
      • SimpleClientHttpRequestFactory
      • RestOperations
      • RestTemplate
    • getManagementRestApiUrl

      protected String getManagementRestApiUrl()
      Returns a reference to the resolved GemFire/Geode Management REST API URL.
      Returns:
      a String containing the resolved GemFire/Geode Management REST API URL.
    • getRestOperations

      protected <T extends org.springframework.web.client.RestOperations> T getRestOperations()
      Returns a reference to the RestOperations used to perform REST API calls.
      Returns:
      a reference to the RestOperations used to perform REST API calls.
      See Also:
      • RestOperations
    • createIndex

      public void createIndex(IndexDefinition indexDefinition)
      Description copied from class: AbstractGemfireAdminOperations
      Creates a Region OQL Index based on the given schema object definition.
      Specified by:
      createIndex in interface GemfireAdminOperations
      Overrides:
      createIndex in class FunctionGemfireAdminTemplate
      Parameters:
      indexDefinition - IndexDefinition encapsulating the configuration meta-data defining a Region OQL Index.
      See Also:
    • resolveCreateIndexUri

      protected URI resolveCreateIndexUri()
    • createRegion

      public void createRegion(RegionDefinition regionDefinition)
      Description copied from class: AbstractGemfireAdminOperations
      Creates a cache Region based on the given schema object definition.
      Specified by:
      createRegion in interface GemfireAdminOperations
      Overrides:
      createRegion in class FunctionGemfireAdminTemplate
      Parameters:
      regionDefinition - RegionDefinition encapsulating configuration meta-data defining a cache Region.
      See Also:
    • resolveCreateRegionUri

      protected URI resolveCreateRegionUri()