Package org.keycloak.models
Interface RealmModel
-
- All Superinterfaces:
RoleContainerModel
- All Known Subinterfaces:
CachedRealmModel
,LegacyRealmModel
- All Known Implementing Classes:
AbstractRealmModel
,MapRealmAdapter
,RealmAdapter
,RealmAdapter
public interface RealmModel extends RoleContainerModel
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RealmModel.IdentityProviderRemovedEvent
static interface
RealmModel.IdentityProviderUpdatedEvent
static interface
RealmModel.RealmCreationEvent
static interface
RealmModel.RealmPostCreateEvent
static interface
RealmModel.RealmRemovedEvent
static class
RealmModel.SearchableFields
-
Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModel
RoleContainerModel.RoleRemovedEvent
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<RealmModel>
COMPARE_BY_NAME
-
Method Summary
-
Methods inherited from interface org.keycloak.models.RoleContainerModel
addDefaultRole, addRole, addRole, getDefaultRoles, getDefaultRolesStream, getRole, getRolesStream, getRolesStream, removeDefaultRoles, removeRole, searchForRolesStream, updateDefaultRoles
-
-
-
-
Field Detail
-
COMPARE_BY_NAME
static final Comparator<RealmModel> COMPARE_BY_NAME
-
-
Method Detail
-
getId
String getId()
- Specified by:
getId
in interfaceRoleContainerModel
-
getName
String getName()
-
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)
-
getSslRequired
SslRequired getSslRequired()
-
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)
-
removeAttribute
void removeAttribute(String name)
-
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)
-
getOAuth2DeviceConfig
OAuth2DeviceConfig getOAuth2DeviceConfig()
-
getCibaPolicy
CibaConfig getCibaPolicy()
-
getParPolicy
ParConfig getParPolicy()
-
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)
-
getRequiredCredentialsStream
Stream<RequiredCredentialModel> getRequiredCredentialsStream()
Returns required credentials as a stream.- Returns:
- Stream of
RequiredCredentialModel
. Never returnsnull
.
-
addRequiredCredential
void addRequiredCredential(String cred)
-
getPasswordPolicy
PasswordPolicy getPasswordPolicy()
-
setPasswordPolicy
void setPasswordPolicy(PasswordPolicy policy)
-
getOTPPolicy
OTPPolicy getOTPPolicy()
-
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 returnsnull
.
-
addDefaultGroup
void addDefaultGroup(GroupModel group)
-
removeDefaultGroup
void removeDefaultGroup(GroupModel group)
-
getClientsStream
Stream<ClientModel> getClientsStream()
Returns clients as a stream.- Returns:
- Stream of
ClientModel
. Never returnsnull
.
-
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 ornull
.maxResults
-Integer
Maximum number of returned clients. Ignored if negative ornull
.- Returns:
- Stream of
ClientModel
. Never returnsnull
.
-
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 returnsnull
.
-
addClient
ClientModel addClient(String name)
-
addClient
ClientModel addClient(String id, String clientId)
-
removeClient
boolean removeClient(String id)
-
getClientById
ClientModel getClientById(String id)
-
getClientByClientId
ClientModel getClientByClientId(String clientId)
-
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 ornull
.maxResults
- Maximum number of returned clients. Ignored if negative ornull
.- Returns:
- Stream of
ClientModel
. Never returnsnull
.
-
searchClientByAttributes
Stream<ClientModel> searchClientByAttributes(Map<String,String> attributes, Integer firstResult, Integer maxResults)
-
getBrowserFlow
AuthenticationFlowModel getBrowserFlow()
-
setBrowserFlow
void setBrowserFlow(AuthenticationFlowModel flow)
-
getRegistrationFlow
AuthenticationFlowModel getRegistrationFlow()
-
setRegistrationFlow
void setRegistrationFlow(AuthenticationFlowModel flow)
-
getDirectGrantFlow
AuthenticationFlowModel getDirectGrantFlow()
-
setDirectGrantFlow
void setDirectGrantFlow(AuthenticationFlowModel flow)
-
getResetCredentialsFlow
AuthenticationFlowModel getResetCredentialsFlow()
-
setResetCredentialsFlow
void setResetCredentialsFlow(AuthenticationFlowModel flow)
-
getClientAuthenticationFlow
AuthenticationFlowModel getClientAuthenticationFlow()
-
setClientAuthenticationFlow
void setClientAuthenticationFlow(AuthenticationFlowModel flow)
-
getDockerAuthenticationFlow
AuthenticationFlowModel getDockerAuthenticationFlow()
-
setDockerAuthenticationFlow
void setDockerAuthenticationFlow(AuthenticationFlowModel flow)
-
getAuthenticationFlowsStream
Stream<AuthenticationFlowModel> getAuthenticationFlowsStream()
Returns authentications flows as a stream.- Returns:
- Stream of
AuthenticationFlowModel
. Never returnsnull
.
-
getFlowByAlias
AuthenticationFlowModel getFlowByAlias(String alias)
-
addAuthenticationFlow
AuthenticationFlowModel addAuthenticationFlow(AuthenticationFlowModel model)
-
getAuthenticationFlowById
AuthenticationFlowModel getAuthenticationFlowById(String id)
-
removeAuthenticationFlow
void removeAuthenticationFlow(AuthenticationFlowModel model)
-
updateAuthenticationFlow
void updateAuthenticationFlow(AuthenticationFlowModel model)
-
getAuthenticationExecutionsStream
Stream<AuthenticationExecutionModel> getAuthenticationExecutionsStream(String flowId)
Returns sorted (according to priority)AuthenticationExecutionModel
as a stream. It should be used with forEachOrdered if the ordering is required.- Parameters:
flowId
-String
Id of the flow.- Returns:
- Sorted stream of
AuthenticationExecutionModel
. Never returnsnull
.
-
getAuthenticationExecutionById
AuthenticationExecutionModel getAuthenticationExecutionById(String id)
-
getAuthenticationExecutionByFlowId
AuthenticationExecutionModel getAuthenticationExecutionByFlowId(String flowId)
-
addAuthenticatorExecution
AuthenticationExecutionModel addAuthenticatorExecution(AuthenticationExecutionModel model)
-
updateAuthenticatorExecution
void updateAuthenticatorExecution(AuthenticationExecutionModel model)
-
removeAuthenticatorExecution
void removeAuthenticatorExecution(AuthenticationExecutionModel model)
-
getAuthenticatorConfigsStream
Stream<AuthenticatorConfigModel> getAuthenticatorConfigsStream()
Returns authentication configs as a stream.- Returns:
- Stream of
AuthenticatorConfigModel
. Never returnsnull
.
-
addAuthenticatorConfig
AuthenticatorConfigModel addAuthenticatorConfig(AuthenticatorConfigModel model)
-
updateAuthenticatorConfig
void updateAuthenticatorConfig(AuthenticatorConfigModel model)
-
removeAuthenticatorConfig
void removeAuthenticatorConfig(AuthenticatorConfigModel model)
-
getAuthenticatorConfigById
AuthenticatorConfigModel getAuthenticatorConfigById(String id)
-
getAuthenticatorConfigByAlias
AuthenticatorConfigModel getAuthenticatorConfigByAlias(String alias)
-
getRequiredActionProvidersStream
Stream<RequiredActionProviderModel> getRequiredActionProvidersStream()
Returns sortedRequiredActionProviderModel
as a stream. It should be used with forEachOrdered if the ordering is required.- Returns:
- Sorted stream of
RequiredActionProviderModel
. Never returnsnull
.
-
addRequiredActionProvider
RequiredActionProviderModel addRequiredActionProvider(RequiredActionProviderModel model)
-
updateRequiredActionProvider
void updateRequiredActionProvider(RequiredActionProviderModel model)
-
removeRequiredActionProvider
void removeRequiredActionProvider(RequiredActionProviderModel model)
-
getRequiredActionProviderById
RequiredActionProviderModel getRequiredActionProviderById(String id)
-
getRequiredActionProviderByAlias
RequiredActionProviderModel getRequiredActionProviderByAlias(String alias)
-
getIdentityProvidersStream
Stream<IdentityProviderModel> getIdentityProvidersStream()
Returns identity providers as a stream.- Returns:
- Stream of
IdentityProviderModel
. Never returnsnull
.
-
getIdentityProviderByAlias
IdentityProviderModel getIdentityProviderByAlias(String alias)
-
addIdentityProvider
void addIdentityProvider(IdentityProviderModel identityProvider)
-
removeIdentityProviderByAlias
void removeIdentityProviderByAlias(String alias)
-
updateIdentityProvider
void updateIdentityProvider(IdentityProviderModel identityProvider)
-
getIdentityProviderMappersStream
Stream<IdentityProviderMapperModel> getIdentityProviderMappersStream()
Returns identity provider mappers as a stream.- Returns:
- Stream of
IdentityProviderMapperModel
. Never returnsnull
.
-
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 returnsnull
.
-
addIdentityProviderMapper
IdentityProviderMapperModel addIdentityProviderMapper(IdentityProviderMapperModel model)
-
removeIdentityProviderMapper
void removeIdentityProviderMapper(IdentityProviderMapperModel mapping)
-
updateIdentityProviderMapper
void updateIdentityProviderMapper(IdentityProviderMapperModel mapping)
-
getIdentityProviderMapperById
IdentityProviderMapperModel getIdentityProviderMapperById(String id)
-
getIdentityProviderMapperByName
IdentityProviderMapperModel getIdentityProviderMapperByName(String brokerAlias, String name)
-
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 callsthis.removeComponents(component.getId())
.- Parameters:
component
- to be removed
-
removeComponents
void removeComponents(String parentId)
Removes all components with givenparentId
- 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 parentproviderType
-String
type of provider- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
getComponentsStream
Stream<ComponentModel> getComponentsStream(String parentId)
Returns stream of ComponentModels for specific parentId.- Parameters:
parentId
-String
id of parent- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
getComponentsStream
Stream<ComponentModel> getComponentsStream()
Returns stream of component models.- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
getComponent
ComponentModel getComponent(String id)
-
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 returnsnull
.
-
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 returnsnull
.
-
getEnabledEventTypesStream
Stream<String> getEnabledEventTypesStream()
Returns enabled event types as a stream.- Returns:
- Stream of
String
. Never returnsnull
.
-
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 returnsnull
.
-
getDefaultLocale
String getDefaultLocale()
-
setDefaultLocale
void setDefaultLocale(String locale)
-
createGroup
default GroupModel createGroup(String name)
-
createGroup
default GroupModel createGroup(String id, String name)
-
createGroup
default GroupModel createGroup(String name, GroupModel toParent)
-
createGroup
GroupModel createGroup(String id, String name, GroupModel toParent)
-
getGroupById
GroupModel getGroupById(String id)
-
getGroupsStream
Stream<GroupModel> getGroupsStream()
Returns groups as a stream.- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
getTopLevelGroupsStream
Stream<GroupModel> getTopLevelGroupsStream()
Returns top level groups as a stream.- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
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 ornull
.max
-Integer
Maximum number of returned groups. Ignored if negative ornull
.- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
searchForGroupByNameStream
@Deprecated Stream<GroupModel> searchForGroupByNameStream(String search, Integer first, Integer max)
Deprecated.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 ornull
.max
-Integer
Maximum number of returned groups. Ignored if negative ornull
.- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
removeGroup
boolean removeGroup(GroupModel group)
-
moveGroup
void moveGroup(GroupModel group, GroupModel toParent)
-
getClientScopesStream
Stream<ClientScopeModel> getClientScopesStream()
Returns all client scopes of this realm as a stream.- Returns:
- Stream of
ClientScopeModel
. Never returnsnull
.
-
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 givenid
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
, ornull
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 addeddefaultScope
- iftrue
the scope will be added among default client scopes, iffalse
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
- iftrue
default client scopes are returned, iffalse
optional client scopes are returned.- Returns:
- Stream of
ClientScopeModel
. Never returnsnull
.
-
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)
-
getClientInitialAccessModel
ClientInitialAccessModel getClientInitialAccessModel(String id)
-
removeClientInitialAccessModel
void removeClientInitialAccessModel(String id)
-
getClientInitialAccesses
Stream<ClientInitialAccessModel> getClientInitialAccesses()
-
decreaseRemainingCount
void decreaseRemainingCount(ClientInitialAccessModel clientInitialAccess)
-
-