logger.info(
"Registered Applications size is zero : {}",
(getApplications().getRegisteredApplications().size() == 0));
response = storeFullRegistry();
} else {
Applications delta = null;
response = fetchRemoteRegistry(true);
if (null != response) {
if (response.getStatus() == Status.OK.getStatusCode()) {
delta = response.getEntity(Applications.class);
this.applicationsDelta.set(delta);
}
if (delta == null) {
logger.warn("The server does not allow the delta revision to be applied because it is not "
+ "safe. Hence got the full registry.");
this.closeResponse(response);
response = fetchRemoteRegistry(true);
} else {
updateDelta(delta);
String reconcileHashCode = getApplications()
.getReconcileHashCode();
// There is a diff in number of instances for some reason
if ((!reconcileHashCode.equals(delta.getAppsHashCode()))) {
response = reconcileAndLogDifference(response, delta, reconcileHashCode);
}
}
}