Class RestHttpGemfireAdminTemplate
java.lang.Object
org.springframework.data.gemfire.config.admin.AbstractGemfireAdminOperations
org.springframework.data.gemfire.config.admin.remote.FunctionGemfireAdminTemplate
org.springframework.data.gemfire.config.admin.remote.RestHttpGemfireAdminTemplate
- All Implemented Interfaces:
GemfireAdminOperations
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:
-
HttpURLConnection
URI
ClientCache
Function
GemfireAdminOperations
FunctionGemfireAdminTemplate
HttpHeaders
HttpMethod
HttpStatus
RequestEntity
ResponseEntity
ClientHttpRequestFactory
ClientHttpRequestInterceptor
SimpleClientHttpRequestFactory
RestOperations
RestTemplate
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final boolean
protected static final String
protected static final boolean
protected static final int
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from class org.springframework.data.gemfire.config.admin.AbstractGemfireAdminOperations
NOT_IMPLEMENTED
-
Constructor Summary
ConstructorDescriptionRestHttpGemfireAdminTemplate
(org.apache.geode.cache.client.ClientCache clientCache) Constructs a new instance ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
and configured with the default HTTP schema, host and port when accessing the Apache Geode or Pivotal GemFire Management REST API interface.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 ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
and configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptors
when accessing the Apache Geode or Pivotal GemFire Management REST API interface.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 ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
and configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptors
when accessing the Apache Geode or Pivotal GemFire Management REST API interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createIndex
(IndexDefinition indexDefinition) void
createRegion
(RegionDefinition regionDefinition) Creates a cacheRegion
based on the givenschema object definition
.protected String
Returns a reference to the resolved GemFire/Geode Management REST API URL.protected <T extends org.springframework.web.client.RestOperations>
TReturns a reference to theRestOperations
used to perform REST API calls.protected <T extends org.springframework.http.client.ClientHttpRequestFactory>
TnewClientHttpRequestFactory
(boolean followRedirects) Constructs a new instance ofClientHttpRequestFactory
to make HTTP client requests.protected <T extends org.springframework.web.client.RestOperations>
TnewRestOperations
(org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory, List<org.springframework.http.client.ClientHttpRequestInterceptor> clientHttpRequestInterceptors, List<RestTemplateConfigurer> restTemplateConfigurers) Constructs a new instance of the SpringRestTemplate
to perform REST API operations over HTTP.protected URI
protected URI
Methods inherited from class org.springframework.data.gemfire.config.admin.remote.FunctionGemfireAdminTemplate
getAvailableServerRegionIndexes, getAvailableServerRegions, getClientCache, newGemfireFunctionOperations, newGemfireFunctionOperations
Methods inherited from class org.springframework.data.gemfire.config.admin.AbstractGemfireAdminOperations
createDiskStore, createLuceneIndex
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.gemfire.config.admin.GemfireAdminOperations
createDiskStores, createDiskStores, createIndexes, createIndexes, createLuceneIndexes, createLuceneIndexes, createRegions, createRegions
-
Field Details
-
DEFAULT_CREATE_REGION_SKIP_IF_EXISTS
protected static final boolean DEFAULT_CREATE_REGION_SKIP_IF_EXISTS- See Also:
-
DEFAULT_HTTP_FOLLOW_REDIRECTS
protected static final boolean DEFAULT_HTTP_FOLLOW_REDIRECTS- See Also:
-
DEFAULT_PORT
protected static final int DEFAULT_PORT- See Also:
-
DEFAULT_HOST
- See Also:
-
DEFAULT_SCHEME
- See Also:
-
HTTP_SCHEME
- See Also:
-
HTTPS_SCHEME
- See Also:
-
MANAGEMENT_REST_API_URL_TEMPLATE
- See Also:
-
MANAGEMENT_REST_API_NO_PORT_URL_TEMPLATE
- See Also:
-
VALID_SCHEMES
-
-
Constructor Details
-
RestHttpGemfireAdminTemplate
public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache) Constructs a new instance ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
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 theClientCache
.- Throws:
IllegalArgumentException
- ifClientCache
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 ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
and configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptors
when accessing the Apache Geode or Pivotal GemFire Management REST API interface.- Parameters:
clientCache
- reference to theClientCache
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
ofClientHttpRequestInterceptor
used to intercept and decorate the HTTP request and HTTP response.- Throws:
IllegalArgumentException
- if theClientCache
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 ofRestHttpGemfireAdminTemplate
initialized with the givenClientCache
and configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptors
when accessing the Apache Geode or Pivotal GemFire Management REST API interface.- Parameters:
clientCache
- reference to theClientCache
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
ofClientHttpRequestInterceptor
used to intercept and decorate the HTTP request and HTTP response.- Throws:
IllegalArgumentException
- if theClientCache
reference is null.- See Also:
-
ClientCache
RestTemplateConfigurer
ClientHttpRequestInterceptor
newClientHttpRequestFactory(boolean)
newRestOperations(ClientHttpRequestFactory, List, List)
resolveManagementRestApiUrl(String, String, int)
-
-
Method Details
-
newClientHttpRequestFactory
protected <T extends org.springframework.http.client.ClientHttpRequestFactory> T newClientHttpRequestFactory(boolean followRedirects) Constructs a new instance ofClientHttpRequestFactory
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 SpringRestTemplate
to perform REST API operations over HTTP.- Parameters:
clientHttpRequestFactory
-ClientHttpRequestFactory
used to construct HTTP request objects.clientHttpRequestInterceptors
-List
ofClientHttpRequestInterceptor
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
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 theRestOperations
used to perform REST API calls.- Returns:
- a reference to the
RestOperations
used to perform REST API calls. - See Also:
-
RestOperations
-
createIndex
Description copied from class:AbstractGemfireAdminOperations
- Specified by:
createIndex
in interfaceGemfireAdminOperations
- Overrides:
createIndex
in classFunctionGemfireAdminTemplate
- Parameters:
indexDefinition
-IndexDefinition
encapsulating the configuration meta-data defining aRegion
OQLIndex
.- See Also:
-
IndexDefinition
Index
Region
-
resolveCreateIndexUri
-
createRegion
Description copied from class:AbstractGemfireAdminOperations
Creates a cacheRegion
based on the givenschema object definition
.- Specified by:
createRegion
in interfaceGemfireAdminOperations
- Overrides:
createRegion
in classFunctionGemfireAdminTemplate
- Parameters:
regionDefinition
-RegionDefinition
encapsulating configuration meta-data defining a cacheRegion
.- See Also:
-
RegionDefinition
GemFireCache
Region
-
resolveCreateRegionUri
-