@Experimental public class ClusterManagementServiceProvider extends Object
ClusterManagementService
. A user
can create an instance of the ClusterManagementService
(CMS for short) in several ways,
each providing various level of control or expediency.
Calling getServiceFactory(context)
will return an explicit instance of ClusterManagementServiceFactory
. Methods on this factory can then be called to create or
retrieve instances of a CMS. New ClusterManagementServiceProvider
s can be written if
specific customization or parameterization is required.
A note about contexts. A context is simply a unique string which identifies a specific instance
of CMS that will be returned. Contexts map to the different uses of a CMS. Currently, the
following contexts are provided:
JAVA_CLIENT_CONTEXT
("java-client") - would be used to retrieve a CMS instance on a pure
Java client - i.e. an app that is not running in the context of a Geode client or server. This
context is available when using the geode-management module.
GEODE_CONTEXT
("geode") - would be used to retrieve a CMS instance
from a JVM where either a Cache
or ClientCache
exists. This context is available
when using the geode-core module.
getService(url)
method can be
called. This implicitly uses the JAVA_CLIENT_CONTEXT
. For further control the CMS can be
configured with a ClientHttpRequestFactory
by calling getService(requestFactory)
.
Finally, the simplest way to create a CMS instance is simply to call getService()
. This
method will attempt to infer the context and use an appropriate service provider to create a CMS
instance.Modifier and Type | Field and Description |
---|---|
static String |
GEODE_CONTEXT |
static String |
JAVA_CLIENT_CONTEXT |
Constructor and Description |
---|
ClusterManagementServiceProvider() |
Modifier and Type | Method and Description |
---|---|
static ClusterManagementService |
getService()
use this to get the ClusterManagementService from the locator, or from a server that connects
to a locator with no security manager.
|
static ClusterManagementService |
getService(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Retrieve a
ClusterManagementService instance configured with a
ClientHttpRequestFactory with a general requestFactory. |
static ClusterManagementService |
getService(String host,
int port)
Retrieve a
ClusterManagementService instance configured with an explicit service
endpoint. |
static ClusterManagementService |
getService(String host,
int port,
SSLContext sslContext,
HostnameVerifier hostnameVerifier,
String username,
String password)
Retrieve a
ClusterManagementService instance configured with an explicit service
endpoint. |
static ClusterManagementService |
getService(String username,
String password)
use this retrieve a ClusterManagementService from a server that connects to a secured locator
|
public static final String JAVA_CLIENT_CONTEXT
public static final String GEODE_CONTEXT
public static ClusterManagementService getService()
public static ClusterManagementService getService(String username, String password)
public static ClusterManagementService getService(String host, int port)
ClusterManagementService
instance configured with an explicit service
endpoint. this is good for end point with no ssl nor security turned on.
For example:
ClusterManagementServiceProvider.getService("locatorHost", "7070")
IllegalArgumentException
- if the provided url is malformedpublic static ClusterManagementService getService(String host, int port, SSLContext sslContext, HostnameVerifier hostnameVerifier, String username, String password)
ClusterManagementService
instance configured with an explicit service
endpoint. This service will allow you to connect to ssl enabled and security enabled end point
with the specified sslContext and hostnameVerifierhost
- the locator's host nameport
- http port of the locatorsslContext
- a pre configured sslContext to connect withhostnameVerifier
- a pre configured hostnameVerifier to connect withusername
- if cluster has security manager, use this username to connectpassword
- if cluster has security manager, use this password to connectpublic static ClusterManagementService getService(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
ClusterManagementService
instance configured with a
ClientHttpRequestFactory
with a general requestFactory. you can configure the
requestFactory to tailor to your need to connect to the end point.requestFactory
- the Request Factory configured with the URL of the Cluster Management
Service running on a locator. The port used is as configured by the
http-service-port property on the Geode locator.ClusterManagementService
instance configured to connect to the service
endpoint.