Package io.meeds.oauth.utils
Class OAuthPersistenceUtils
java.lang.Object
io.meeds.oauth.utils.OAuthPersistenceUtils
Various utils method related to persistence
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetChunkLength(org.exoplatform.container.xml.InitParams params) Parse chunkLength from value params (same code used in all processors)static StringgetLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute) Get very long attribute.static voidremoveLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute) Remove very long attribute.static voidsaveLongAttribute(String longAttribute, org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute, int lengthOfOneChunk) Save some potentially long attribute (For example OAuth accessToken) into given UserProfile.
-
Field Details
-
DEFAULT_CHUNK_LENGTH
public static final int DEFAULT_CHUNK_LENGTH- See Also:
-
-
Method Details
-
saveLongAttribute
public static void saveLongAttribute(String longAttribute, org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute, int lengthOfOneChunk) Save some potentially long attribute (For example OAuth accessToken) into given UserProfile. The point is that attribute needs to be divided and saved into more "children" attributes (chunks) of userProfile because it's too long.- Parameters:
longAttribute- long attribute to saveuserProfile- user profile where attribute will be savedattributePrefix- prefix to save. For example if prefix is "myPrefix" then longAttribute will be saved into chunks (attributes) like "myPrefix.1", "myPrefix.2", ... etc.useSuffixInFirstAttribute- Whether to use suffix in very first attribute. If true, the first attribute will be "myPrefix.1". If false, it will be just "myPrefix". The only point of this parameter is backwards compatibilitylengthOfOneChunk- length of single chunk
-
removeLongAttribute
public static void removeLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute) Remove very long attribute. For parameters description seesaveLongAttribute(String, UserProfile, String, boolean, int) -
getLongAttribute
public static String getLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute) Get very long attribute. For parameters description seesaveLongAttribute(String, UserProfile, String, boolean, int)- Returns:
- very long attribute from all chunks
-
getChunkLength
public static int getChunkLength(org.exoplatform.container.xml.InitParams params) Parse chunkLength from value params (same code used in all processors)
-