code: private LDAPUser getOrCreateUser(final Entry userEntry) throws FrameworkException {
  
  		final App app                = StructrApp.getInstance();
  		final PropertyMap attributes = new PropertyMap();
  		final Dn dn                  = userEntry.getDn();
  		Dn parent                    = dn;
  
  		// remove all non-structural rdns (cn / sn / uid etc.)
  		while (!structuralTypes.contains(parent.getRdn().getNormType())) {
  
  			parent = parent.getParent();
  		}
  
  		attributes.put(StructrApp.key(LDAPUser.class, "distinguishedName"), dn.getNormName());
  
  		LDAPUser user = app.nodeQuery(LDAPUser.class).and(attributes).getFirst();
  		if (user == null) {
  
  			user = app.create(LDAPUser.class, attributes);
  			user.initializeFrom(userEntry);
  		}
  
  		return user;
  	}
docs: ----- private methods -----