private ConfigurationClientSync diff(ConfigurationClientSync oldRequest, ConfigurationClientSync newRequest) { if (oldRequest == null) { return newRequest; } else { if (!Arrays.equals(oldRequest.getConfigurationHash().array(), newRequest.getConfigurationHash().array())) { return newRequest; } else { return null; } } }
/** * Calculate configuration delta. * * @param appToken the application token * @param request the request * @param context the context * @return the gets the delta response * @throws GetDeltaException the get delta exception */ private GetDeltaResponse calculateConfigurationDelta(String appToken, ConfigurationClientSync request, SyncContext context) throws GetDeltaException { GetDeltaRequest deltaRequest; if (request.getConfigurationHash() != null) { deltaRequest = new GetDeltaRequest( appToken, EndpointObjectHash.fromBytes(request.getConfigurationHash().array()), request.isResyncOnly()); } else { deltaRequest = new GetDeltaRequest(appToken); } deltaRequest.setEndpointProfile(context.getEndpointProfile()); return deltaService.getDelta(deltaRequest); }