public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> implements RealmModel
RealmModel.ClientCreationEvent, RealmModel.ClientRemovedEvent, RealmModel.RealmCreationEvent, RealmModel.RealmPostCreateEvent, RealmModel.RealmRemovedEvent, RealmModel.UserFederationProviderCreationEvent
RoleContainerModel.RoleRemovedEvent
Modifier and Type | Field and Description |
---|---|
protected X509Certificate |
certificate |
protected Key |
codeSecretKey |
protected PrivateKey |
privateKey |
protected PublicKey |
publicKey |
invocationContext
Constructor and Description |
---|
RealmAdapter(KeycloakSession session,
MongoRealmEntity realmEntity,
MongoStoreInvocationContext invocationContext) |
getMongoStore, updateMongoEntity
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getUserStorageProviders
protected transient volatile PublicKey publicKey
protected transient volatile PrivateKey privateKey
protected transient volatile X509Certificate certificate
protected transient volatile Key codeSecretKey
public RealmAdapter(KeycloakSession session, MongoRealmEntity realmEntity, MongoStoreInvocationContext invocationContext)
public String getId()
getId
in interface RealmModel
getId
in interface RoleContainerModel
public String getName()
getName
in interface RealmModel
public void setName(String name)
setName
in interface RealmModel
public String getDisplayName()
getDisplayName
in interface RealmModel
public void setDisplayName(String displayName)
setDisplayName
in interface RealmModel
public String getDisplayNameHtml()
getDisplayNameHtml
in interface RealmModel
public void setDisplayNameHtml(String displayNameHtml)
setDisplayNameHtml
in interface RealmModel
public boolean isEnabled()
isEnabled
in interface RealmModel
public void setEnabled(boolean enabled)
setEnabled
in interface RealmModel
public SslRequired getSslRequired()
getSslRequired
in interface RealmModel
public void setSslRequired(SslRequired sslRequired)
setSslRequired
in interface RealmModel
public boolean isRegistrationAllowed()
isRegistrationAllowed
in interface RealmModel
public void setRegistrationAllowed(boolean registrationAllowed)
setRegistrationAllowed
in interface RealmModel
public boolean isRegistrationEmailAsUsername()
isRegistrationEmailAsUsername
in interface RealmModel
public void setRegistrationEmailAsUsername(boolean registrationEmailAsUsername)
setRegistrationEmailAsUsername
in interface RealmModel
public boolean isRememberMe()
isRememberMe
in interface RealmModel
public void setRememberMe(boolean rememberMe)
setRememberMe
in interface RealmModel
public boolean isBruteForceProtected()
isBruteForceProtected
in interface RealmModel
public void setBruteForceProtected(boolean value)
setBruteForceProtected
in interface RealmModel
public int getMaxFailureWaitSeconds()
getMaxFailureWaitSeconds
in interface RealmModel
public void setMaxFailureWaitSeconds(int val)
setMaxFailureWaitSeconds
in interface RealmModel
public int getWaitIncrementSeconds()
getWaitIncrementSeconds
in interface RealmModel
public void setWaitIncrementSeconds(int val)
setWaitIncrementSeconds
in interface RealmModel
public long getQuickLoginCheckMilliSeconds()
getQuickLoginCheckMilliSeconds
in interface RealmModel
public void setQuickLoginCheckMilliSeconds(long val)
setQuickLoginCheckMilliSeconds
in interface RealmModel
public int getMinimumQuickLoginWaitSeconds()
getMinimumQuickLoginWaitSeconds
in interface RealmModel
public void setMinimumQuickLoginWaitSeconds(int val)
setMinimumQuickLoginWaitSeconds
in interface RealmModel
public int getMaxDeltaTimeSeconds()
getMaxDeltaTimeSeconds
in interface RealmModel
public void setMaxDeltaTimeSeconds(int val)
setMaxDeltaTimeSeconds
in interface RealmModel
public int getFailureFactor()
getFailureFactor
in interface RealmModel
public void setFailureFactor(int failureFactor)
setFailureFactor
in interface RealmModel
public boolean isVerifyEmail()
isVerifyEmail
in interface RealmModel
public void setVerifyEmail(boolean verifyEmail)
setVerifyEmail
in interface RealmModel
public boolean isResetPasswordAllowed()
isResetPasswordAllowed
in interface RealmModel
public void setResetPasswordAllowed(boolean resetPassword)
setResetPasswordAllowed
in interface RealmModel
public boolean isEditUsernameAllowed()
isEditUsernameAllowed
in interface RealmModel
public void setEditUsernameAllowed(boolean editUsernameAllowed)
setEditUsernameAllowed
in interface RealmModel
public PasswordPolicy getPasswordPolicy()
getPasswordPolicy
in interface RealmModel
public void setPasswordPolicy(PasswordPolicy policy)
setPasswordPolicy
in interface RealmModel
public OTPPolicy getOTPPolicy()
getOTPPolicy
in interface RealmModel
public void setOTPPolicy(OTPPolicy policy)
setOTPPolicy
in interface RealmModel
public int getNotBefore()
RealmModel
getNotBefore
in interface RealmModel
public void setNotBefore(int notBefore)
setNotBefore
in interface RealmModel
public boolean isRevokeRefreshToken()
isRevokeRefreshToken
in interface RealmModel
public void setRevokeRefreshToken(boolean revokeRefreshToken)
setRevokeRefreshToken
in interface RealmModel
public int getSsoSessionIdleTimeout()
getSsoSessionIdleTimeout
in interface RealmModel
public void setSsoSessionIdleTimeout(int seconds)
setSsoSessionIdleTimeout
in interface RealmModel
public int getSsoSessionMaxLifespan()
getSsoSessionMaxLifespan
in interface RealmModel
public void setSsoSessionMaxLifespan(int seconds)
setSsoSessionMaxLifespan
in interface RealmModel
public int getOfflineSessionIdleTimeout()
getOfflineSessionIdleTimeout
in interface RealmModel
public void setOfflineSessionIdleTimeout(int seconds)
setOfflineSessionIdleTimeout
in interface RealmModel
public int getAccessTokenLifespan()
getAccessTokenLifespan
in interface RealmModel
public void setAccessTokenLifespan(int tokenLifespan)
setAccessTokenLifespan
in interface RealmModel
public int getAccessTokenLifespanForImplicitFlow()
getAccessTokenLifespanForImplicitFlow
in interface RealmModel
public void setAccessTokenLifespanForImplicitFlow(int seconds)
setAccessTokenLifespanForImplicitFlow
in interface RealmModel
public int getAccessCodeLifespan()
getAccessCodeLifespan
in interface RealmModel
public void setAccessCodeLifespan(int accessCodeLifespan)
setAccessCodeLifespan
in interface RealmModel
public int getAccessCodeLifespanUserAction()
getAccessCodeLifespanUserAction
in interface RealmModel
public void setAccessCodeLifespanUserAction(int accessCodeLifespanUserAction)
setAccessCodeLifespanUserAction
in interface RealmModel
public void setAccessCodeLifespanLogin(int accessCodeLifespanLogin)
setAccessCodeLifespanLogin
in interface RealmModel
public int getAccessCodeLifespanLogin()
getAccessCodeLifespanLogin
in interface RealmModel
public String getKeyId()
getKeyId
in interface RealmModel
public String getPublicKeyPem()
getPublicKeyPem
in interface RealmModel
public void setPublicKeyPem(String publicKeyPem)
setPublicKeyPem
in interface RealmModel
public X509Certificate getCertificate()
getCertificate
in interface RealmModel
public void setCertificate(X509Certificate certificate)
setCertificate
in interface RealmModel
public String getCertificatePem()
getCertificatePem
in interface RealmModel
public void setCertificatePem(String certificate)
setCertificatePem
in interface RealmModel
public String getPrivateKeyPem()
getPrivateKeyPem
in interface RealmModel
public void setPrivateKeyPem(String privateKeyPem)
setPrivateKeyPem
in interface RealmModel
public PublicKey getPublicKey()
getPublicKey
in interface RealmModel
public void setPublicKey(PublicKey publicKey)
setPublicKey
in interface RealmModel
public PrivateKey getPrivateKey()
getPrivateKey
in interface RealmModel
public void setPrivateKey(PrivateKey privateKey)
setPrivateKey
in interface RealmModel
public String getCodeSecret()
getCodeSecret
in interface RealmModel
public Key getCodeSecretKey()
getCodeSecretKey
in interface RealmModel
public void setCodeSecret(String codeSecret)
setCodeSecret
in interface RealmModel
public String getLoginTheme()
getLoginTheme
in interface RealmModel
public void setLoginTheme(String name)
setLoginTheme
in interface RealmModel
public String getAccountTheme()
getAccountTheme
in interface RealmModel
public void setAccountTheme(String name)
setAccountTheme
in interface RealmModel
public String getAdminTheme()
getAdminTheme
in interface RealmModel
public void setAdminTheme(String name)
setAdminTheme
in interface RealmModel
public String getEmailTheme()
getEmailTheme
in interface RealmModel
public void setEmailTheme(String name)
setEmailTheme
in interface RealmModel
public RoleModel getRole(String name)
getRole
in interface RoleContainerModel
public RoleModel addRole(String name)
addRole
in interface RoleContainerModel
public RoleModel addRole(String id, String name)
addRole
in interface RoleContainerModel
public boolean removeRole(RoleModel role)
removeRole
in interface RoleContainerModel
public boolean removeRoleById(String id)
removeRoleById
in interface RealmModel
public Set<RoleModel> getRoles()
getRoles
in interface RoleContainerModel
public RoleModel getRoleById(String id)
getRoleById
in interface RealmModel
public GroupModel createGroup(String name)
createGroup
in interface RealmModel
public GroupModel createGroup(String id, String name)
createGroup
in interface RealmModel
public void addTopLevelGroup(GroupModel subGroup)
RealmModel
addTopLevelGroup
in interface RealmModel
public void moveGroup(GroupModel group, GroupModel toParent)
moveGroup
in interface RealmModel
public GroupModel getGroupById(String id)
getGroupById
in interface RealmModel
public List<GroupModel> getGroups()
getGroups
in interface RealmModel
public List<GroupModel> getTopLevelGroups()
getTopLevelGroups
in interface RealmModel
public boolean removeGroup(GroupModel group)
removeGroup
in interface RealmModel
public List<String> getDefaultRoles()
getDefaultRoles
in interface RoleContainerModel
public void addDefaultRole(String name)
addDefaultRole
in interface RoleContainerModel
public void updateDefaultRoles(String[] defaultRoles)
updateDefaultRoles
in interface RoleContainerModel
public void removeDefaultRoles(String... defaultRoles)
removeDefaultRoles
in interface RoleContainerModel
public List<GroupModel> getDefaultGroups()
getDefaultGroups
in interface RealmModel
public void addDefaultGroup(GroupModel group)
addDefaultGroup
in interface RealmModel
public void removeDefaultGroup(GroupModel group)
removeDefaultGroup
in interface RealmModel
public ClientModel getClientById(String id)
getClientById
in interface RealmModel
public ClientModel getClientByClientId(String clientId)
getClientByClientId
in interface RealmModel
public List<ClientModel> getClients()
getClients
in interface RealmModel
public ClientModel addClient(String name)
addClient
in interface RealmModel
public ClientModel addClient(String id, String clientId)
addClient
in interface RealmModel
public boolean removeClient(String id)
removeClient
in interface RealmModel
public void addRequiredCredential(String type)
addRequiredCredential
in interface RealmModel
protected void addRequiredCredential(RequiredCredentialModel credentialModel, List<RequiredCredentialEntity> persistentCollection)
public void updateRequiredCredentials(Set<String> creds)
updateRequiredCredentials
in interface RealmModel
protected void updateRequiredCredentials(Set<String> creds, List<RequiredCredentialEntity> credsEntities)
public List<RequiredCredentialModel> getRequiredCredentials()
getRequiredCredentials
in interface RealmModel
protected List<RequiredCredentialModel> convertRequiredCredentialEntities(Collection<RequiredCredentialEntity> credEntities)
protected void updateRealm()
protected RequiredCredentialModel initRequiredCredentialModel(String type)
public Map<String,String> getBrowserSecurityHeaders()
getBrowserSecurityHeaders
in interface RealmModel
public void setBrowserSecurityHeaders(Map<String,String> headers)
setBrowserSecurityHeaders
in interface RealmModel
public Map<String,String> getSmtpConfig()
getSmtpConfig
in interface RealmModel
public void setSmtpConfig(Map<String,String> smtpConfig)
setSmtpConfig
in interface RealmModel
public List<IdentityProviderModel> getIdentityProviders()
getIdentityProviders
in interface RealmModel
public IdentityProviderModel getIdentityProviderByAlias(String alias)
getIdentityProviderByAlias
in interface RealmModel
public void addIdentityProvider(IdentityProviderModel identityProvider)
addIdentityProvider
in interface RealmModel
public void removeIdentityProviderByAlias(String alias)
removeIdentityProviderByAlias
in interface RealmModel
public void updateIdentityProvider(IdentityProviderModel identityProvider)
updateIdentityProvider
in interface RealmModel
public UserFederationProviderModel addUserFederationProvider(String providerName, Map<String,String> config, int priority, String displayName, int fullSyncPeriod, int changedSyncPeriod, int lastSync)
addUserFederationProvider
in interface RealmModel
public void removeUserFederationProvider(UserFederationProviderModel provider)
removeUserFederationProvider
in interface RealmModel
public void updateUserFederationProvider(UserFederationProviderModel model)
updateUserFederationProvider
in interface RealmModel
public List<UserFederationProviderModel> getUserFederationProviders()
getUserFederationProviders
in interface RealmModel
public void setUserFederationProviders(List<UserFederationProviderModel> providers)
setUserFederationProviders
in interface RealmModel
public boolean isEventsEnabled()
isEventsEnabled
in interface RealmModel
public void setEventsEnabled(boolean enabled)
setEventsEnabled
in interface RealmModel
public long getEventsExpiration()
getEventsExpiration
in interface RealmModel
public void setEventsExpiration(long expiration)
setEventsExpiration
in interface RealmModel
public Set<String> getEventsListeners()
getEventsListeners
in interface RealmModel
public void setEventsListeners(Set<String> listeners)
setEventsListeners
in interface RealmModel
public Set<String> getEnabledEventTypes()
getEnabledEventTypes
in interface RealmModel
public void setEnabledEventTypes(Set<String> enabledEventTypes)
setEnabledEventTypes
in interface RealmModel
public boolean isAdminEventsEnabled()
isAdminEventsEnabled
in interface RealmModel
public void setAdminEventsEnabled(boolean enabled)
setAdminEventsEnabled
in interface RealmModel
public boolean isAdminEventsDetailsEnabled()
isAdminEventsDetailsEnabled
in interface RealmModel
public void setAdminEventsDetailsEnabled(boolean enabled)
setAdminEventsDetailsEnabled
in interface RealmModel
public ClientModel getMasterAdminClient()
getMasterAdminClient
in interface RealmModel
public void setMasterAdminClient(ClientModel client)
setMasterAdminClient
in interface RealmModel
public MongoRealmEntity getMongoEntity()
getMongoEntity
in class AbstractMongoAdapter<MongoRealmEntity>
public boolean isIdentityFederationEnabled()
isIdentityFederationEnabled
in interface RealmModel
public boolean equals(Object o)
equals
in class AbstractMongoAdapter<MongoRealmEntity>
public int hashCode()
hashCode
in class AbstractMongoAdapter<MongoRealmEntity>
public boolean isInternationalizationEnabled()
isInternationalizationEnabled
in interface RealmModel
public void setInternationalizationEnabled(boolean enabled)
setInternationalizationEnabled
in interface RealmModel
public Set<String> getSupportedLocales()
getSupportedLocales
in interface RealmModel
public void setSupportedLocales(Set<String> locales)
setSupportedLocales
in interface RealmModel
public String getDefaultLocale()
getDefaultLocale
in interface RealmModel
public void setDefaultLocale(String locale)
setDefaultLocale
in interface RealmModel
public Set<IdentityProviderMapperModel> getIdentityProviderMappers()
getIdentityProviderMappers
in interface RealmModel
public Set<IdentityProviderMapperModel> getIdentityProviderMappersByAlias(String brokerAlias)
getIdentityProviderMappersByAlias
in interface RealmModel
public IdentityProviderMapperModel addIdentityProviderMapper(IdentityProviderMapperModel model)
addIdentityProviderMapper
in interface RealmModel
protected IdentityProviderMapperEntity getIdentityProviderMapperEntity(String id)
protected IdentityProviderMapperEntity getIdentityProviderMapperEntityByName(String alias, String name)
public void removeIdentityProviderMapper(IdentityProviderMapperModel mapping)
removeIdentityProviderMapper
in interface RealmModel
public void updateIdentityProviderMapper(IdentityProviderMapperModel mapping)
updateIdentityProviderMapper
in interface RealmModel
public IdentityProviderMapperModel getIdentityProviderMapperById(String id)
getIdentityProviderMapperById
in interface RealmModel
public IdentityProviderMapperModel getIdentityProviderMapperByName(String alias, String name)
getIdentityProviderMapperByName
in interface RealmModel
protected IdentityProviderMapperModel entityToModel(IdentityProviderMapperEntity entity)
public AuthenticationFlowModel getBrowserFlow()
getBrowserFlow
in interface RealmModel
public void setBrowserFlow(AuthenticationFlowModel flow)
setBrowserFlow
in interface RealmModel
public AuthenticationFlowModel getRegistrationFlow()
getRegistrationFlow
in interface RealmModel
public void setRegistrationFlow(AuthenticationFlowModel flow)
setRegistrationFlow
in interface RealmModel
public AuthenticationFlowModel getDirectGrantFlow()
getDirectGrantFlow
in interface RealmModel
public void setDirectGrantFlow(AuthenticationFlowModel flow)
setDirectGrantFlow
in interface RealmModel
public AuthenticationFlowModel getResetCredentialsFlow()
getResetCredentialsFlow
in interface RealmModel
public void setResetCredentialsFlow(AuthenticationFlowModel flow)
setResetCredentialsFlow
in interface RealmModel
public AuthenticationFlowModel getClientAuthenticationFlow()
getClientAuthenticationFlow
in interface RealmModel
public void setClientAuthenticationFlow(AuthenticationFlowModel flow)
setClientAuthenticationFlow
in interface RealmModel
public List<AuthenticationFlowModel> getAuthenticationFlows()
getAuthenticationFlows
in interface RealmModel
public AuthenticationFlowModel getFlowByAlias(String alias)
getFlowByAlias
in interface RealmModel
protected AuthenticationFlowModel entityToModel(AuthenticationFlowEntity entity)
public AuthenticationFlowModel getAuthenticationFlowById(String id)
getAuthenticationFlowById
in interface RealmModel
protected AuthenticationFlowEntity getFlowEntity(String id)
public void removeAuthenticationFlow(AuthenticationFlowModel model)
removeAuthenticationFlow
in interface RealmModel
public void updateAuthenticationFlow(AuthenticationFlowModel model)
updateAuthenticationFlow
in interface RealmModel
public AuthenticationFlowModel addAuthenticationFlow(AuthenticationFlowModel model)
addAuthenticationFlow
in interface RealmModel
public List<AuthenticationExecutionModel> getAuthenticationExecutions(String flowId)
getAuthenticationExecutions
in interface RealmModel
public AuthenticationExecutionModel entityToModel(AuthenticationExecutionEntity entity)
public AuthenticationExecutionModel getAuthenticationExecutionById(String id)
getAuthenticationExecutionById
in interface RealmModel
public AuthenticationExecutionEntity getAuthenticationExecutionEntity(String id)
public AuthenticationExecutionModel addAuthenticatorExecution(AuthenticationExecutionModel model)
addAuthenticatorExecution
in interface RealmModel
public void updateAuthenticatorExecution(AuthenticationExecutionModel model)
updateAuthenticatorExecution
in interface RealmModel
public void removeAuthenticatorExecution(AuthenticationExecutionModel model)
removeAuthenticatorExecution
in interface RealmModel
public List<AuthenticatorConfigModel> getAuthenticatorConfigs()
getAuthenticatorConfigs
in interface RealmModel
public AuthenticatorConfigModel getAuthenticatorConfigByAlias(String alias)
getAuthenticatorConfigByAlias
in interface RealmModel
public AuthenticatorConfigModel addAuthenticatorConfig(AuthenticatorConfigModel model)
addAuthenticatorConfig
in interface RealmModel
public void removeAuthenticatorConfig(AuthenticatorConfigModel model)
removeAuthenticatorConfig
in interface RealmModel
public AuthenticatorConfigModel getAuthenticatorConfigById(String id)
getAuthenticatorConfigById
in interface RealmModel
public AuthenticatorConfigEntity getAuthenticatorConfigEntity(String id)
public AuthenticatorConfigModel entityToModel(AuthenticatorConfigEntity entity)
public void updateAuthenticatorConfig(AuthenticatorConfigModel model)
updateAuthenticatorConfig
in interface RealmModel
public RequiredActionProviderModel addRequiredActionProvider(RequiredActionProviderModel model)
addRequiredActionProvider
in interface RealmModel
public void removeRequiredActionProvider(RequiredActionProviderModel model)
removeRequiredActionProvider
in interface RealmModel
public RequiredActionProviderModel getRequiredActionProviderById(String id)
getRequiredActionProviderById
in interface RealmModel
public RequiredActionProviderModel entityToModel(RequiredActionProviderEntity entity)
public void updateRequiredActionProvider(RequiredActionProviderModel model)
updateRequiredActionProvider
in interface RealmModel
public List<RequiredActionProviderModel> getRequiredActionProviders()
getRequiredActionProviders
in interface RealmModel
public RequiredActionProviderEntity getRequiredActionProviderEntity(String id)
public RequiredActionProviderModel getRequiredActionProviderByAlias(String alias)
getRequiredActionProviderByAlias
in interface RealmModel
public Set<UserFederationMapperModel> getUserFederationMappers()
getUserFederationMappers
in interface RealmModel
public Set<UserFederationMapperModel> getUserFederationMappersByFederationProvider(String federationProviderId)
getUserFederationMappersByFederationProvider
in interface RealmModel
public UserFederationMapperModel addUserFederationMapper(UserFederationMapperModel model)
addUserFederationMapper
in interface RealmModel
protected UserFederationMapperEntity getUserFederationMapperEntity(String id)
protected UserFederationMapperEntity getUserFederationMapperEntityByName(String federationProviderId, String name)
protected Set<UserFederationMapperEntity> getUserFederationMapperEntitiesByFederationProvider(String federationProviderId)
public void removeUserFederationMapper(UserFederationMapperModel mapper)
removeUserFederationMapper
in interface RealmModel
public void updateUserFederationMapper(UserFederationMapperModel mapper)
updateUserFederationMapper
in interface RealmModel
public UserFederationMapperModel getUserFederationMapperById(String id)
getUserFederationMapperById
in interface RealmModel
public UserFederationMapperModel getUserFederationMapperByName(String federationProviderId, String name)
getUserFederationMapperByName
in interface RealmModel
protected UserFederationMapperModel entityToModel(UserFederationMapperEntity entity)
public List<ClientTemplateModel> getClientTemplates()
getClientTemplates
in interface RealmModel
public ClientTemplateModel addClientTemplate(String name)
addClientTemplate
in interface RealmModel
public ClientTemplateModel addClientTemplate(String id, String name)
addClientTemplate
in interface RealmModel
public boolean removeClientTemplate(String id)
removeClientTemplate
in interface RealmModel
public ClientTemplateModel getClientTemplateById(String id)
getClientTemplateById
in interface RealmModel
public ComponentModel addComponentModel(ComponentModel model)
addComponentModel
in interface RealmModel
public void updateComponent(ComponentModel model)
updateComponent
in interface RealmModel
public void removeComponent(ComponentModel component)
removeComponent
in interface RealmModel
public void removeComponents(String parentId)
removeComponents
in interface RealmModel
public List<ComponentModel> getComponents(String parentId, String providerType)
getComponents
in interface RealmModel
protected ComponentModel entityToModel(ComponentEntity entity)
public List<ComponentModel> getComponents()
getComponents
in interface RealmModel
public ComponentModel getComponent(String id)
getComponent
in interface RealmModel
Copyright © 2016 JBoss by Red Hat. All rights reserved.