Interface RealmModel

    • Method Detail

      • setName

        void setName​(String name)
      • getDisplayName

        String getDisplayName()
      • setDisplayName

        void setDisplayName​(String displayName)
      • getDisplayNameHtml

        String getDisplayNameHtml()
      • setDisplayNameHtml

        void setDisplayNameHtml​(String displayNameHtml)
      • isEnabled

        boolean isEnabled()
      • setEnabled

        void setEnabled​(boolean enabled)
      • setSslRequired

        void setSslRequired​(SslRequired sslRequired)
      • isRegistrationAllowed

        boolean isRegistrationAllowed()
      • setRegistrationAllowed

        void setRegistrationAllowed​(boolean registrationAllowed)
      • isRegistrationEmailAsUsername

        boolean isRegistrationEmailAsUsername()
      • setRegistrationEmailAsUsername

        void setRegistrationEmailAsUsername​(boolean registrationEmailAsUsername)
      • isRememberMe

        boolean isRememberMe()
      • setRememberMe

        void setRememberMe​(boolean rememberMe)
      • isEditUsernameAllowed

        boolean isEditUsernameAllowed()
      • setEditUsernameAllowed

        void setEditUsernameAllowed​(boolean editUsernameAllowed)
      • isUserManagedAccessAllowed

        boolean isUserManagedAccessAllowed()
      • setUserManagedAccessAllowed

        void setUserManagedAccessAllowed​(boolean userManagedAccessAllowed)
      • setAttribute

        void setAttribute​(String name,
                          String value)
      • setAttribute

        default void setAttribute​(String name,
                                  Boolean value)
      • setAttribute

        default void setAttribute​(String name,
                                  Integer value)
      • setAttribute

        default void setAttribute​(String name,
                                  Long value)
      • removeAttribute

        void removeAttribute​(String name)
      • getAttribute

        default Long getAttribute​(String name,
                                  Long defaultValue)
      • isBruteForceProtected

        boolean isBruteForceProtected()
      • setBruteForceProtected

        void setBruteForceProtected​(boolean value)
      • isPermanentLockout

        boolean isPermanentLockout()
      • setPermanentLockout

        void setPermanentLockout​(boolean val)
      • getMaxFailureWaitSeconds

        int getMaxFailureWaitSeconds()
      • setMaxFailureWaitSeconds

        void setMaxFailureWaitSeconds​(int val)
      • getWaitIncrementSeconds

        int getWaitIncrementSeconds()
      • setWaitIncrementSeconds

        void setWaitIncrementSeconds​(int val)
      • getMinimumQuickLoginWaitSeconds

        int getMinimumQuickLoginWaitSeconds()
      • setMinimumQuickLoginWaitSeconds

        void setMinimumQuickLoginWaitSeconds​(int val)
      • getQuickLoginCheckMilliSeconds

        long getQuickLoginCheckMilliSeconds()
      • setQuickLoginCheckMilliSeconds

        void setQuickLoginCheckMilliSeconds​(long val)
      • getMaxDeltaTimeSeconds

        int getMaxDeltaTimeSeconds()
      • setMaxDeltaTimeSeconds

        void setMaxDeltaTimeSeconds​(int val)
      • getFailureFactor

        int getFailureFactor()
      • setFailureFactor

        void setFailureFactor​(int failureFactor)
      • isVerifyEmail

        boolean isVerifyEmail()
      • setVerifyEmail

        void setVerifyEmail​(boolean verifyEmail)
      • isLoginWithEmailAllowed

        boolean isLoginWithEmailAllowed()
      • setLoginWithEmailAllowed

        void setLoginWithEmailAllowed​(boolean loginWithEmailAllowed)
      • isDuplicateEmailsAllowed

        boolean isDuplicateEmailsAllowed()
      • setDuplicateEmailsAllowed

        void setDuplicateEmailsAllowed​(boolean duplicateEmailsAllowed)
      • isResetPasswordAllowed

        boolean isResetPasswordAllowed()
      • setResetPasswordAllowed

        void setResetPasswordAllowed​(boolean resetPasswordAllowed)
      • getDefaultSignatureAlgorithm

        String getDefaultSignatureAlgorithm()
      • setDefaultSignatureAlgorithm

        void setDefaultSignatureAlgorithm​(String defaultSignatureAlgorithm)
      • isRevokeRefreshToken

        boolean isRevokeRefreshToken()
      • setRevokeRefreshToken

        void setRevokeRefreshToken​(boolean revokeRefreshToken)
      • getRefreshTokenMaxReuse

        int getRefreshTokenMaxReuse()
      • setRefreshTokenMaxReuse

        void setRefreshTokenMaxReuse​(int revokeRefreshTokenCount)
      • getSsoSessionIdleTimeout

        int getSsoSessionIdleTimeout()
      • setSsoSessionIdleTimeout

        void setSsoSessionIdleTimeout​(int seconds)
      • getSsoSessionMaxLifespan

        int getSsoSessionMaxLifespan()
      • setSsoSessionMaxLifespan

        void setSsoSessionMaxLifespan​(int seconds)
      • getSsoSessionIdleTimeoutRememberMe

        int getSsoSessionIdleTimeoutRememberMe()
      • setSsoSessionIdleTimeoutRememberMe

        void setSsoSessionIdleTimeoutRememberMe​(int seconds)
      • getSsoSessionMaxLifespanRememberMe

        int getSsoSessionMaxLifespanRememberMe()
      • setSsoSessionMaxLifespanRememberMe

        void setSsoSessionMaxLifespanRememberMe​(int seconds)
      • getOfflineSessionIdleTimeout

        int getOfflineSessionIdleTimeout()
      • setOfflineSessionIdleTimeout

        void setOfflineSessionIdleTimeout​(int seconds)
      • getAccessTokenLifespan

        int getAccessTokenLifespan()
      • isOfflineSessionMaxLifespanEnabled

        boolean isOfflineSessionMaxLifespanEnabled()
      • setOfflineSessionMaxLifespanEnabled

        void setOfflineSessionMaxLifespanEnabled​(boolean offlineSessionMaxLifespanEnabled)
      • getOfflineSessionMaxLifespan

        int getOfflineSessionMaxLifespan()
      • setOfflineSessionMaxLifespan

        void setOfflineSessionMaxLifespan​(int seconds)
      • getClientSessionIdleTimeout

        int getClientSessionIdleTimeout()
      • setClientSessionIdleTimeout

        void setClientSessionIdleTimeout​(int seconds)
      • getClientSessionMaxLifespan

        int getClientSessionMaxLifespan()
      • setClientSessionMaxLifespan

        void setClientSessionMaxLifespan​(int seconds)
      • getClientOfflineSessionIdleTimeout

        int getClientOfflineSessionIdleTimeout()
      • setClientOfflineSessionIdleTimeout

        void setClientOfflineSessionIdleTimeout​(int seconds)
      • getClientOfflineSessionMaxLifespan

        int getClientOfflineSessionMaxLifespan()
      • setClientOfflineSessionMaxLifespan

        void setClientOfflineSessionMaxLifespan​(int seconds)
      • setAccessTokenLifespan

        void setAccessTokenLifespan​(int seconds)
      • getAccessTokenLifespanForImplicitFlow

        int getAccessTokenLifespanForImplicitFlow()
      • setAccessTokenLifespanForImplicitFlow

        void setAccessTokenLifespanForImplicitFlow​(int seconds)
      • getAccessCodeLifespan

        int getAccessCodeLifespan()
      • setAccessCodeLifespan

        void setAccessCodeLifespan​(int seconds)
      • getAccessCodeLifespanUserAction

        int getAccessCodeLifespanUserAction()
      • setAccessCodeLifespanUserAction

        void setAccessCodeLifespanUserAction​(int seconds)
      • getUserActionTokenLifespans

        Map<String,​Integer> getUserActionTokenLifespans()
        This method will return a map with all the lifespans available or an empty map, but never null.
        Returns:
        map with user action token lifespans
      • getAccessCodeLifespanLogin

        int getAccessCodeLifespanLogin()
      • setAccessCodeLifespanLogin

        void setAccessCodeLifespanLogin​(int seconds)
      • getActionTokenGeneratedByAdminLifespan

        int getActionTokenGeneratedByAdminLifespan()
      • setActionTokenGeneratedByAdminLifespan

        void setActionTokenGeneratedByAdminLifespan​(int seconds)
      • getActionTokenGeneratedByUserLifespan

        int getActionTokenGeneratedByUserLifespan()
      • setActionTokenGeneratedByUserLifespan

        void setActionTokenGeneratedByUserLifespan​(int seconds)
      • getActionTokenGeneratedByUserLifespan

        int getActionTokenGeneratedByUserLifespan​(String actionTokenType)
      • setActionTokenGeneratedByUserLifespan

        void setActionTokenGeneratedByUserLifespan​(String actionTokenType,
                                                   Integer seconds)
      • addRequiredCredential

        void addRequiredCredential​(String cred)
      • setPasswordPolicy

        void setPasswordPolicy​(PasswordPolicy policy)
      • setOTPPolicy

        void setOTPPolicy​(OTPPolicy policy)
      • getWebAuthnPolicy

        WebAuthnPolicy getWebAuthnPolicy()
        Returns:
        WebAuthn policy for 2-factor authentication
      • setWebAuthnPolicy

        void setWebAuthnPolicy​(WebAuthnPolicy policy)
        Set WebAuthn policy for 2-factor authentication
        Parameters:
        policy -
      • getWebAuthnPolicyPasswordless

        WebAuthnPolicy getWebAuthnPolicyPasswordless()
        Returns:
        WebAuthn passwordless policy below. This is temporary and will be removed later.
      • setWebAuthnPolicyPasswordless

        void setWebAuthnPolicyPasswordless​(WebAuthnPolicy policy)
        Set WebAuthn passwordless policy below. This is temporary and will be removed later.
        Parameters:
        policy -
      • getDefaultGroupsStream

        Stream<GroupModel> getDefaultGroupsStream()
        Returns default groups as a stream.
        Returns:
        Stream of GroupModel. Never returns null.
      • addDefaultGroup

        void addDefaultGroup​(GroupModel group)
      • removeDefaultGroup

        void removeDefaultGroup​(GroupModel group)
      • getClientsStream

        Stream<ClientModel> getClientsStream​(Integer firstResult,
                                             Integer maxResults)
        Returns clients as a stream.
        Parameters:
        firstResult - Integer Index of the first desired client. Ignored if negative or null.
        maxResults - Integer Maximum number of returned clients. Ignored if negative or null.
        Returns:
        Stream of ClientModel. Never returns null.
      • getClientsCount

        Long getClientsCount()
      • getAlwaysDisplayInConsoleClientsStream

        Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream()
        Returns clients which are always displayed in the admin console as a stream.
        Returns:
        Stream of ClientModel. Never returns null.
      • removeClient

        boolean removeClient​(String id)
      • searchClientByClientIdStream

        Stream<ClientModel> searchClientByClientIdStream​(String clientId,
                                                         Integer firstResult,
                                                         Integer maxResults)
        Search for clients by provided client's id.
        Parameters:
        clientId - String Id of the client.
        firstResult - Index of the first desired client. Ignored if negative or null.
        maxResults - Maximum number of returned clients. Ignored if negative or null.
        Returns:
        Stream of ClientModel. Never returns null.
      • updateRequiredCredentials

        void updateRequiredCredentials​(Set<String> creds)
      • getBrowserSecurityHeaders

        Map<String,​String> getBrowserSecurityHeaders()
      • setBrowserSecurityHeaders

        void setBrowserSecurityHeaders​(Map<String,​String> headers)
      • removeIdentityProviderByAlias

        void removeIdentityProviderByAlias​(String alias)
      • getIdentityProviderMappersByAliasStream

        Stream<IdentityProviderMapperModel> getIdentityProviderMappersByAliasStream​(String brokerAlias)
        Returns identity provider mappers by the provided alias as a stream.
        Parameters:
        brokerAlias - String Broker's alias to filter results.
        Returns:
        Stream of IdentityProviderMapperModel Never returns null.
      • addComponentModel

        ComponentModel addComponentModel​(ComponentModel model)
        Adds component model. Will call onCreate() method of ComponentFactory
        Parameters:
        model -
        Returns:
      • importComponentModel

        ComponentModel importComponentModel​(ComponentModel model)
        Adds component model. Will NOT call onCreate() method of ComponentFactory
        Parameters:
        model -
        Returns:
      • updateComponent

        void updateComponent​(ComponentModel component)
        Updates component model. Will call onUpdate() method of ComponentFactory
        Parameters:
        component - to be updated
      • removeComponent

        void removeComponent​(ComponentModel component)
        Removes given component. Will call preRemove() method of ComponentFactory. Also calls this.removeComponents(component.getId()).
        Parameters:
        component - to be removed
      • removeComponents

        void removeComponents​(String parentId)
        Removes all components with given parentId
        Parameters:
        parentId - String id of parent
      • getComponentsStream

        Stream<ComponentModel> getComponentsStream​(String parentId,
                                                   String providerType)
        Returns stream of ComponentModels for specific parentId and providerType.
        Parameters:
        parentId - String id of parent
        providerType - String type of provider
        Returns:
        Stream of ComponentModel. Never returns null.
      • getComponentsStream

        Stream<ComponentModel> getComponentsStream​(String parentId)
        Returns stream of ComponentModels for specific parentId.
        Parameters:
        parentId - String id of parent
        Returns:
        Stream of ComponentModel. Never returns null.
      • getStorageProviders

        default Stream<ComponentModel> getStorageProviders​(Class<? extends Provider> storageProviderClass)
        Returns stream of ComponentModels that represent StorageProviders for class storageProviderClass in this realm.
        Parameters:
        storageProviderClass - Class<? extends Provider>
        Returns:
        Stream of ComponentModel. Never returns null.
      • getLoginTheme

        String getLoginTheme()
      • setLoginTheme

        void setLoginTheme​(String name)
      • getAccountTheme

        String getAccountTheme()
      • setAccountTheme

        void setAccountTheme​(String name)
      • getAdminTheme

        String getAdminTheme()
      • setAdminTheme

        void setAdminTheme​(String name)
      • getEmailTheme

        String getEmailTheme()
      • setEmailTheme

        void setEmailTheme​(String name)
      • getNotBefore

        int getNotBefore()
        Time in seconds since epoc
        Returns:
      • setNotBefore

        void setNotBefore​(int notBefore)
      • isEventsEnabled

        boolean isEventsEnabled()
      • setEventsEnabled

        void setEventsEnabled​(boolean enabled)
      • getEventsExpiration

        long getEventsExpiration()
      • setEventsExpiration

        void setEventsExpiration​(long expiration)
      • getEventsListenersStream

        Stream<String> getEventsListenersStream()
        Returns events listeners as a stream.
        Returns:
        Stream of String. Never returns null.
      • setEventsListeners

        void setEventsListeners​(Set<String> listeners)
      • getEnabledEventTypesStream

        Stream<String> getEnabledEventTypesStream()
        Returns enabled event types as a stream.
        Returns:
        Stream of String. Never returns null.
      • setEnabledEventTypes

        void setEnabledEventTypes​(Set<String> enabledEventTypes)
      • isAdminEventsEnabled

        boolean isAdminEventsEnabled()
      • setAdminEventsEnabled

        void setAdminEventsEnabled​(boolean enabled)
      • isAdminEventsDetailsEnabled

        boolean isAdminEventsDetailsEnabled()
      • setAdminEventsDetailsEnabled

        void setAdminEventsDetailsEnabled​(boolean enabled)
      • getMasterAdminClient

        ClientModel getMasterAdminClient()
      • setMasterAdminClient

        void setMasterAdminClient​(ClientModel client)
      • getDefaultRole

        RoleModel getDefaultRole()
        Returns default realm role. All both realm and client default roles are assigned as composite of this role.
        Returns:
        Default role of this realm
      • setDefaultRole

        void setDefaultRole​(RoleModel role)
        Sets default role for this realm
        Parameters:
        role - to be set
      • isIdentityFederationEnabled

        boolean isIdentityFederationEnabled()
      • isInternationalizationEnabled

        boolean isInternationalizationEnabled()
      • setInternationalizationEnabled

        void setInternationalizationEnabled​(boolean enabled)
      • getSupportedLocalesStream

        Stream<String> getSupportedLocalesStream()
        Returns supported locales as a stream.
        Returns:
        Stream of String. Never returns null.
      • setSupportedLocales

        void setSupportedLocales​(Set<String> locales)
      • getDefaultLocale

        String getDefaultLocale()
      • setDefaultLocale

        void setDefaultLocale​(String locale)
      • getGroupsStream

        Stream<GroupModel> getGroupsStream()
        Returns groups as a stream.
        Returns:
        Stream of GroupModel. Never returns null.
      • getGroupsCount

        Long getGroupsCount​(Boolean onlyTopGroups)
      • getGroupsCountByNameContaining

        Long getGroupsCountByNameContaining​(String search)
      • getTopLevelGroupsStream

        Stream<GroupModel> getTopLevelGroupsStream()
        Returns top level groups as a stream.
        Returns:
        Stream of GroupModel. Never returns null.
      • getTopLevelGroupsStream

        Stream<GroupModel> getTopLevelGroupsStream​(Integer first,
                                                   Integer max)
        Returns top level groups as a stream.
        Parameters:
        first - Integer Index of the first desired group. Ignored if negative or null.
        max - Integer Maximum number of returned groups. Ignored if negative or null.
        Returns:
        Stream of GroupModel. Never returns null.
      • searchForGroupByNameStream

        Stream<GroupModel> searchForGroupByNameStream​(String search,
                                                      Integer first,
                                                      Integer max)
        Searches for groups by provided name. Results that match the given filter are returned as a stream.
        Parameters:
        search - String Name of a group to be used as a filter.
        first - Integer Index of the first desired group. Ignored if negative or null.
        max - Integer Maximum number of returned groups. Ignored if negative or null.
        Returns:
        Stream of GroupModel. Never returns null.
      • removeGroup

        boolean removeGroup​(GroupModel group)
      • addClientScope

        ClientScopeModel addClientScope​(String name)
        Creates new client scope with the given name. Internal ID is created automatically. If given name contains spaces, those are replaced by underscores.
        Parameters:
        name - String name of the client scope.
        Returns:
        Model of the created client scope.
        Throws:
        ModelDuplicateException - if client scope with same id or name already exists.
      • addClientScope

        ClientScopeModel addClientScope​(String id,
                                        String name)
        Creates new client scope with the given internal ID and name. If given name contains spaces, those are replaced by underscores.
        Parameters:
        id - String id of the client scope.
        name - String name of the client scope.
        Returns:
        Model of the created client scope.
        Throws:
        ModelDuplicateException - if client scope with same id or name already exists.
      • removeClientScope

        boolean removeClientScope​(String id)
        Removes client scope with given id from this realm.
        Parameters:
        id - of the client scope
        Returns:
        true if the realm contained the scope and the removal was successful, false otherwise
      • getClientScopeById

        ClientScopeModel getClientScopeById​(String id)
        Parameters:
        id - of the client scope
        Returns:
        Client scope with the given id, or null when the scope does not exist.
      • addDefaultClientScope

        void addDefaultClientScope​(ClientScopeModel clientScope,
                                   boolean defaultScope)
        Adds given client scope among default/optional client scopes of this realm. The scope will be assigned to each new client.
        Parameters:
        clientScope - to be added
        defaultScope - if true the scope will be added among default client scopes, if false it will be added among optional client scopes
      • removeDefaultClientScope

        void removeDefaultClientScope​(ClientScopeModel clientScope)
        Removes given client scope from default or optional client scopes of this realm.
        Parameters:
        clientScope - to be removed
      • createOrUpdateRealmLocalizationTexts

        void createOrUpdateRealmLocalizationTexts​(String locale,
                                                  Map<String,​String> localizationTexts)
        Creates or updates the realm-specific localization texts for the given locale. This method will not delete any text. It updates texts, which are already stored or create new ones if the key does not exist yet.
      • removeRealmLocalizationTexts

        boolean removeRealmLocalizationTexts​(String locale)
      • getRealmLocalizationTextsByLocale

        Map<String,​String> getRealmLocalizationTextsByLocale​(String locale)
      • getDefaultClientScopesStream

        Stream<ClientScopeModel> getDefaultClientScopesStream​(boolean defaultScope)
        Returns default client scopes of this realm either default ones or optional ones.
        Parameters:
        defaultScope - if true default client scopes are returned, if false optional client scopes are returned.
        Returns:
        Stream of ClientScopeModel. Never returns null.
      • addToDefaultRoles

        default void addToDefaultRoles​(RoleModel role)
        Adds a role as a composite to default role of this realm.
        Parameters:
        role - to be added
      • createClientInitialAccessModel

        ClientInitialAccessModel createClientInitialAccessModel​(int expiration,
                                                                int count)
      • removeClientInitialAccessModel

        void removeClientInitialAccessModel​(String id)