You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by am...@apache.org on 2017/06/06 15:58:33 UTC
incubator-unomi git commit: DMF-1556 : Csv without First name,
and last name will show null, null in log file
Repository: incubator-unomi
Updated Branches:
refs/heads/feature-DMF-1343 f694dacb2 -> 1637a9122
DMF-1556 : Csv without First name, and last name will show null, null in log file
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/1637a912
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/1637a912
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/1637a912
Branch: refs/heads/feature-DMF-1343
Commit: 1637a9122fb106559751be881e54eb2a8fd83e5b
Parents: f694dac
Author: Abdelkader Midani <am...@apache.org>
Authored: Tue Jun 6 17:58:31 2017 +0200
Committer: Abdelkader Midani <am...@apache.org>
Committed: Tue Jun 6 17:58:31 2017 +0200
----------------------------------------------------------------------
.../router/services/ProfileImportServiceImpl.java | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/1637a912/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
index 6dcc152..cb1d706 100644
--- a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
+++ b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
@@ -80,38 +80,37 @@ public class ProfileImportServiceImpl implements ProfileImportService, Synchrono
public boolean saveMergeDeleteImportedProfile(ProfileToImport profileToImport) throws InvocationTargetException, IllegalAccessException {
- logger.info("Importing profile: {}, {}", profileToImport.getProperties().get("firstName"), profileToImport.getProperties().get("lastName"));
+ logger.debug("Importing profile with ID : {}", profileToImport.getItemId());
Profile existingProfile = new Profile();
List<Profile> existingProfiles = persistenceService.query("properties."+profileToImport.getMergingProperty(), (String)profileToImport.getProperties().get(profileToImport.getMergingProperty()), null, Profile.class);
- logger.info("Query existing profile with mergingProperty: {}", profileToImport.getMergingProperty());
- logger.info("Found: {}", existingProfiles.size());
+ logger.debug("Query existing profile with mergingProperty: {}. Found: {}", profileToImport.getMergingProperty(), existingProfiles.size());
//Profile already exist, and import config allow to overwrite profiles
if(existingProfiles.size() == 1) {
existingProfile = existingProfiles.get(0);
if(profileToImport.isProfileToDelete()) {
- logger.info("Profile is to delete!");
+ logger.debug("Profile is to delete!");
persistenceService.remove(existingProfile.getItemId(), Profile.class);
return true;
}
List<String> propertiesToOverwrite = profileToImport.getPropertiesToOverwrite();
if(profileToImport.isOverwriteExistingProfiles() && propertiesToOverwrite!=null && propertiesToOverwrite.size() > 0) { // We overwrite only properties marked to overwrite
- logger.info("Properties to overwrite: {}", propertiesToOverwrite);
+ logger.debug("Properties to overwrite: {}", propertiesToOverwrite);
for(String propName : propertiesToOverwrite) {
existingProfile.getProperties().put(propName, profileToImport.getProperties().get(propName));
}
} else { //If no property is marked to overwrite we replace the whole properties map
- logger.info("Overwrite all properties");
+ logger.debug("Overwrite all properties");
existingProfile.setProperties(profileToImport.getProperties());
}
} else if(existingProfiles.size() == 0) {
- logger.info("New profile to add...");
+ logger.debug("New profile to add...");
BeanUtils.copyProperties(existingProfile, profileToImport);
} else {
logger.warn("{} occurences found for profile with {} = {}. Profile import is skipped", existingProfiles.size(),
profileToImport.getMergingProperty(), profileToImport.getProperties().get(profileToImport.getMergingProperty()));
}
- logger.info("-------------------------------------");
+ logger.debug("-------------------------------------");
return persistenceService.save(existingProfile);
}