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.HttpURLConnection
,
URI
,
ClientCache
,
Function
,
GemfireAdminOperations
,
FunctionGemfireAdminTemplate
,
HttpHeaders
,
HttpMethod
,
HttpStatus
,
RequestEntity
,
ResponseEntity
,
ClientHttpRequestFactory
,
ClientHttpRequestInterceptor
,
SimpleClientHttpRequestFactory
,
RestOperations
,
RestTemplate
Modifier and Type | Class and Description |
---|---|
static class |
RestHttpGemfireAdminTemplate.Builder |
static class |
RestHttpGemfireAdminTemplate.FollowRedirectsSimpleClientHttpRequestFactory |
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEFAULT_CREATE_REGION_SKIP_IF_EXISTS |
protected static String |
DEFAULT_HOST |
protected static boolean |
DEFAULT_HTTP_FOLLOW_REDIRECTS |
protected static int |
DEFAULT_PORT |
protected static String |
DEFAULT_SCHEME |
protected static String |
HTTP_SCHEME |
protected static String |
HTTPS_SCHEME |
protected static String |
MANAGEMENT_REST_API_NO_PORT_URL_TEMPLATE |
protected static String |
MANAGEMENT_REST_API_URL_TEMPLATE |
protected static List<String> |
VALID_SCHEMES |
NOT_IMPLEMENTED
Constructor and Description |
---|
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. |
RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache,
String scheme,
String host,
int port,
boolean followRedirects,
List<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. |
RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache,
String scheme,
String host,
int port,
boolean followRedirects,
List<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. |
Modifier and Type | Method and Description |
---|---|
void |
createIndex(IndexDefinition indexDefinition)
|
void |
createRegion(RegionDefinition regionDefinition)
Creates a cache
Region based on the given schema object definition . |
protected String |
getManagementRestApiUrl()
Returns a reference to the resolved Pivotal GemFire/Apache Geode Management REST API URL.
|
protected <T extends RestOperations> |
getRestOperations()
Returns a reference to the
RestOperations used to perform REST API calls. |
protected <T extends ClientHttpRequestFactory> |
newClientHttpRequestFactory(boolean followRedirects)
Constructs a new instance of
ClientHttpRequestFactory to make HTTP client requests. |
protected <T extends RestOperations> |
newRestOperations(ClientHttpRequestFactory clientHttpRequestFactory,
List<ClientHttpRequestInterceptor> clientHttpRequestInterceptors,
List<RestTemplateConfigurer> restTemplateConfigurers)
Constructs a new instance of the Spring
RestTemplate to perform REST API operations over HTTP. |
protected URI |
resolveCreateIndexUri() |
protected URI |
resolveCreateRegionUri() |
getAvailableServerRegionIndexes, getAvailableServerRegions, getClientCache, newGemfireFunctionOperations, newGemfireFunctionOperations
createDiskStore, createLuceneIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDiskStores, createDiskStores, createIndexes, createIndexes, createLuceneIndexes, createLuceneIndexes, createRegions, createRegions
protected static final boolean DEFAULT_CREATE_REGION_SKIP_IF_EXISTS
protected static final boolean DEFAULT_HTTP_FOLLOW_REDIRECTS
protected static final int DEFAULT_PORT
protected static final String DEFAULT_HOST
protected static final String DEFAULT_SCHEME
protected static final String HTTP_SCHEME
protected static final String HTTPS_SCHEME
protected static final String MANAGEMENT_REST_API_URL_TEMPLATE
protected static final String MANAGEMENT_REST_API_NO_PORT_URL_TEMPLATE
public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache)
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.clientCache
- reference to the ClientCache
.IllegalArgumentException
- if ClientCache
is null.RestHttpGemfireAdminTemplate(ClientCache, String, String, int, boolean, List)
,
ClientCache
public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache, String scheme, String host, int port, boolean followRedirects, List<ClientHttpRequestInterceptor> clientHttpRequestInterceptors)
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.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.IllegalArgumentException
- if the ClientCache
reference is null.ClientHttpRequestInterceptor
,
ClientCache
public RestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache, String scheme, String host, int port, boolean followRedirects, List<ClientHttpRequestInterceptor> clientHttpRequestInterceptors, List<RestTemplateConfigurer> restTemplateConfigurers)
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.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.IllegalArgumentException
- if the ClientCache
reference is null.ClientCache
,
RestTemplateConfigurer
,
ClientHttpRequestInterceptor
,
newClientHttpRequestFactory(boolean)
,
newRestOperations(ClientHttpRequestFactory, List, List)
,
resolveManagementRestApiUrl(String, String, int)
protected <T extends ClientHttpRequestFactory> T newClientHttpRequestFactory(boolean followRedirects)
ClientHttpRequestFactory
to make HTTP client requests.followRedirects
- boolean value indicating whether HTTP redirects (with HTTP Status Code 3xx)
should be followed.ClientHttpRequestFactory
.ClientHttpRequestFactory
protected <T extends RestOperations> T newRestOperations(ClientHttpRequestFactory clientHttpRequestFactory, List<ClientHttpRequestInterceptor> clientHttpRequestInterceptors, List<RestTemplateConfigurer> restTemplateConfigurers)
RestTemplate
to perform REST API operations over HTTP.clientHttpRequestFactory
- ClientHttpRequestFactory
used to construct HTTP request objects.clientHttpRequestInterceptors
- List
of ClientHttpRequestInterceptor
used to intercept
and decorate the HTTP request and HTTP response.RestTemplate
.ClientHttpRequestInterceptor
,
SimpleClientHttpRequestFactory
,
RestOperations
,
RestTemplate
protected String getManagementRestApiUrl()
String
containing the resolved Pivotal GemFire/Apache Geode Management REST API URL.protected <T extends RestOperations> T getRestOperations()
RestOperations
used to perform REST API calls.RestOperations
used to perform REST API calls.RestOperations
public void createIndex(IndexDefinition indexDefinition)
AbstractGemfireAdminOperations
createIndex
in interface GemfireAdminOperations
createIndex
in class FunctionGemfireAdminTemplate
indexDefinition
- IndexDefinition
encapsulating the configuration meta-data
defining a Region
OQL Index
.IndexDefinition
,
Index
,
Region
protected URI resolveCreateIndexUri()
public void createRegion(RegionDefinition regionDefinition)
AbstractGemfireAdminOperations
Region
based on the given schema object definition
.createRegion
in interface GemfireAdminOperations
createRegion
in class FunctionGemfireAdminTemplate
regionDefinition
- RegionDefinition
encapsulating configuration meta-data defining
a cache Region
.RegionDefinition
,
GemFireCache
,
Region
protected URI resolveCreateRegionUri()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.