Class OAuthPersistenceUtils

java.lang.Object
io.meeds.oauth.utils.OAuthPersistenceUtils

public class OAuthPersistenceUtils extends Object
Various utils method related to persistence
Author:
Marek Posolda
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getChunkLength(org.exoplatform.container.xml.InitParams params)
    Parse chunkLength from value params (same code used in all processors)
    static String
    getLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute)
    Get very long attribute.
    static void
    removeLongAttribute(org.exoplatform.services.organization.UserProfile userProfile, String attributePrefix, boolean useSuffixInFirstAttribute)
    Remove very long attribute.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 save
      userProfile - user profile where attribute will be saved
      attributePrefix - 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 compatibility
      lengthOfOneChunk - 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 see saveLongAttribute(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 see saveLongAttribute(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)