Interface UserProfileProvider

All Superinterfaces:
Provider
All Known Implementing Classes:
AbstractUserProfileProvider, DeclarativeUserProfileProvider

public interface UserProfileProvider extends Provider

The provider responsible for creating UserProfile instances.

Author:
Markus Till
See Also:
  • Method Details

    • create

      UserProfile create(UserProfileContext context, UserModel user)

      Creates a new UserProfile instance only for validation purposes to check whether its attributes are in conformance with the given context and profile configuration.

      Parameters:
      context - the context
      user - an existing user
      Returns:
      the user profile instance
    • create

      UserProfile create(UserProfileContext context, Map<String,?> attributes)

      Creates a new UserProfile instance for a given context and attributes for validation purposes.

      Instances created from this method are usually related to contexts where validation and updates are performed in different steps, or when creating new users based on the given attributes.

      Parameters:
      context - the context
      attributes - the attributes to associate with the instance returned from this method
      Returns:
      the user profile instance
    • create

      UserProfile create(UserProfileContext context, Map<String,?> attributes, UserModel user)

      Creates a new UserProfile instance for a given context and attributes for update purposes.

      Instances created from this method are going to run validations and updates based on the given user. This might be useful when updating an existing user.

      Parameters:
      context - the context
      attributes - the attributes to associate with the instance returned from this method
      user - the user to eventually update with the given attributes
      Returns:
      the user profile instance
    • getConfiguration

      String getConfiguration()
      Get current UserProfile configuration. JSON formatted file is expected, but depends on the implementation.
      Returns:
      current UserProfile configuration
      See Also:
    • setConfiguration

      void setConfiguration(String configuration)
      Set new UserProfile configuration. It is persisted inside of the provider.
      Parameters:
      configuration - to be set
      Throws:
      RuntimeException - if configuration is invalid (exact exception class depends on the implementation) or configuration can't be persisted.
      See Also:
    • isEnabled

      boolean isEnabled(RealmModel realm)
      Deprecated.
      should be removed once DeclarativeUserProfileProvider becomes the default.
      Returns whether the declarative provider is enabled to a realm
      Returns:
      true if the declarative provider is enabled. Otherwise, false.