Spring Data for VMware GemFire
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:
-
HttpURLConnectionURIClientCacheFunctionGemfireAdminOperationsFunctionGemfireAdminTemplateHttpHeadersHttpMethodHttpStatusRequestEntityResponseEntityClientHttpRequestFactoryClientHttpRequestInterceptorSimpleClientHttpRequestFactoryRestOperationsRestTemplate
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanprotected static final Stringprotected static final booleanprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.springframework.data.gemfire.config.admin.AbstractGemfireAdminOperations
NOT_IMPLEMENTED -
Constructor Summary
ConstructorsConstructorDescriptionRestHttpGemfireAdminTemplate(org.apache.geode.cache.client.ClientCache clientCache) Constructs a new instance ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand 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 ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptorswhen 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 ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptorswhen accessing the Apache Geode or Pivotal GemFire Management REST API interface. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateIndex(IndexDefinition indexDefinition) voidcreateRegion(RegionDefinition regionDefinition) Creates a cacheRegionbased on the givenschema object definition.protected StringReturns a reference to the resolved GemFire/Geode Management REST API URL.protected <T extends org.springframework.web.client.RestOperations>
TReturns a reference to theRestOperationsused to perform REST API calls.protected <T extends org.springframework.http.client.ClientHttpRequestFactory>
TnewClientHttpRequestFactory(boolean followRedirects) Constructs a new instance ofClientHttpRequestFactoryto 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 SpringRestTemplateto perform REST API operations over HTTP.protected URIprotected URIMethods inherited from class org.springframework.data.gemfire.config.admin.remote.FunctionGemfireAdminTemplate
getAvailableServerRegionIndexes, getAvailableServerRegions, getClientCache, newGemfireFunctionOperations, newGemfireFunctionOperationsMethods inherited from class org.springframework.data.gemfire.config.admin.AbstractGemfireAdminOperations
createDiskStoreMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.gemfire.config.admin.GemfireAdminOperations
createDiskStores, createDiskStores, createIndexes, createIndexes, 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 ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand 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- ifClientCacheis 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 ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptorswhen accessing the Apache Geode or Pivotal GemFire Management REST API interface.- Parameters:
clientCache- reference to theClientCachescheme-Stringspecifying the HTTP scheme to use (e.g. HTTP or HTTPS).host-Stringcontaining 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-ListofClientHttpRequestInterceptorused to intercept and decorate the HTTP request and HTTP response.- Throws:
IllegalArgumentException- if theClientCachereference is null.- See Also:
-
ClientHttpRequestInterceptorClientCache
-
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 ofRestHttpGemfireAdminTemplateinitialized with the givenClientCacheand configured with the specified HTTP scheme, host, port, redirects andClientHttpRequestInterceptorswhen accessing the Apache Geode or Pivotal GemFire Management REST API interface.- Parameters:
clientCache- reference to theClientCachescheme-Stringspecifying the HTTP scheme to use (e.g. HTTP or HTTPS).host-Stringcontaining 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-ListofClientHttpRequestInterceptorused to intercept and decorate the HTTP request and HTTP response.- Throws:
IllegalArgumentException- if theClientCachereference is null.- See Also:
-
ClientCacheRestTemplateConfigurerClientHttpRequestInterceptornewClientHttpRequestFactory(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 ofClientHttpRequestFactoryto 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 SpringRestTemplateto perform REST API operations over HTTP.- Parameters:
clientHttpRequestFactory-ClientHttpRequestFactoryused to construct HTTP request objects.clientHttpRequestInterceptors-ListofClientHttpRequestInterceptorused to intercept and decorate the HTTP request and HTTP response.- Returns:
- a new instance of Spring's
RestTemplate. - See Also:
-
ClientHttpRequestInterceptorSimpleClientHttpRequestFactoryRestOperationsRestTemplate
-
getManagementRestApiUrl
Returns a reference to the resolved GemFire/Geode Management REST API URL.- Returns:
- a
Stringcontaining the resolved GemFire/Geode Management REST API URL.
-
getRestOperations
protected <T extends org.springframework.web.client.RestOperations> T getRestOperations()Returns a reference to theRestOperationsused to perform REST API calls.- Returns:
- a reference to the
RestOperationsused to perform REST API calls. - See Also:
-
RestOperations
-
createIndex
Description copied from class:AbstractGemfireAdminOperations- Specified by:
createIndexin interfaceGemfireAdminOperations- Overrides:
createIndexin classFunctionGemfireAdminTemplate- Parameters:
indexDefinition-IndexDefinitionencapsulating the configuration meta-data defining aRegionOQLIndex.- See Also:
-
IndexDefinitionIndexRegion
-
resolveCreateIndexUri
-
createRegion
Description copied from class:AbstractGemfireAdminOperationsCreates a cacheRegionbased on the givenschema object definition.- Specified by:
createRegionin interfaceGemfireAdminOperations- Overrides:
createRegionin classFunctionGemfireAdminTemplate- Parameters:
regionDefinition-RegionDefinitionencapsulating configuration meta-data defining a cacheRegion.- See Also:
-
RegionDefinitionGemFireCacheRegion
-
resolveCreateRegionUri
-