@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()); }
@Override public SyncContext syncUseConfigurationRawSchema(SyncContext context, boolean useConfigurationRawSchema) { EndpointProfileDto profile = context.getEndpointProfile(); if (profile.isUseConfigurationRawSchema() != useConfigurationRawSchema) { ClientSyncMetaData metaData = context.getMetaData(); EndpointObjectHash endpointKeyHash = EndpointObjectHash.fromBytes( toByteArray(metaData.getEndpointPublicKeyHash())); profile = profileService.updateProfile(metaData, endpointKeyHash, useConfigurationRawSchema); profile = syncProfileState( metaData.getApplicationToken(), context.getEndpointKey(), profile, false); context.setNotificationVersion(profile); } return context; }
this.serverProfile = MongoDaoUtil.encodeReservedCharacteres( (DBObject) JSON.parse(dto.getServerProfileBody())); this.useConfigurationRawSchema = dto.isUseConfigurationRawSchema(); this.version = dto.getVersion();
this.sdkToken = dto.getSdkToken(); this.serverProfile = dto.getServerProfileBody(); this.useConfigurationRawSchema = dto.isUseConfigurationRawSchema(); this.version = dto.getVersion(); this.epsConfigurationHash = getByteBuffer(dto.getEpsConfigurationHash());