/** * Returns whether user configuration update is pending. * * @return true if user configuration update is pending otherwise false */ public boolean isUserConfigurationUpdatePending() { if (!isValidForUser() || isUcfHashRequiresInitialization()) { return false; } return !Arrays.equals(ucfHash, endpointProfile.getUserConfigurationHash()); }
private void sendConnectToNewUser(ActorContext context, EndpointProfileDto endpointProfile) { List<EventClassFamilyVersion> ecfVersions = EntityConvertUtils.convertToEcfVersions( endpointProfile.getEcfVersionStates()); EndpointUserConnectMessage userRegistrationMessage = new EndpointUserConnectMessage( state.getUserId(), key, ecfVersions, endpointProfile.getConfigurationVersion(), endpointProfile.getUserConfigurationHash(), appToken, context.self()); LOG.debug("[{}][{}] Sending user registration request {}", endpointKey, actorKey, userRegistrationMessage); context.parent().tell(userRegistrationMessage, context.self()); }
@Override public ConfigurationCacheEntry getConfiguration(String appToken, String endpointId, EndpointProfileDto profile) throws GetDeltaException { LOG.debug("[{}][{}] Calculating new configuration", appToken, endpointId); AppVersionKey appConfigVersionKey = new AppVersionKey(appToken, profile.getConfigurationVersion()); EndpointObjectHash userConfHash = EndpointObjectHash.fromBytes(profile .getUserConfigurationHash()); EndpointObjectHash epsConfHash = EndpointObjectHash.fromBytes(profile .getEpsConfigurationHash()); DeltaCacheKey deltaKey = new DeltaCacheKey(appConfigVersionKey, profile.getGroupState(), userConfHash, epsConfHash, null, profile.isUseConfigurationRawSchema(), true); LOG.debug("[{}][{}] Built resync delta key {}", appToken, endpointId, deltaKey); return getDelta(endpointId, profile.getEndpointUserId(), deltaKey, profile.isUseConfigurationRawSchema()); }
endpointProfile = profileService.updateProfile(endpointProfile, (storedProfile, newProfile) -> { if (updateConfiguration) { storedProfile.setUserConfigurationHash(newProfile.getUserConfigurationHash()); storedProfile.setEpsConfigurationHash(newProfile.getEpsConfigurationHash());
this.serverProfileVersion = dto.getServerProfileVersion(); this.configurationHash = dto.getConfigurationHash(); this.userConfigurationHash = dto.getUserConfigurationHash(); this.configurationVersion = dto.getConfigurationVersion(); this.subscriptions = dto.getSubscriptions();
this.serverProfileVersion = dto.getServerProfileVersion(); this.configurationHash = getByteBuffer(dto.getConfigurationHash()); this.userConfigurationHash = getByteBuffer(dto.getUserConfigurationHash()); this.configurationVersion = dto.getConfigurationVersion(); this.subscriptions = dto.getSubscriptions();