@Experimental public class RestTemplateClusterManagementServiceTransport extends Object implements ClusterManagementServiceTransport
ClusterManagementServiceTransport
which uses Spring's
RestTemplate
for communication between client and CMS endpoint.Constructor and Description |
---|
RestTemplateClusterManagementServiceTransport(ConnectionConfig connectionConfig) |
RestTemplateClusterManagementServiceTransport(org.springframework.web.client.RestTemplate restTemplate) |
RestTemplateClusterManagementServiceTransport(org.springframework.web.client.RestTemplate restTemplate,
ConnectionConfig connectionConfig) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the transport.
|
void |
configureConnection(ConnectionConfig connectionConfig)
Configure the transport with using connectionConfig.
|
boolean |
isConnected()
Indicate whether this transport is currently connected
|
static <T> org.springframework.http.HttpEntity<T> |
makeEntity(T config) |
<T extends AbstractConfiguration<?>> |
submitMessage(T configMessage,
CommandType command,
Class<? extends ClusterManagementRealizationResult> responseType)
Submit a message with a specific command.
|
<T extends AbstractConfiguration<R>,R extends RuntimeInfo> |
submitMessageForGet(T config,
Class<? extends ClusterManagementGetResult> responseType)
Submit a message with a specific command which returns a single result.
|
<T extends AbstractConfiguration<R>,R extends RuntimeInfo> |
submitMessageForList(T config,
Class<? extends ClusterManagementListResult> responseType)
Submit a message with a specific command which returns a list result.
|
<A extends ClusterManagementOperation<V>,V extends OperationResult> |
submitMessageForListOperation(A opType,
Class<? extends ClusterManagementListOperationsResult> responseType)
Submit a message for a specific command which returns a list result of operations in progress.
|
<A extends ClusterManagementOperation<V>,V extends OperationResult> |
submitMessageForStart(A op)
Submit a message to start a specific command.
|
public RestTemplateClusterManagementServiceTransport(org.springframework.web.client.RestTemplate restTemplate)
public RestTemplateClusterManagementServiceTransport(ConnectionConfig connectionConfig)
public RestTemplateClusterManagementServiceTransport(org.springframework.web.client.RestTemplate restTemplate, ConnectionConfig connectionConfig)
public void configureConnection(ConnectionConfig connectionConfig)
ClusterManagementServiceTransport
configureConnection
in interface ClusterManagementServiceTransport
connectionConfig
- ConnectionConfig
holding connection configuration information.public <T extends AbstractConfiguration<?>> ClusterManagementRealizationResult submitMessage(T configMessage, CommandType command, Class<? extends ClusterManagementRealizationResult> responseType)
ClusterManagementServiceTransport
ClusterManagementService.create(T)
and ClusterManagementService.delete(T)
commands.submitMessage
in interface ClusterManagementServiceTransport
T
- configuration object which extends AbstractConfiguration
configMessage
- configuration objectcommand
- the command to useresponseType
- the expected response classClusterManagementRealizationResult
public <T extends AbstractConfiguration<R>,R extends RuntimeInfo> ClusterManagementGetResult<T,R> submitMessageForGet(T config, Class<? extends ClusterManagementGetResult> responseType)
ClusterManagementServiceTransport
ClusterManagementService.get(T)
command.submitMessageForGet
in interface ClusterManagementServiceTransport
T
- configuration object which extends AbstractConfiguration
config
- configuration objectresponseType
- the expected response classClusterManagementGetResult
public <T extends AbstractConfiguration<R>,R extends RuntimeInfo> ClusterManagementListResult<T,R> submitMessageForList(T config, Class<? extends ClusterManagementListResult> responseType)
ClusterManagementServiceTransport
ClusterManagementService.list(AbstractConfiguration)
command.submitMessageForList
in interface ClusterManagementServiceTransport
T
- configuration object which extends AbstractConfiguration
config
- configuration objectresponseType
- the expected response classClusterManagementListResult
public <A extends ClusterManagementOperation<V>,V extends OperationResult> ClusterManagementListOperationsResult<V> submitMessageForListOperation(A opType, Class<? extends ClusterManagementListOperationsResult> responseType)
ClusterManagementServiceTransport
ClusterManagementService.list(ClusterManagementOperation)
command.submitMessageForListOperation
in interface ClusterManagementServiceTransport
A
- operation of type ClusterManagementOperation
responseType
- the expected response classClusterManagementListResult
public <A extends ClusterManagementOperation<V>,V extends OperationResult> ClusterManagementOperationResult<V> submitMessageForStart(A op)
ClusterManagementServiceTransport
ClusterManagementService.start(ClusterManagementOperation)
command.submitMessageForStart
in interface ClusterManagementServiceTransport
A
- operation of type ClusterManagementOperation
ClusterManagementListResult
public boolean isConnected()
ClusterManagementServiceTransport
isConnected
in interface ClusterManagementServiceTransport
public void close()
ClusterManagementServiceTransport
close
in interface ClusterManagementServiceTransport
public static <T> org.springframework.http.HttpEntity<T> makeEntity(T config)