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/63debd5f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/63debd5f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/63debd5f

Branch: refs/heads/feature-DMF-1343
Commit: 63debd5fcda21fda77aa20dc353267800bdcab74
Parents: d95595f
Author: Abdelkader Midani <amid...@apache.org>
Authored: Tue Jun 6 17:58:31 2017 +0200
Committer: Abdelkader Midani <amid...@apache.org>
Committed: Mon Jun 12 19:24:29 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/63debd5f/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);
     }
 

Reply via email to