Package org.keycloak.models.jpa
Class RealmAdapter
- java.lang.Object
-
- org.keycloak.models.jpa.RealmAdapter
-
- All Implemented Interfaces:
JpaModel<RealmEntity>
,LegacyRealmModel
,RealmModel
,RoleContainerModel
public class RealmAdapter extends Object implements LegacyRealmModel, JpaModel<RealmEntity>
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.RealmModel
RealmModel.IdentityProviderRemovedEvent, RealmModel.IdentityProviderUpdatedEvent, RealmModel.RealmCreationEvent, RealmModel.RealmPostCreateEvent, RealmModel.RealmRemovedEvent, RealmModel.SearchableFields
-
Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModel
RoleContainerModel.RoleRemovedEvent
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_PROVIDER_EXISTS_DISABLED
This just exists for testing purposesprotected javax.persistence.EntityManager
em
protected static org.jboss.logging.Logger
logger
protected RealmEntity
realm
protected KeycloakSession
session
-
Fields inherited from interface org.keycloak.models.RealmModel
COMPARE_BY_NAME
-
-
Constructor Summary
Constructors Constructor Description RealmAdapter(KeycloakSession session, javax.persistence.EntityManager em, RealmEntity realm)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.LegacyRealmModel
getClientStorageProviders, getClientStorageProvidersStream, getRoleStorageProviders, getRoleStorageProvidersStream, getUserStorageProviders, getUserStorageProvidersStream
-
Methods inherited from interface org.keycloak.models.RealmModel
addToDefaultRoles, createGroup, createGroup, createGroup, getAttribute, getAttribute, getAttribute, getStorageProviders, setAttribute, setAttribute, setAttribute
-
Methods inherited from interface org.keycloak.models.RoleContainerModel
getDefaultRoles, updateDefaultRoles
-
-
-
-
Field Detail
-
logger
protected static final org.jboss.logging.Logger logger
-
realm
protected RealmEntity realm
-
em
protected javax.persistence.EntityManager em
-
session
protected KeycloakSession session
-
COMPONENT_PROVIDER_EXISTS_DISABLED
public static final String COMPONENT_PROVIDER_EXISTS_DISABLED
This just exists for testing purposes- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RealmAdapter
public RealmAdapter(KeycloakSession session, javax.persistence.EntityManager em, RealmEntity realm)
-
-
Method Detail
-
getClientsCount
public Long getClientsCount()
- Specified by:
getClientsCount
in interfaceRealmModel
-
getEntity
public RealmEntity getEntity()
- Specified by:
getEntity
in interfaceJpaModel<RealmEntity>
-
getId
public String getId()
- Specified by:
getId
in interfaceRealmModel
- Specified by:
getId
in interfaceRoleContainerModel
-
getName
public String getName()
- Specified by:
getName
in interfaceRealmModel
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceRealmModel
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceRealmModel
-
setDisplayName
public void setDisplayName(String displayName)
- Specified by:
setDisplayName
in interfaceRealmModel
-
getDisplayNameHtml
public String getDisplayNameHtml()
- Specified by:
getDisplayNameHtml
in interfaceRealmModel
-
setDisplayNameHtml
public void setDisplayNameHtml(String displayNameHtml)
- Specified by:
setDisplayNameHtml
in interfaceRealmModel
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceRealmModel
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interfaceRealmModel
-
getSslRequired
public SslRequired getSslRequired()
- Specified by:
getSslRequired
in interfaceRealmModel
-
setSslRequired
public void setSslRequired(SslRequired sslRequired)
- Specified by:
setSslRequired
in interfaceRealmModel
-
isUserManagedAccessAllowed
public boolean isUserManagedAccessAllowed()
- Specified by:
isUserManagedAccessAllowed
in interfaceRealmModel
-
setUserManagedAccessAllowed
public void setUserManagedAccessAllowed(boolean userManagedAccessAllowed)
- Specified by:
setUserManagedAccessAllowed
in interfaceRealmModel
-
isRegistrationAllowed
public boolean isRegistrationAllowed()
- Specified by:
isRegistrationAllowed
in interfaceRealmModel
-
setRegistrationAllowed
public void setRegistrationAllowed(boolean registrationAllowed)
- Specified by:
setRegistrationAllowed
in interfaceRealmModel
-
isRegistrationEmailAsUsername
public boolean isRegistrationEmailAsUsername()
- Specified by:
isRegistrationEmailAsUsername
in interfaceRealmModel
-
setRegistrationEmailAsUsername
public void setRegistrationEmailAsUsername(boolean registrationEmailAsUsername)
- Specified by:
setRegistrationEmailAsUsername
in interfaceRealmModel
-
isRememberMe
public boolean isRememberMe()
- Specified by:
isRememberMe
in interfaceRealmModel
-
setRememberMe
public void setRememberMe(boolean rememberMe)
- Specified by:
setRememberMe
in interfaceRealmModel
-
setAttribute
public void setAttribute(String name, String value)
- Specified by:
setAttribute
in interfaceRealmModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfaceRealmModel
-
getAttribute
public String getAttribute(String name)
- Specified by:
getAttribute
in interfaceRealmModel
-
getAttributes
public Map<String,String> getAttributes()
- Specified by:
getAttributes
in interfaceRealmModel
-
getDefaultSignatureAlgorithm
public String getDefaultSignatureAlgorithm()
- Specified by:
getDefaultSignatureAlgorithm
in interfaceRealmModel
-
setDefaultSignatureAlgorithm
public void setDefaultSignatureAlgorithm(String defaultSignatureAlgorithm)
- Specified by:
setDefaultSignatureAlgorithm
in interfaceRealmModel
-
isBruteForceProtected
public boolean isBruteForceProtected()
- Specified by:
isBruteForceProtected
in interfaceRealmModel
-
setBruteForceProtected
public void setBruteForceProtected(boolean value)
- Specified by:
setBruteForceProtected
in interfaceRealmModel
-
isPermanentLockout
public boolean isPermanentLockout()
- Specified by:
isPermanentLockout
in interfaceRealmModel
-
setPermanentLockout
public void setPermanentLockout(boolean val)
- Specified by:
setPermanentLockout
in interfaceRealmModel
-
getMaxFailureWaitSeconds
public int getMaxFailureWaitSeconds()
- Specified by:
getMaxFailureWaitSeconds
in interfaceRealmModel
-
setMaxFailureWaitSeconds
public void setMaxFailureWaitSeconds(int val)
- Specified by:
setMaxFailureWaitSeconds
in interfaceRealmModel
-
getWaitIncrementSeconds
public int getWaitIncrementSeconds()
- Specified by:
getWaitIncrementSeconds
in interfaceRealmModel
-
setWaitIncrementSeconds
public void setWaitIncrementSeconds(int val)
- Specified by:
setWaitIncrementSeconds
in interfaceRealmModel
-
getQuickLoginCheckMilliSeconds
public long getQuickLoginCheckMilliSeconds()
- Specified by:
getQuickLoginCheckMilliSeconds
in interfaceRealmModel
-
setQuickLoginCheckMilliSeconds
public void setQuickLoginCheckMilliSeconds(long val)
- Specified by:
setQuickLoginCheckMilliSeconds
in interfaceRealmModel
-
getMinimumQuickLoginWaitSeconds
public int getMinimumQuickLoginWaitSeconds()
- Specified by:
getMinimumQuickLoginWaitSeconds
in interfaceRealmModel
-
setMinimumQuickLoginWaitSeconds
public void setMinimumQuickLoginWaitSeconds(int val)
- Specified by:
setMinimumQuickLoginWaitSeconds
in interfaceRealmModel
-
getMaxDeltaTimeSeconds
public int getMaxDeltaTimeSeconds()
- Specified by:
getMaxDeltaTimeSeconds
in interfaceRealmModel
-
setMaxDeltaTimeSeconds
public void setMaxDeltaTimeSeconds(int val)
- Specified by:
setMaxDeltaTimeSeconds
in interfaceRealmModel
-
getFailureFactor
public int getFailureFactor()
- Specified by:
getFailureFactor
in interfaceRealmModel
-
setFailureFactor
public void setFailureFactor(int failureFactor)
- Specified by:
setFailureFactor
in interfaceRealmModel
-
isVerifyEmail
public boolean isVerifyEmail()
- Specified by:
isVerifyEmail
in interfaceRealmModel
-
setVerifyEmail
public void setVerifyEmail(boolean verifyEmail)
- Specified by:
setVerifyEmail
in interfaceRealmModel
-
isLoginWithEmailAllowed
public boolean isLoginWithEmailAllowed()
- Specified by:
isLoginWithEmailAllowed
in interfaceRealmModel
-
setLoginWithEmailAllowed
public void setLoginWithEmailAllowed(boolean loginWithEmailAllowed)
- Specified by:
setLoginWithEmailAllowed
in interfaceRealmModel
-
isDuplicateEmailsAllowed
public boolean isDuplicateEmailsAllowed()
- Specified by:
isDuplicateEmailsAllowed
in interfaceRealmModel
-
setDuplicateEmailsAllowed
public void setDuplicateEmailsAllowed(boolean duplicateEmailsAllowed)
- Specified by:
setDuplicateEmailsAllowed
in interfaceRealmModel
-
isResetPasswordAllowed
public boolean isResetPasswordAllowed()
- Specified by:
isResetPasswordAllowed
in interfaceRealmModel
-
setResetPasswordAllowed
public void setResetPasswordAllowed(boolean resetPasswordAllowed)
- Specified by:
setResetPasswordAllowed
in interfaceRealmModel
-
isEditUsernameAllowed
public boolean isEditUsernameAllowed()
- Specified by:
isEditUsernameAllowed
in interfaceRealmModel
-
setEditUsernameAllowed
public void setEditUsernameAllowed(boolean editUsernameAllowed)
- Specified by:
setEditUsernameAllowed
in interfaceRealmModel
-
getNotBefore
public int getNotBefore()
Description copied from interface:RealmModel
Time in seconds since epoc- Specified by:
getNotBefore
in interfaceRealmModel
- Returns:
-
setNotBefore
public void setNotBefore(int notBefore)
- Specified by:
setNotBefore
in interfaceRealmModel
-
isRevokeRefreshToken
public boolean isRevokeRefreshToken()
- Specified by:
isRevokeRefreshToken
in interfaceRealmModel
-
setRevokeRefreshToken
public void setRevokeRefreshToken(boolean revokeRefreshToken)
- Specified by:
setRevokeRefreshToken
in interfaceRealmModel
-
getRefreshTokenMaxReuse
public int getRefreshTokenMaxReuse()
- Specified by:
getRefreshTokenMaxReuse
in interfaceRealmModel
-
setRefreshTokenMaxReuse
public void setRefreshTokenMaxReuse(int revokeRefreshTokenReuseCount)
- Specified by:
setRefreshTokenMaxReuse
in interfaceRealmModel
-
getAccessTokenLifespan
public int getAccessTokenLifespan()
- Specified by:
getAccessTokenLifespan
in interfaceRealmModel
-
setAccessTokenLifespan
public void setAccessTokenLifespan(int tokenLifespan)
- Specified by:
setAccessTokenLifespan
in interfaceRealmModel
-
getAccessTokenLifespanForImplicitFlow
public int getAccessTokenLifespanForImplicitFlow()
- Specified by:
getAccessTokenLifespanForImplicitFlow
in interfaceRealmModel
-
setAccessTokenLifespanForImplicitFlow
public void setAccessTokenLifespanForImplicitFlow(int seconds)
- Specified by:
setAccessTokenLifespanForImplicitFlow
in interfaceRealmModel
-
getSsoSessionIdleTimeout
public int getSsoSessionIdleTimeout()
- Specified by:
getSsoSessionIdleTimeout
in interfaceRealmModel
-
setSsoSessionIdleTimeout
public void setSsoSessionIdleTimeout(int seconds)
- Specified by:
setSsoSessionIdleTimeout
in interfaceRealmModel
-
getSsoSessionMaxLifespan
public int getSsoSessionMaxLifespan()
- Specified by:
getSsoSessionMaxLifespan
in interfaceRealmModel
-
setSsoSessionMaxLifespan
public void setSsoSessionMaxLifespan(int seconds)
- Specified by:
setSsoSessionMaxLifespan
in interfaceRealmModel
-
getSsoSessionIdleTimeoutRememberMe
public int getSsoSessionIdleTimeoutRememberMe()
- Specified by:
getSsoSessionIdleTimeoutRememberMe
in interfaceRealmModel
-
setSsoSessionIdleTimeoutRememberMe
public void setSsoSessionIdleTimeoutRememberMe(int seconds)
- Specified by:
setSsoSessionIdleTimeoutRememberMe
in interfaceRealmModel
-
getSsoSessionMaxLifespanRememberMe
public int getSsoSessionMaxLifespanRememberMe()
- Specified by:
getSsoSessionMaxLifespanRememberMe
in interfaceRealmModel
-
setSsoSessionMaxLifespanRememberMe
public void setSsoSessionMaxLifespanRememberMe(int seconds)
- Specified by:
setSsoSessionMaxLifespanRememberMe
in interfaceRealmModel
-
getOfflineSessionIdleTimeout
public int getOfflineSessionIdleTimeout()
- Specified by:
getOfflineSessionIdleTimeout
in interfaceRealmModel
-
setOfflineSessionIdleTimeout
public void setOfflineSessionIdleTimeout(int seconds)
- Specified by:
setOfflineSessionIdleTimeout
in interfaceRealmModel
-
isOfflineSessionMaxLifespanEnabled
public boolean isOfflineSessionMaxLifespanEnabled()
- Specified by:
isOfflineSessionMaxLifespanEnabled
in interfaceRealmModel
-
setOfflineSessionMaxLifespanEnabled
public void setOfflineSessionMaxLifespanEnabled(boolean offlineSessionMaxLifespanEnabled)
- Specified by:
setOfflineSessionMaxLifespanEnabled
in interfaceRealmModel
-
getOfflineSessionMaxLifespan
public int getOfflineSessionMaxLifespan()
- Specified by:
getOfflineSessionMaxLifespan
in interfaceRealmModel
-
setOfflineSessionMaxLifespan
public void setOfflineSessionMaxLifespan(int seconds)
- Specified by:
setOfflineSessionMaxLifespan
in interfaceRealmModel
-
getClientSessionIdleTimeout
public int getClientSessionIdleTimeout()
- Specified by:
getClientSessionIdleTimeout
in interfaceRealmModel
-
setClientSessionIdleTimeout
public void setClientSessionIdleTimeout(int seconds)
- Specified by:
setClientSessionIdleTimeout
in interfaceRealmModel
-
getClientSessionMaxLifespan
public int getClientSessionMaxLifespan()
- Specified by:
getClientSessionMaxLifespan
in interfaceRealmModel
-
setClientSessionMaxLifespan
public void setClientSessionMaxLifespan(int seconds)
- Specified by:
setClientSessionMaxLifespan
in interfaceRealmModel
-
getClientOfflineSessionIdleTimeout
public int getClientOfflineSessionIdleTimeout()
- Specified by:
getClientOfflineSessionIdleTimeout
in interfaceRealmModel
-
setClientOfflineSessionIdleTimeout
public void setClientOfflineSessionIdleTimeout(int seconds)
- Specified by:
setClientOfflineSessionIdleTimeout
in interfaceRealmModel
-
getClientOfflineSessionMaxLifespan
public int getClientOfflineSessionMaxLifespan()
- Specified by:
getClientOfflineSessionMaxLifespan
in interfaceRealmModel
-
setClientOfflineSessionMaxLifespan
public void setClientOfflineSessionMaxLifespan(int seconds)
- Specified by:
setClientOfflineSessionMaxLifespan
in interfaceRealmModel
-
getAccessCodeLifespan
public int getAccessCodeLifespan()
- Specified by:
getAccessCodeLifespan
in interfaceRealmModel
-
setAccessCodeLifespan
public void setAccessCodeLifespan(int accessCodeLifespan)
- Specified by:
setAccessCodeLifespan
in interfaceRealmModel
-
getAccessCodeLifespanUserAction
public int getAccessCodeLifespanUserAction()
- Specified by:
getAccessCodeLifespanUserAction
in interfaceRealmModel
-
setAccessCodeLifespanUserAction
public void setAccessCodeLifespanUserAction(int accessCodeLifespanUserAction)
- Specified by:
setAccessCodeLifespanUserAction
in interfaceRealmModel
-
getOAuth2DeviceConfig
public OAuth2DeviceConfig getOAuth2DeviceConfig()
- Specified by:
getOAuth2DeviceConfig
in interfaceRealmModel
-
getCibaPolicy
public CibaConfig getCibaPolicy()
- Specified by:
getCibaPolicy
in interfaceRealmModel
-
getParPolicy
public ParConfig getParPolicy()
- Specified by:
getParPolicy
in interfaceRealmModel
-
getUserActionTokenLifespans
public Map<String,Integer> getUserActionTokenLifespans()
Description copied from interface:RealmModel
This method will return a map with all the lifespans available or an empty map, but never null.- Specified by:
getUserActionTokenLifespans
in interfaceRealmModel
- Returns:
- map with user action token lifespans
-
getAccessCodeLifespanLogin
public int getAccessCodeLifespanLogin()
- Specified by:
getAccessCodeLifespanLogin
in interfaceRealmModel
-
setAccessCodeLifespanLogin
public void setAccessCodeLifespanLogin(int accessCodeLifespanLogin)
- Specified by:
setAccessCodeLifespanLogin
in interfaceRealmModel
-
getActionTokenGeneratedByAdminLifespan
public int getActionTokenGeneratedByAdminLifespan()
- Specified by:
getActionTokenGeneratedByAdminLifespan
in interfaceRealmModel
-
setActionTokenGeneratedByAdminLifespan
public void setActionTokenGeneratedByAdminLifespan(int actionTokenGeneratedByAdminLifespan)
- Specified by:
setActionTokenGeneratedByAdminLifespan
in interfaceRealmModel
-
getActionTokenGeneratedByUserLifespan
public int getActionTokenGeneratedByUserLifespan()
- Specified by:
getActionTokenGeneratedByUserLifespan
in interfaceRealmModel
-
setActionTokenGeneratedByUserLifespan
public void setActionTokenGeneratedByUserLifespan(int actionTokenGeneratedByUserLifespan)
- Specified by:
setActionTokenGeneratedByUserLifespan
in interfaceRealmModel
-
getActionTokenGeneratedByUserLifespan
public int getActionTokenGeneratedByUserLifespan(String actionTokenId)
- Specified by:
getActionTokenGeneratedByUserLifespan
in interfaceRealmModel
-
setActionTokenGeneratedByUserLifespan
public void setActionTokenGeneratedByUserLifespan(String actionTokenId, Integer actionTokenGeneratedByUserLifespan)
- Specified by:
setActionTokenGeneratedByUserLifespan
in interfaceRealmModel
-
initRequiredCredentialModel
protected RequiredCredentialModel initRequiredCredentialModel(String type)
-
addRequiredCredential
public void addRequiredCredential(String type)
- Specified by:
addRequiredCredential
in interfaceRealmModel
-
addRequiredCredential
public void addRequiredCredential(RequiredCredentialModel model)
-
updateRequiredCredentials
public void updateRequiredCredentials(Set<String> creds)
- Specified by:
updateRequiredCredentials
in interfaceRealmModel
-
getRequiredCredentialsStream
public Stream<RequiredCredentialModel> getRequiredCredentialsStream()
Description copied from interface:RealmModel
Returns required credentials as a stream.- Specified by:
getRequiredCredentialsStream
in interfaceRealmModel
- Returns:
- Stream of
RequiredCredentialModel
. Never returnsnull
.
-
getDefaultRolesStream
@Deprecated public Stream<String> getDefaultRolesStream()
Deprecated.- Specified by:
getDefaultRolesStream
in interfaceRoleContainerModel
- Returns:
- Stream of default roles names or empty stream if there are none. Never returns
null
.
-
addDefaultRole
@Deprecated public void addDefaultRole(String name)
Deprecated.- Specified by:
addDefaultRole
in interfaceRoleContainerModel
-
removeDefaultRoles
@Deprecated public void removeDefaultRoles(String... defaultRoles)
Deprecated.- Specified by:
removeDefaultRoles
in interfaceRoleContainerModel
-
getDefaultGroupsStream
public Stream<GroupModel> getDefaultGroupsStream()
Description copied from interface:RealmModel
Returns default groups as a stream.- Specified by:
getDefaultGroupsStream
in interfaceRealmModel
- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
addDefaultGroup
public void addDefaultGroup(GroupModel group)
- Specified by:
addDefaultGroup
in interfaceRealmModel
-
removeDefaultGroup
public void removeDefaultGroup(GroupModel group)
- Specified by:
removeDefaultGroup
in interfaceRealmModel
-
getClientsStream
public Stream<ClientModel> getClientsStream()
Description copied from interface:RealmModel
Returns clients as a stream.- Specified by:
getClientsStream
in interfaceRealmModel
- Returns:
- Stream of
ClientModel
. Never returnsnull
.
-
getClientsStream
public Stream<ClientModel> getClientsStream(Integer firstResult, Integer maxResults)
Description copied from interface:RealmModel
Returns clients as a stream.- Specified by:
getClientsStream
in interfaceRealmModel
- 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
.
-
getAlwaysDisplayInConsoleClientsStream
public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream()
Description copied from interface:RealmModel
Returns clients which are always displayed in the admin console as a stream.- Specified by:
getAlwaysDisplayInConsoleClientsStream
in interfaceRealmModel
- Returns:
- Stream of
ClientModel
. Never returnsnull
.
-
addClient
public ClientModel addClient(String name)
- Specified by:
addClient
in interfaceRealmModel
-
addClient
public ClientModel addClient(String id, String clientId)
- Specified by:
addClient
in interfaceRealmModel
-
removeClient
public boolean removeClient(String id)
- Specified by:
removeClient
in interfaceRealmModel
-
getClientById
public ClientModel getClientById(String id)
- Specified by:
getClientById
in interfaceRealmModel
-
getClientByClientId
public ClientModel getClientByClientId(String clientId)
- Specified by:
getClientByClientId
in interfaceRealmModel
-
searchClientByClientIdStream
public Stream<ClientModel> searchClientByClientIdStream(String clientId, Integer firstResult, Integer maxResults)
Description copied from interface:RealmModel
Search for clients by provided client's id.- Specified by:
searchClientByClientIdStream
in interfaceRealmModel
- 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
public Stream<ClientModel> searchClientByAttributes(Map<String,String> attributes, Integer firstResult, Integer maxResults)
- Specified by:
searchClientByAttributes
in interfaceRealmModel
-
getBrowserSecurityHeaders
public Map<String,String> getBrowserSecurityHeaders()
- Specified by:
getBrowserSecurityHeaders
in interfaceRealmModel
-
setBrowserSecurityHeaders
public void setBrowserSecurityHeaders(Map<String,String> headers)
- Specified by:
setBrowserSecurityHeaders
in interfaceRealmModel
-
getSmtpConfig
public Map<String,String> getSmtpConfig()
- Specified by:
getSmtpConfig
in interfaceRealmModel
-
setSmtpConfig
public void setSmtpConfig(Map<String,String> smtpConfig)
- Specified by:
setSmtpConfig
in interfaceRealmModel
-
getRole
public RoleModel getRole(String name)
- Specified by:
getRole
in interfaceRoleContainerModel
-
addRole
public RoleModel addRole(String name)
- Specified by:
addRole
in interfaceRoleContainerModel
-
addRole
public RoleModel addRole(String id, String name)
- Specified by:
addRole
in interfaceRoleContainerModel
-
removeRole
public boolean removeRole(RoleModel role)
- Specified by:
removeRole
in interfaceRoleContainerModel
-
getRolesStream
public Stream<RoleModel> getRolesStream()
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRolesStream
public Stream<RoleModel> getRolesStream(Integer first, Integer max)
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Parameters:
first
-Integer
Index of the first desired role. Ignored if negative ornull
.max
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
searchForRolesStream
public Stream<RoleModel> searchForRolesStream(String search, Integer first, Integer max)
Description copied from interface:RoleContainerModel
Searches roles by the given name. Returns all roles that match the given filter.- Specified by:
searchForRolesStream
in interfaceRoleContainerModel
- Parameters:
search
-String
Name of the role to be used as a filter.first
-Integer
Index of the first desired role. Ignored if negative ornull
.max
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRoleById
public RoleModel getRoleById(String id)
- Specified by:
getRoleById
in interfaceRealmModel
-
getPasswordPolicy
public PasswordPolicy getPasswordPolicy()
- Specified by:
getPasswordPolicy
in interfaceRealmModel
-
setPasswordPolicy
public void setPasswordPolicy(PasswordPolicy policy)
- Specified by:
setPasswordPolicy
in interfaceRealmModel
-
getOTPPolicy
public OTPPolicy getOTPPolicy()
- Specified by:
getOTPPolicy
in interfaceRealmModel
-
setOTPPolicy
public void setOTPPolicy(OTPPolicy policy)
- Specified by:
setOTPPolicy
in interfaceRealmModel
-
getWebAuthnPolicy
public WebAuthnPolicy getWebAuthnPolicy()
- Specified by:
getWebAuthnPolicy
in interfaceRealmModel
- Returns:
- WebAuthn policy for 2-factor authentication
-
setWebAuthnPolicy
public void setWebAuthnPolicy(WebAuthnPolicy policy)
Description copied from interface:RealmModel
Set WebAuthn policy for 2-factor authentication- Specified by:
setWebAuthnPolicy
in interfaceRealmModel
-
getWebAuthnPolicyPasswordless
public WebAuthnPolicy getWebAuthnPolicyPasswordless()
- Specified by:
getWebAuthnPolicyPasswordless
in interfaceRealmModel
- Returns:
- WebAuthn passwordless policy below. This is temporary and will be removed later.
-
setWebAuthnPolicyPasswordless
public void setWebAuthnPolicyPasswordless(WebAuthnPolicy policy)
Description copied from interface:RealmModel
Set WebAuthn passwordless policy below. This is temporary and will be removed later.- Specified by:
setWebAuthnPolicyPasswordless
in interfaceRealmModel
-
getLoginTheme
public String getLoginTheme()
- Specified by:
getLoginTheme
in interfaceRealmModel
-
setLoginTheme
public void setLoginTheme(String name)
- Specified by:
setLoginTheme
in interfaceRealmModel
-
getAccountTheme
public String getAccountTheme()
- Specified by:
getAccountTheme
in interfaceRealmModel
-
setAccountTheme
public void setAccountTheme(String name)
- Specified by:
setAccountTheme
in interfaceRealmModel
-
getAdminTheme
public String getAdminTheme()
- Specified by:
getAdminTheme
in interfaceRealmModel
-
setAdminTheme
public void setAdminTheme(String name)
- Specified by:
setAdminTheme
in interfaceRealmModel
-
getEmailTheme
public String getEmailTheme()
- Specified by:
getEmailTheme
in interfaceRealmModel
-
setEmailTheme
public void setEmailTheme(String name)
- Specified by:
setEmailTheme
in interfaceRealmModel
-
isEventsEnabled
public boolean isEventsEnabled()
- Specified by:
isEventsEnabled
in interfaceRealmModel
-
setEventsEnabled
public void setEventsEnabled(boolean enabled)
- Specified by:
setEventsEnabled
in interfaceRealmModel
-
getEventsExpiration
public long getEventsExpiration()
- Specified by:
getEventsExpiration
in interfaceRealmModel
-
setEventsExpiration
public void setEventsExpiration(long expiration)
- Specified by:
setEventsExpiration
in interfaceRealmModel
-
getEventsListenersStream
public Stream<String> getEventsListenersStream()
Description copied from interface:RealmModel
Returns events listeners as a stream.- Specified by:
getEventsListenersStream
in interfaceRealmModel
- Returns:
- Stream of
String
. Never returnsnull
.
-
setEventsListeners
public void setEventsListeners(Set<String> listeners)
- Specified by:
setEventsListeners
in interfaceRealmModel
-
getEnabledEventTypesStream
public Stream<String> getEnabledEventTypesStream()
Description copied from interface:RealmModel
Returns enabled event types as a stream.- Specified by:
getEnabledEventTypesStream
in interfaceRealmModel
- Returns:
- Stream of
String
. Never returnsnull
.
-
setEnabledEventTypes
public void setEnabledEventTypes(Set<String> enabledEventTypes)
- Specified by:
setEnabledEventTypes
in interfaceRealmModel
-
isAdminEventsEnabled
public boolean isAdminEventsEnabled()
- Specified by:
isAdminEventsEnabled
in interfaceRealmModel
-
setAdminEventsEnabled
public void setAdminEventsEnabled(boolean enabled)
- Specified by:
setAdminEventsEnabled
in interfaceRealmModel
-
isAdminEventsDetailsEnabled
public boolean isAdminEventsDetailsEnabled()
- Specified by:
isAdminEventsDetailsEnabled
in interfaceRealmModel
-
setAdminEventsDetailsEnabled
public void setAdminEventsDetailsEnabled(boolean enabled)
- Specified by:
setAdminEventsDetailsEnabled
in interfaceRealmModel
-
getMasterAdminClient
public ClientModel getMasterAdminClient()
- Specified by:
getMasterAdminClient
in interfaceRealmModel
-
setMasterAdminClient
public void setMasterAdminClient(ClientModel client)
- Specified by:
setMasterAdminClient
in interfaceRealmModel
-
setDefaultRole
public void setDefaultRole(RoleModel role)
Description copied from interface:RealmModel
Sets default role for this realm- Specified by:
setDefaultRole
in interfaceRealmModel
- Parameters:
role
- to be set
-
getDefaultRole
public RoleModel getDefaultRole()
Description copied from interface:RealmModel
Returns default realm role. All both realm and client default roles are assigned as composite of this role.- Specified by:
getDefaultRole
in interfaceRealmModel
- Returns:
- Default role of this realm
-
getIdentityProvidersStream
public Stream<IdentityProviderModel> getIdentityProvidersStream()
Description copied from interface:RealmModel
Returns identity providers as a stream.- Specified by:
getIdentityProvidersStream
in interfaceRealmModel
- Returns:
- Stream of
IdentityProviderModel
. Never returnsnull
.
-
getIdentityProviderByAlias
public IdentityProviderModel getIdentityProviderByAlias(String alias)
- Specified by:
getIdentityProviderByAlias
in interfaceRealmModel
-
addIdentityProvider
public void addIdentityProvider(IdentityProviderModel identityProvider)
- Specified by:
addIdentityProvider
in interfaceRealmModel
-
removeIdentityProviderByAlias
public void removeIdentityProviderByAlias(String alias)
- Specified by:
removeIdentityProviderByAlias
in interfaceRealmModel
-
updateIdentityProvider
public void updateIdentityProvider(IdentityProviderModel identityProvider)
- Specified by:
updateIdentityProvider
in interfaceRealmModel
-
isIdentityFederationEnabled
public boolean isIdentityFederationEnabled()
- Specified by:
isIdentityFederationEnabled
in interfaceRealmModel
-
isInternationalizationEnabled
public boolean isInternationalizationEnabled()
- Specified by:
isInternationalizationEnabled
in interfaceRealmModel
-
setInternationalizationEnabled
public void setInternationalizationEnabled(boolean enabled)
- Specified by:
setInternationalizationEnabled
in interfaceRealmModel
-
getSupportedLocalesStream
public Stream<String> getSupportedLocalesStream()
Description copied from interface:RealmModel
Returns supported locales as a stream.- Specified by:
getSupportedLocalesStream
in interfaceRealmModel
- Returns:
- Stream of
String
. Never returnsnull
.
-
setSupportedLocales
public void setSupportedLocales(Set<String> locales)
- Specified by:
setSupportedLocales
in interfaceRealmModel
-
getDefaultLocale
public String getDefaultLocale()
- Specified by:
getDefaultLocale
in interfaceRealmModel
-
setDefaultLocale
public void setDefaultLocale(String locale)
- Specified by:
setDefaultLocale
in interfaceRealmModel
-
getIdentityProviderMappersStream
public Stream<IdentityProviderMapperModel> getIdentityProviderMappersStream()
Description copied from interface:RealmModel
Returns identity provider mappers as a stream.- Specified by:
getIdentityProviderMappersStream
in interfaceRealmModel
- Returns:
- Stream of
IdentityProviderMapperModel
. Never returnsnull
.
-
getIdentityProviderMappersByAliasStream
public Stream<IdentityProviderMapperModel> getIdentityProviderMappersByAliasStream(String brokerAlias)
Description copied from interface:RealmModel
Returns identity provider mappers by the provided alias as a stream.- Specified by:
getIdentityProviderMappersByAliasStream
in interfaceRealmModel
- Parameters:
brokerAlias
-String
Broker's alias to filter results.- Returns:
- Stream of
IdentityProviderMapperModel
Never returnsnull
.
-
addIdentityProviderMapper
public IdentityProviderMapperModel addIdentityProviderMapper(IdentityProviderMapperModel model)
- Specified by:
addIdentityProviderMapper
in interfaceRealmModel
-
getIdentityProviderMapperEntity
protected IdentityProviderMapperEntity getIdentityProviderMapperEntity(String id)
-
getIdentityProviderMapperEntityByName
protected IdentityProviderMapperEntity getIdentityProviderMapperEntityByName(String alias, String name)
-
removeIdentityProviderMapper
public void removeIdentityProviderMapper(IdentityProviderMapperModel mapping)
- Specified by:
removeIdentityProviderMapper
in interfaceRealmModel
-
updateIdentityProviderMapper
public void updateIdentityProviderMapper(IdentityProviderMapperModel mapping)
- Specified by:
updateIdentityProviderMapper
in interfaceRealmModel
-
getIdentityProviderMapperById
public IdentityProviderMapperModel getIdentityProviderMapperById(String id)
- Specified by:
getIdentityProviderMapperById
in interfaceRealmModel
-
getIdentityProviderMapperByName
public IdentityProviderMapperModel getIdentityProviderMapperByName(String alias, String name)
- Specified by:
getIdentityProviderMapperByName
in interfaceRealmModel
-
entityToModel
protected IdentityProviderMapperModel entityToModel(IdentityProviderMapperEntity entity)
-
getBrowserFlow
public AuthenticationFlowModel getBrowserFlow()
- Specified by:
getBrowserFlow
in interfaceRealmModel
-
setBrowserFlow
public void setBrowserFlow(AuthenticationFlowModel flow)
- Specified by:
setBrowserFlow
in interfaceRealmModel
-
getRegistrationFlow
public AuthenticationFlowModel getRegistrationFlow()
- Specified by:
getRegistrationFlow
in interfaceRealmModel
-
setRegistrationFlow
public void setRegistrationFlow(AuthenticationFlowModel flow)
- Specified by:
setRegistrationFlow
in interfaceRealmModel
-
getDirectGrantFlow
public AuthenticationFlowModel getDirectGrantFlow()
- Specified by:
getDirectGrantFlow
in interfaceRealmModel
-
setDirectGrantFlow
public void setDirectGrantFlow(AuthenticationFlowModel flow)
- Specified by:
setDirectGrantFlow
in interfaceRealmModel
-
getResetCredentialsFlow
public AuthenticationFlowModel getResetCredentialsFlow()
- Specified by:
getResetCredentialsFlow
in interfaceRealmModel
-
setResetCredentialsFlow
public void setResetCredentialsFlow(AuthenticationFlowModel flow)
- Specified by:
setResetCredentialsFlow
in interfaceRealmModel
-
getClientAuthenticationFlow
public AuthenticationFlowModel getClientAuthenticationFlow()
- Specified by:
getClientAuthenticationFlow
in interfaceRealmModel
-
setClientAuthenticationFlow
public void setClientAuthenticationFlow(AuthenticationFlowModel flow)
- Specified by:
setClientAuthenticationFlow
in interfaceRealmModel
-
getDockerAuthenticationFlow
public AuthenticationFlowModel getDockerAuthenticationFlow()
- Specified by:
getDockerAuthenticationFlow
in interfaceRealmModel
-
setDockerAuthenticationFlow
public void setDockerAuthenticationFlow(AuthenticationFlowModel flow)
- Specified by:
setDockerAuthenticationFlow
in interfaceRealmModel
-
getAuthenticationFlowsStream
public Stream<AuthenticationFlowModel> getAuthenticationFlowsStream()
Description copied from interface:RealmModel
Returns authentications flows as a stream.- Specified by:
getAuthenticationFlowsStream
in interfaceRealmModel
- Returns:
- Stream of
AuthenticationFlowModel
. Never returnsnull
.
-
getFlowByAlias
public AuthenticationFlowModel getFlowByAlias(String alias)
- Specified by:
getFlowByAlias
in interfaceRealmModel
-
getAuthenticatorConfigByAlias
public AuthenticatorConfigModel getAuthenticatorConfigByAlias(String alias)
- Specified by:
getAuthenticatorConfigByAlias
in interfaceRealmModel
-
entityToModel
protected AuthenticationFlowModel entityToModel(AuthenticationFlowEntity entity)
-
getAuthenticationFlowById
public AuthenticationFlowModel getAuthenticationFlowById(String id)
- Specified by:
getAuthenticationFlowById
in interfaceRealmModel
-
removeAuthenticationFlow
public void removeAuthenticationFlow(AuthenticationFlowModel model)
- Specified by:
removeAuthenticationFlow
in interfaceRealmModel
-
updateAuthenticationFlow
public void updateAuthenticationFlow(AuthenticationFlowModel model)
- Specified by:
updateAuthenticationFlow
in interfaceRealmModel
-
addAuthenticationFlow
public AuthenticationFlowModel addAuthenticationFlow(AuthenticationFlowModel model)
- Specified by:
addAuthenticationFlow
in interfaceRealmModel
-
getAuthenticationExecutionsStream
public Stream<AuthenticationExecutionModel> getAuthenticationExecutionsStream(String flowId)
Description copied from interface:RealmModel
Returns sorted (according to priority)AuthenticationExecutionModel
as a stream. It should be used with forEachOrdered if the ordering is required.- Specified by:
getAuthenticationExecutionsStream
in interfaceRealmModel
- Parameters:
flowId
-String
Id of the flow.- Returns:
- Sorted stream of
AuthenticationExecutionModel
. Never returnsnull
.
-
entityToModel
public AuthenticationExecutionModel entityToModel(AuthenticationExecutionEntity entity)
-
getAuthenticationExecutionById
public AuthenticationExecutionModel getAuthenticationExecutionById(String id)
- Specified by:
getAuthenticationExecutionById
in interfaceRealmModel
-
getAuthenticationExecutionByFlowId
public AuthenticationExecutionModel getAuthenticationExecutionByFlowId(String flowId)
- Specified by:
getAuthenticationExecutionByFlowId
in interfaceRealmModel
-
addAuthenticatorExecution
public AuthenticationExecutionModel addAuthenticatorExecution(AuthenticationExecutionModel model)
- Specified by:
addAuthenticatorExecution
in interfaceRealmModel
-
updateAuthenticatorExecution
public void updateAuthenticatorExecution(AuthenticationExecutionModel model)
- Specified by:
updateAuthenticatorExecution
in interfaceRealmModel
-
removeAuthenticatorExecution
public void removeAuthenticatorExecution(AuthenticationExecutionModel model)
- Specified by:
removeAuthenticatorExecution
in interfaceRealmModel
-
addAuthenticatorConfig
public AuthenticatorConfigModel addAuthenticatorConfig(AuthenticatorConfigModel model)
- Specified by:
addAuthenticatorConfig
in interfaceRealmModel
-
removeAuthenticatorConfig
public void removeAuthenticatorConfig(AuthenticatorConfigModel model)
- Specified by:
removeAuthenticatorConfig
in interfaceRealmModel
-
getAuthenticatorConfigById
public AuthenticatorConfigModel getAuthenticatorConfigById(String id)
- Specified by:
getAuthenticatorConfigById
in interfaceRealmModel
-
entityToModel
public AuthenticatorConfigModel entityToModel(AuthenticatorConfigEntity entity)
-
updateAuthenticatorConfig
public void updateAuthenticatorConfig(AuthenticatorConfigModel model)
- Specified by:
updateAuthenticatorConfig
in interfaceRealmModel
-
getAuthenticatorConfigsStream
public Stream<AuthenticatorConfigModel> getAuthenticatorConfigsStream()
Description copied from interface:RealmModel
Returns authentication configs as a stream.- Specified by:
getAuthenticatorConfigsStream
in interfaceRealmModel
- Returns:
- Stream of
AuthenticatorConfigModel
. Never returnsnull
.
-
addRequiredActionProvider
public RequiredActionProviderModel addRequiredActionProvider(RequiredActionProviderModel model)
- Specified by:
addRequiredActionProvider
in interfaceRealmModel
-
removeRequiredActionProvider
public void removeRequiredActionProvider(RequiredActionProviderModel model)
- Specified by:
removeRequiredActionProvider
in interfaceRealmModel
-
getRequiredActionProviderById
public RequiredActionProviderModel getRequiredActionProviderById(String id)
- Specified by:
getRequiredActionProviderById
in interfaceRealmModel
-
entityToModel
public RequiredActionProviderModel entityToModel(RequiredActionProviderEntity entity)
-
updateRequiredActionProvider
public void updateRequiredActionProvider(RequiredActionProviderModel model)
- Specified by:
updateRequiredActionProvider
in interfaceRealmModel
-
getRequiredActionProvidersStream
public Stream<RequiredActionProviderModel> getRequiredActionProvidersStream()
Description copied from interface:RealmModel
Returns sortedRequiredActionProviderModel
as a stream. It should be used with forEachOrdered if the ordering is required.- Specified by:
getRequiredActionProvidersStream
in interfaceRealmModel
- Returns:
- Sorted stream of
RequiredActionProviderModel
. Never returnsnull
.
-
getRequiredActionProviderByAlias
public RequiredActionProviderModel getRequiredActionProviderByAlias(String alias)
- Specified by:
getRequiredActionProviderByAlias
in interfaceRealmModel
-
createGroup
public GroupModel createGroup(String id, String name, GroupModel toParent)
- Specified by:
createGroup
in interfaceRealmModel
-
moveGroup
public void moveGroup(GroupModel group, GroupModel toParent)
- Specified by:
moveGroup
in interfaceRealmModel
-
getGroupById
public GroupModel getGroupById(String id)
- Specified by:
getGroupById
in interfaceRealmModel
-
getGroupsStream
public Stream<GroupModel> getGroupsStream()
Description copied from interface:RealmModel
Returns groups as a stream.- Specified by:
getGroupsStream
in interfaceRealmModel
- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
getGroupsCount
public Long getGroupsCount(Boolean onlyTopGroups)
- Specified by:
getGroupsCount
in interfaceRealmModel
-
getGroupsCountByNameContaining
public Long getGroupsCountByNameContaining(String search)
- Specified by:
getGroupsCountByNameContaining
in interfaceRealmModel
-
getTopLevelGroupsStream
public Stream<GroupModel> getTopLevelGroupsStream()
Description copied from interface:RealmModel
Returns top level groups as a stream.- Specified by:
getTopLevelGroupsStream
in interfaceRealmModel
- Returns:
- Stream of
GroupModel
. Never returnsnull
.
-
getTopLevelGroupsStream
public Stream<GroupModel> getTopLevelGroupsStream(Integer first, Integer max)
Description copied from interface:RealmModel
Returns top level groups as a stream.- Specified by:
getTopLevelGroupsStream
in interfaceRealmModel
- 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 public Stream<GroupModel> searchForGroupByNameStream(String search, Integer first, Integer max)
Deprecated.Description copied from interface:RealmModel
Searches for groups by provided name. Results that match the given filter are returned as a stream.- Specified by:
searchForGroupByNameStream
in interfaceRealmModel
- 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
public boolean removeGroup(GroupModel group)
- Specified by:
removeGroup
in interfaceRealmModel
-
getClientScopesStream
public Stream<ClientScopeModel> getClientScopesStream()
Description copied from interface:RealmModel
Returns all client scopes of this realm as a stream.- Specified by:
getClientScopesStream
in interfaceRealmModel
- Returns:
- Stream of
ClientScopeModel
. Never returnsnull
.
-
addClientScope
public ClientScopeModel addClientScope(String name)
Description copied from interface:RealmModel
Creates new client scope with the given name. Internal ID is created automatically. If given name contains spaces, those are replaced by underscores.- Specified by:
addClientScope
in interfaceRealmModel
- Parameters:
name
-String
name of the client scope.- Returns:
- Model of the created client scope.
-
addClientScope
public ClientScopeModel addClientScope(String id, String name)
Description copied from interface:RealmModel
Creates new client scope with the given internal ID and name. If given name contains spaces, those are replaced by underscores.- Specified by:
addClientScope
in interfaceRealmModel
- Parameters:
id
-String
id of the client scope.name
-String
name of the client scope.- Returns:
- Model of the created client scope.
-
removeClientScope
public boolean removeClientScope(String id)
Description copied from interface:RealmModel
Removes client scope with givenid
from this realm.- Specified by:
removeClientScope
in interfaceRealmModel
- Parameters:
id
- of the client scope- Returns:
- true if the realm contained the scope and the removal was successful, false otherwise
-
getClientScopeById
public ClientScopeModel getClientScopeById(String id)
- Specified by:
getClientScopeById
in interfaceRealmModel
- Parameters:
id
- of the client scope- Returns:
- Client scope with the given
id
, ornull
when the scope does not exist.
-
addDefaultClientScope
public void addDefaultClientScope(ClientScopeModel clientScope, boolean defaultScope)
Description copied from interface:RealmModel
Adds given client scope among default/optional client scopes of this realm. The scope will be assigned to each new client.- Specified by:
addDefaultClientScope
in interfaceRealmModel
- 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
public void removeDefaultClientScope(ClientScopeModel clientScope)
Description copied from interface:RealmModel
Removes given client scope from default or optional client scopes of this realm.- Specified by:
removeDefaultClientScope
in interfaceRealmModel
- Parameters:
clientScope
- to be removed
-
getDefaultClientScopesStream
public Stream<ClientScopeModel> getDefaultClientScopesStream(boolean defaultScope)
Description copied from interface:RealmModel
Returns default client scopes of this realm either default ones or optional ones.- Specified by:
getDefaultClientScopesStream
in interfaceRealmModel
- Parameters:
defaultScope
- iftrue
default client scopes are returned, iffalse
optional client scopes are returned.- Returns:
- Stream of
ClientScopeModel
. Never returnsnull
.
-
addComponentModel
public ComponentModel addComponentModel(ComponentModel model)
Description copied from interface:RealmModel
Adds component model. Will call onCreate() method of ComponentFactory- Specified by:
addComponentModel
in interfaceRealmModel
- Returns:
-
importComponentModel
public ComponentModel importComponentModel(ComponentModel model)
Description copied from interface:RealmModel
Adds component model. Will NOT call onCreate() method of ComponentFactory- Specified by:
importComponentModel
in interfaceRealmModel
- Returns:
-
setConfig
protected void setConfig(ComponentModel model, ComponentEntity c)
-
updateComponent
public void updateComponent(ComponentModel component)
Description copied from interface:RealmModel
Updates component model. Will call onUpdate() method of ComponentFactory- Specified by:
updateComponent
in interfaceRealmModel
- Parameters:
component
- to be updated
-
removeComponent
public void removeComponent(ComponentModel component)
Description copied from interface:RealmModel
Removes given component. Will call preRemove() method of ComponentFactory. Also callsthis.removeComponents(component.getId())
.- Specified by:
removeComponent
in interfaceRealmModel
- Parameters:
component
- to be removed
-
removeComponents
public void removeComponents(String parentId)
Description copied from interface:RealmModel
Removes all components with givenparentId
- Specified by:
removeComponents
in interfaceRealmModel
- Parameters:
parentId
-String
id of parent
-
getComponentsStream
public Stream<ComponentModel> getComponentsStream(String parentId, String providerType)
Description copied from interface:RealmModel
Returns stream of ComponentModels for specific parentId and providerType.- Specified by:
getComponentsStream
in interfaceRealmModel
- Parameters:
parentId
-String
id of parentproviderType
-String
type of provider- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
getComponentsStream
public Stream<ComponentModel> getComponentsStream(String parentId)
Description copied from interface:RealmModel
Returns stream of ComponentModels for specific parentId.- Specified by:
getComponentsStream
in interfaceRealmModel
- Parameters:
parentId
-String
id of parent- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
entityToModel
protected ComponentModel entityToModel(ComponentEntity c)
-
getComponentsStream
public Stream<ComponentModel> getComponentsStream()
Description copied from interface:RealmModel
Returns stream of component models.- Specified by:
getComponentsStream
in interfaceRealmModel
- Returns:
- Stream of
ComponentModel
. Never returnsnull
.
-
getComponent
public ComponentModel getComponent(String id)
- Specified by:
getComponent
in interfaceRealmModel
-
createOrUpdateRealmLocalizationTexts
public void createOrUpdateRealmLocalizationTexts(String locale, Map<String,String> localizationTexts)
Description copied from interface:RealmModel
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.- Specified by:
createOrUpdateRealmLocalizationTexts
in interfaceRealmModel
-
removeRealmLocalizationTexts
public boolean removeRealmLocalizationTexts(String locale)
- Specified by:
removeRealmLocalizationTexts
in interfaceRealmModel
-
getRealmLocalizationTexts
public Map<String,Map<String,String>> getRealmLocalizationTexts()
- Specified by:
getRealmLocalizationTexts
in interfaceRealmModel
-
getRealmLocalizationTextsByLocale
public Map<String,String> getRealmLocalizationTextsByLocale(String locale)
- Specified by:
getRealmLocalizationTextsByLocale
in interfaceRealmModel
-
createClientInitialAccessModel
public ClientInitialAccessModel createClientInitialAccessModel(int expiration, int count)
- Specified by:
createClientInitialAccessModel
in interfaceRealmModel
-
getClientInitialAccessModel
public ClientInitialAccessModel getClientInitialAccessModel(String id)
- Specified by:
getClientInitialAccessModel
in interfaceRealmModel
-
removeClientInitialAccessModel
public void removeClientInitialAccessModel(String id)
- Specified by:
removeClientInitialAccessModel
in interfaceRealmModel
-
getClientInitialAccesses
public Stream<ClientInitialAccessModel> getClientInitialAccesses()
- Specified by:
getClientInitialAccesses
in interfaceRealmModel
-
decreaseRemainingCount
public void decreaseRemainingCount(ClientInitialAccessModel clientInitialAccess)
- Specified by:
decreaseRemainingCount
in interfaceRealmModel
-
-