Package org.swisspush.gateleen.user
Class UserProfileManipulater
- java.lang.Object
-
- org.swisspush.gateleen.user.UserProfileManipulater
-
public class UserProfileManipulater extends Object
- Author:
- https://github.com/floriankammermann [Florian Kammermann] on 02.07.2015
-
-
Constructor Summary
Constructors Constructor Description UserProfileManipulater(org.slf4j.Logger log)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.json.JsonObjectcreateInitialProfile(io.vertx.core.MultiMap headers, String userId, Collection<UserProfileConfiguration.ProfileProperty> profileProperties)protected io.vertx.core.json.JsonObjectcreateProfileWithLanguage(io.vertx.core.MultiMap headers)protected intenrichProfile(io.vertx.core.MultiMap headers, io.vertx.core.json.JsonObject profile, String userId, Collection<UserProfileConfiguration.ProfileProperty> profileProperties)Calls updateField for each property.static StringgetLang(io.vertx.core.MultiMap headers)booleanupdateField(String userId, io.vertx.core.MultiMap headers, io.vertx.core.json.JsonObject profile, UserProfileConfiguration.ProfileProperty profileProperty)Updates a single field of the profile.
-
-
-
Method Detail
-
createInitialProfile
public io.vertx.core.json.JsonObject createInitialProfile(io.vertx.core.MultiMap headers, String userId, Collection<UserProfileConfiguration.ProfileProperty> profileProperties)
-
enrichProfile
protected int enrichProfile(io.vertx.core.MultiMap headers, io.vertx.core.json.JsonObject profile, String userId, Collection<UserProfileConfiguration.ProfileProperty> profileProperties)Calls updateField for each property.- Returns:
- Update count (0 to len(profileProperties)).
-
updateField
public boolean updateField(String userId, io.vertx.core.MultiMap headers, io.vertx.core.json.JsonObject profile, UserProfileConfiguration.ProfileProperty profileProperty)
Updates a single field of the profile. Only updates the field if optional to (non-equal) and requested by the update strategyUserProfileConfiguration.ProfileProperty.getUpdateStrategy()and the header value is valid.- Returns:
true: Field updated.false: Not updated.
-
createProfileWithLanguage
protected io.vertx.core.json.JsonObject createProfileWithLanguage(io.vertx.core.MultiMap headers)
-
getLang
public static String getLang(io.vertx.core.MultiMap headers)
-
-