Class WeiboProfileDefinition


  • public class WeiboProfileDefinition
    extends OAuthProfileDefinition
    This class is the Sina Weibo profile definition (using OAuth 2.0 protocol).

    More info at: users/show

    Since:
    3.1.0
    Author:
    zhangzhenli
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ALLOW_ALL_ACT_MSG
      boolean Whether to allow everyone to send me a private message, true: yes, false: no
      static java.lang.String ALLOW_ALL_COMMENT
      boolean Whether to allow everyone to comment on my Weibo, true: yes, false: no
      static java.lang.String AVATAR_HD
      string User avatar address (HD), HD avatar original
      static java.lang.String AVATAR_LARGE
      string User avatar address (larger image), 180 × 180 pixels
      static java.lang.String BI_FOLLOWERS_COUNT
      int User's mutual powder count
      static java.lang.String CITY
      int User's city ID
      static java.lang.String COVER_IMAGE_PHONE
      url User cover image url
      static java.lang.String CREATED_AT
      string User creation (registration) time
      static java.lang.String DESCRIPTION
      string User personal description
      static java.lang.String DOMAIN
      string User's personalized domain name
      static java.lang.String FAVOURITES_COUNT
      int Number of favorites
      static java.lang.String FOLLOW_ME
      boolean Whether the user is concerned about the currently logged in user, true: yes, false: no
      static java.lang.String FOLLOWERS_COUNT
      int Number of fans
      static java.lang.String FOLLOWING
      boolean Not supported yet
      static java.lang.String FRIENDS_COUNT
      int Number of followers
      static java.lang.String GENDER
      string Gender, m: male, f: female, n: unknown
      static java.lang.String GEO_ENABLED
      boolean Whether to allow identification of the user's geographic location, true: yes, false: no
      static java.lang.String ID
      int64 User UID
      static java.lang.String IDSTR
      string String-type user UID
      static java.lang.String LANG
      string User's current language version, zh-cn: Simplified Chinese, zh-tw: Traditional Chinese, en: English
      static java.lang.String LOCATION
      string User location
      static java.lang.String NAME
      string Friendly display name
      static java.lang.String ONLINE_STATUS
      int User's online status, 0: not online, 1: online
      static java.lang.String PROFILE_IMAGE_URL
      url User avatar address (middle), 50×50 pixels
      static java.lang.String PROFILE_URL
      url User's Weibo unified URL address
      static java.lang.String PROVINCE
      int User's provincial ID
      static java.lang.String REMARK
      string User note information, this field is only returned when querying user relationships
      static java.lang.String SCREEN_NAME
      string User's Nickname
      static java.lang.String STATUS
      object User's recent Weibo information field
      static java.lang.String STATUSES_COUNT
      int Weibo number
      static java.lang.String URL
      url User blog address
      static java.lang.String VERIFIED
      boolean Whether it is a Weibo authenticated user, that is, a V-user, true: yes, false: no
      static java.lang.String VERIFIED_REASON
      string Reason for certification
      static java.lang.String VERIFIED_TYPE
      int Not supported yet
      static java.lang.String WEIHAO
      string User's weihao number
      • Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition

        DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, LOCALE, PICTURE_URL
      • Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WeiboProfile extractUserProfile​(java.lang.String body)
      Extract the user profile from the response (JSON, XML...) of the profile url.
      java.lang.String getProfileUrl​(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)
      Retrieve the url of the profile of the authenticated user for the provider.
      • Methods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition

        configurePrimaryAttributes
      • Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinition

        convertAndAdd, convertAndAdd, getConverters, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
      • Methods inherited from class java.lang.Object

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

      • IDSTR

        public static final java.lang.String IDSTR
        string String-type user UID
        See Also:
        Constant Field Values
      • SCREEN_NAME

        public static final java.lang.String SCREEN_NAME
        string User's Nickname
        See Also:
        Constant Field Values
      • NAME

        public static final java.lang.String NAME
        string Friendly display name
        See Also:
        Constant Field Values
      • PROVINCE

        public static final java.lang.String PROVINCE
        int User's provincial ID
        See Also:
        Constant Field Values
      • LOCATION

        public static final java.lang.String LOCATION
        string User location
        See Also:
        Constant Field Values
      • DESCRIPTION

        public static final java.lang.String DESCRIPTION
        string User personal description
        See Also:
        Constant Field Values
      • PROFILE_IMAGE_URL

        public static final java.lang.String PROFILE_IMAGE_URL
        url User avatar address (middle), 50×50 pixels
        See Also:
        Constant Field Values
      • COVER_IMAGE_PHONE

        public static final java.lang.String COVER_IMAGE_PHONE
        url User cover image url
        See Also:
        Constant Field Values
      • PROFILE_URL

        public static final java.lang.String PROFILE_URL
        url User's Weibo unified URL address
        See Also:
        Constant Field Values
      • DOMAIN

        public static final java.lang.String DOMAIN
        string User's personalized domain name
        See Also:
        Constant Field Values
      • WEIHAO

        public static final java.lang.String WEIHAO
        string User's weihao number
        See Also:
        Constant Field Values
      • GENDER

        public static final java.lang.String GENDER
        string Gender, m: male, f: female, n: unknown
        See Also:
        Constant Field Values
      • FOLLOWERS_COUNT

        public static final java.lang.String FOLLOWERS_COUNT
        int Number of fans
        See Also:
        Constant Field Values
      • FRIENDS_COUNT

        public static final java.lang.String FRIENDS_COUNT
        int Number of followers
        See Also:
        Constant Field Values
      • STATUSES_COUNT

        public static final java.lang.String STATUSES_COUNT
        int Weibo number
        See Also:
        Constant Field Values
      • FAVOURITES_COUNT

        public static final java.lang.String FAVOURITES_COUNT
        int Number of favorites
        See Also:
        Constant Field Values
      • CREATED_AT

        public static final java.lang.String CREATED_AT
        string User creation (registration) time
        See Also:
        Constant Field Values
      • FOLLOWING

        public static final java.lang.String FOLLOWING
        boolean Not supported yet
        See Also:
        Constant Field Values
      • ALLOW_ALL_ACT_MSG

        public static final java.lang.String ALLOW_ALL_ACT_MSG
        boolean Whether to allow everyone to send me a private message, true: yes, false: no
        See Also:
        Constant Field Values
      • GEO_ENABLED

        public static final java.lang.String GEO_ENABLED
        boolean Whether to allow identification of the user's geographic location, true: yes, false: no
        See Also:
        Constant Field Values
      • VERIFIED

        public static final java.lang.String VERIFIED
        boolean Whether it is a Weibo authenticated user, that is, a V-user, true: yes, false: no
        See Also:
        Constant Field Values
      • VERIFIED_TYPE

        public static final java.lang.String VERIFIED_TYPE
        int Not supported yet
        See Also:
        Constant Field Values
      • REMARK

        public static final java.lang.String REMARK
        string User note information, this field is only returned when querying user relationships
        See Also:
        Constant Field Values
      • STATUS

        public static final java.lang.String STATUS
        object User's recent Weibo information field
        See Also:
        Constant Field Values
      • ALLOW_ALL_COMMENT

        public static final java.lang.String ALLOW_ALL_COMMENT
        boolean Whether to allow everyone to comment on my Weibo, true: yes, false: no
        See Also:
        Constant Field Values
      • AVATAR_LARGE

        public static final java.lang.String AVATAR_LARGE
        string User avatar address (larger image), 180 × 180 pixels
        See Also:
        Constant Field Values
      • AVATAR_HD

        public static final java.lang.String AVATAR_HD
        string User avatar address (HD), HD avatar original
        See Also:
        Constant Field Values
      • VERIFIED_REASON

        public static final java.lang.String VERIFIED_REASON
        string Reason for certification
        See Also:
        Constant Field Values
      • FOLLOW_ME

        public static final java.lang.String FOLLOW_ME
        boolean Whether the user is concerned about the currently logged in user, true: yes, false: no
        See Also:
        Constant Field Values
      • ONLINE_STATUS

        public static final java.lang.String ONLINE_STATUS
        int User's online status, 0: not online, 1: online
        See Also:
        Constant Field Values
      • BI_FOLLOWERS_COUNT

        public static final java.lang.String BI_FOLLOWERS_COUNT
        int User's mutual powder count
        See Also:
        Constant Field Values
      • LANG

        public static final java.lang.String LANG
        string User's current language version, zh-cn: Simplified Chinese, zh-tw: Traditional Chinese, en: English
        See Also:
        Constant Field Values
    • Constructor Detail

      • WeiboProfileDefinition

        public WeiboProfileDefinition()
    • Method Detail

      • getProfileUrl

        public java.lang.String getProfileUrl​(com.github.scribejava.core.model.Token accessToken,
                                              OAuthConfiguration configuration)
        Description copied from class: OAuthProfileDefinition
        Retrieve the url of the profile of the authenticated user for the provider.
        Specified by:
        getProfileUrl in class OAuthProfileDefinition
        Parameters:
        accessToken - only used when constructing dynamic urls from data in the token
        configuration - the current configuration
        Returns:
        the url of the user profile given by the provider
      • extractUserProfile

        public WeiboProfile extractUserProfile​(java.lang.String body)
                                        throws org.pac4j.core.exception.http.HttpAction
        Description copied from class: OAuthProfileDefinition
        Extract the user profile from the response (JSON, XML...) of the profile url.
        Specified by:
        extractUserProfile in class OAuthProfileDefinition
        Parameters:
        body - the response body
        Returns:
        the returned profile
        Throws:
        org.pac4j.core.exception.http.HttpAction