Search in sources :

Example 1 with ResponseInfo

use of com.dell.cpsd.virtualization.capabilities.api.ResponseInfo in project fru-paqx-parent by dellemc-symphony.

the class VCenterConsulRegisterResponseHandler method executeOperation.

@Override
protected void executeOperation(final ConsulRegisterResponseMessage responseMessage) throws Exception {
    LOG.info("Received message {}", responseMessage);
    final String correlationId = responseMessage.getMessageProperties().getCorrelationId();
    final ResponseInfo responseInfo = responseMessage.getResponseInfo();
    final boolean success = responseInfo.getMessage().startsWith("SUCCESS");
    final ConsulRegistryResult consulRegistryResult = new ConsulRegistryResult(success, responseInfo.getMessage());
    final CompletableFuture<ConsulRegistryResult> completableFuture = asyncRequests.get(correlationId);
    LOG.info("Completing expectation for  {} {}", correlationId, completableFuture);
    if (completableFuture != null) {
        final boolean complete = completableFuture.complete(consulRegistryResult);
        LOG.info("Completed expectation for  {} {} {}", correlationId, completableFuture, complete);
        asyncRequests.remove(correlationId);
    }
}
Also used : ResponseInfo(com.dell.cpsd.virtualization.capabilities.api.ResponseInfo) ConsulRegistryResult(com.dell.cpsd.paqx.fru.dto.ConsulRegistryResult)

Aggregations

ConsulRegistryResult (com.dell.cpsd.paqx.fru.dto.ConsulRegistryResult)1 ResponseInfo (com.dell.cpsd.virtualization.capabilities.api.ResponseInfo)1