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);
}
}
Aggregations