Hi,
What is this code doing -
private CompletionStage<Object> update(UpdateAtmEnabledRequest payload, CompletableFuture<KycInfoV2> kycInfoV2Future, boolean shouldUpdate) {
if (shouldUpdate) {
KycInfoV2 infoV2 = kycInfoV2Future.join();
infoV2.getAttrs().addProperty(ATM_ENABLED, payload.getAtmEnabled());
return kycProfileDao.upsertKycInfo(payload.getUserID(), kycInfoV2Future.join())
.thenCompose(___ -> updateCloudcard(payload.getUserID(), payload.getIfiId(), infoV2.getPanNumber(), payload.getAtmEnabled(), infoV2.getEffectiveKycStatus()))
.thenCompose(__ -> userProfileDao.updateKycData(payload.getUserID(), null, null, ImmutableMap.of(ATM_ENABLED, payload.getAtmEnabled().toString())))
.thenCompose(____ -> {
profileUpdateRecorder.recordUpdate(payload.getUserID(), new ProfileUpdateModel()
.action(UPDATE)
.field("ATM_ENABLED")
.value("IFI" + payload.getIfiId() + "ATM_ENABLED" + payload.getAtmEnabled().toString()));
return completedFuture(null);
});
}
return completedFuture(null);
}
Open in new window
I need to understand more of this CompletionStage, CompletableFuture.
Thanks