Class ProfileDefinition

  • Direct Known Subclasses:
    CommonProfileDefinition

    public abstract class ProfileDefinition
    extends java.lang.Object
    Define a profile (its class and attributes).
    Since:
    2.0.0
    Author:
    Jerome Leleu
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • ProfileDefinition

        public ProfileDefinition()
    • Method Detail

      • newProfile

        public UserProfile newProfile​(java.lang.Object... parameters)
        Return the new built or restored profile.
        Parameters:
        parameters - some input parameters (the first optional one is the typed id)
        Returns:
        the new built or restored profile
      • getParameter

        protected java.lang.Object getParameter​(java.lang.Object[] parameters,
                                                int num)
      • convertAndAdd

        public void convertAndAdd​(UserProfile profile,
                                  AttributeLocation attributeLocation,
                                  java.lang.String name,
                                  java.lang.Object value)
        Convert a profile or authentication attribute, if necessary, and add it to the profile.
        Parameters:
        profile - The profile.
        attributeLocation - Location of the attribute inside the profile: classic profile attribute, authentication attribute, ...
        name - The attribute name.
        value - The attribute value.
      • convertAndAdd

        public void convertAndAdd​(UserProfile profile,
                                  java.util.Map<java.lang.String,​java.lang.Object> profileAttributes,
                                  java.util.Map<java.lang.String,​java.lang.Object> authenticationAttributes)
        Convert the profile and authentication attributes, if necessary, and add them to the profile.
        Parameters:
        profile - The profile.
        profileAttributes - The profile attributes. May be null.
        authenticationAttributes - The authentication attributes. May be null.
      • setProfileFactory

        protected void setProfileFactory​(ProfileFactory profileFactory)
        Define the way to build the profile.
        Parameters:
        profileFactory - the way to build the profile
      • primary

        protected void primary​(java.lang.String name,
                               AttributeConverter converter)
        Add an attribute as a primary one and its converter.
        Parameters:
        name - name of the attribute
        converter - converter
      • secondary

        protected void secondary​(java.lang.String name,
                                 AttributeConverter converter)
        Add an attribute as a secondary one and its converter.
        Parameters:
        name - name of the attribute
        converter - converter
      • getPrimaryAttributes

        public java.util.List<java.lang.String> getPrimaryAttributes()
      • getSecondaryAttributes

        public java.util.List<java.lang.String> getSecondaryAttributes()
      • getConverters

        public java.util.Map<java.lang.String,​AttributeConverter> getConverters()
      • setProfileId

        public void setProfileId​(java.lang.String profileId)
      • getProfileId

        public java.lang.String getProfileId()
      • isRestoreProfileFromTypedId

        public boolean isRestoreProfileFromTypedId()
      • setRestoreProfileFromTypedId

        public void setRestoreProfileFromTypedId​(boolean restoreProfileFromTypedId)