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