Class ProfileDefinition

java.lang.Object
org.pac4j.core.profile.definition.ProfileDefinition
Direct Known Subclasses:
CommonProfileDefinition

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

    • logger

      protected final org.slf4j.Logger logger
  • Constructor Details

    • ProfileDefinition

      public ProfileDefinition()
  • Method Details

    • newProfile

      public UserProfile newProfile(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 Object getParameter(Object[] parameters, int num)

      getParameter.

      Parameters:
      parameters - an array of Object objects
      num - a int
      Returns:
      a Object object
    • convertAndAdd

      public void convertAndAdd(UserProfile profile, AttributeLocation attributeLocation, String name, 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, Map<String,Object> profileAttributes, Map<String,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.
    • primary

      protected void primary(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(String name, AttributeConverter converter)
      Add an attribute as a secondary one and its converter.
      Parameters:
      name - name of the attribute
      converter - converter