public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> implements RealmModel
Modifier and Type | Field and Description |
---|---|
protected PrivateKey |
privateKey |
protected PublicKey |
publicKey |
invocationContext
Constructor and Description |
---|
RealmAdapter(MongoRealmEntity realmEntity,
MongoStoreInvocationContext invocationContext) |
equals, getMongoStore, hashCode, updateMongoEntity
protected transient volatile PublicKey publicKey
protected transient volatile PrivateKey privateKey
public RealmAdapter(MongoRealmEntity realmEntity, MongoStoreInvocationContext invocationContext)
public String getId()
getId
in interface RealmModel
public String getName()
getName
in interface RealmModel
public void setName(String name)
setName
in interface RealmModel
public boolean isEnabled()
isEnabled
in interface RealmModel
public void setEnabled(boolean enabled)
setEnabled
in interface RealmModel
public boolean isSslNotRequired()
isSslNotRequired
in interface RealmModel
public void setSslNotRequired(boolean sslNotRequired)
setSslNotRequired
in interface RealmModel
public boolean isPasswordCredentialGrantAllowed()
isPasswordCredentialGrantAllowed
in interface RealmModel
public void setPasswordCredentialGrantAllowed(boolean passwordCredentialGrantAllowed)
setPasswordCredentialGrantAllowed
in interface RealmModel
public boolean isRegistrationAllowed()
isRegistrationAllowed
in interface RealmModel
public void setRegistrationAllowed(boolean registrationAllowed)
setRegistrationAllowed
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 isSocial()
isSocial
in interface RealmModel
public void setSocial(boolean social)
setSocial
in interface RealmModel
public boolean isUpdateProfileOnInitialSocialLogin()
isUpdateProfileOnInitialSocialLogin
in interface RealmModel
public void setUpdateProfileOnInitialSocialLogin(boolean updateProfileOnInitialSocialLogin)
setUpdateProfileOnInitialSocialLogin
in interface RealmModel
public PasswordPolicy getPasswordPolicy()
getPasswordPolicy
in interface RealmModel
public void setPasswordPolicy(PasswordPolicy policy)
setPasswordPolicy
in interface RealmModel
public int getNotBefore()
RealmModel
getNotBefore
in interface RealmModel
public void setNotBefore(int notBefore)
setNotBefore
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 getAccessTokenLifespan()
getAccessTokenLifespan
in interface RealmModel
public void setAccessTokenLifespan(int tokenLifespan)
setAccessTokenLifespan
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 String getPublicKeyPem()
getPublicKeyPem
in interface RealmModel
public void setPublicKeyPem(String publicKeyPem)
setPublicKeyPem
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 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 UserAdapter getUser(String name)
getUser
in interface RealmModel
public UsernameLoginFailureAdapter getUserLoginFailure(String name)
getUserLoginFailure
in interface RealmModel
public UsernameLoginFailureAdapter addUserLoginFailure(String username)
addUserLoginFailure
in interface RealmModel
public List<UsernameLoginFailureModel> getAllUserLoginFailures()
getAllUserLoginFailures
in interface RealmModel
public UserModel getUserByEmail(String email)
getUserByEmail
in interface RealmModel
public UserModel getUserById(String id)
getUserById
in interface RealmModel
public UserAdapter addUser(String username)
addUser
in interface RealmModel
public UserAdapter addUser(String id, String username)
addUser
in interface RealmModel
protected UserAdapter addUserEntity(String id, String username)
public boolean removeUser(String name)
removeUser
in interface RealmModel
public RoleAdapter 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 List<String> getDefaultRoles()
getDefaultRoles
in interface RealmModel
public void addDefaultRole(String name)
addDefaultRole
in interface RealmModel
public void updateDefaultRoles(String[] defaultRoles)
updateDefaultRoles
in interface RealmModel
public ClientModel findClient(String clientId)
findClient
in interface RealmModel
public ClientModel findClientById(String id)
findClientById
in interface RealmModel
public ApplicationModel getApplicationById(String id)
getApplicationById
in interface RealmModel
public ApplicationModel getApplicationByName(String name)
getApplicationByName
in interface RealmModel
public Map<String,ApplicationModel> getApplicationNameMap()
getApplicationNameMap
in interface RealmModel
public List<ApplicationModel> getApplications()
getApplications
in interface RealmModel
public ApplicationModel addApplication(String name)
addApplication
in interface RealmModel
public ApplicationModel addApplication(String id, String name)
addApplication
in interface RealmModel
public boolean removeApplication(String id)
removeApplication
in interface RealmModel
public boolean hasRole(UserModel user, RoleModel role)
hasRole
in interface RoleMapperModel
public void grantRole(UserModel user, RoleModel role)
grantRole
in interface RoleMapperModel
public Set<RoleModel> getRoleMappings(UserModel user)
getRoleMappings
in interface RoleMapperModel
public Set<RoleModel> getRealmRoleMappings(UserModel user)
getRealmRoleMappings
in interface RealmModel
public void deleteRoleMapping(UserModel user, RoleModel role)
deleteRoleMapping
in interface RoleMapperModel
public Set<RoleModel> getScopeMappings(ClientModel client)
getScopeMappings
in interface ScopeMapperModel
public Set<RoleModel> getRealmScopeMappings(ClientModel client)
getRealmScopeMappings
in interface RealmModel
public boolean hasScope(ClientModel client, RoleModel role)
hasScope
in interface RealmModel
public void addScopeMapping(ClientModel client, RoleModel role)
addScopeMapping
in interface ScopeMapperModel
public void deleteScopeMapping(ClientModel client, RoleModel role)
deleteScopeMapping
in interface ScopeMapperModel
public OAuthClientModel addOAuthClient(String name)
addOAuthClient
in interface RealmModel
public OAuthClientModel addOAuthClient(String id, String name)
addOAuthClient
in interface RealmModel
public boolean removeOAuthClient(String id)
removeOAuthClient
in interface RealmModel
public OAuthClientModel getOAuthClient(String name)
getOAuthClient
in interface RealmModel
public OAuthClientModel getOAuthClientById(String id)
getOAuthClientById
in interface RealmModel
public List<OAuthClientModel> getOAuthClients()
getOAuthClients
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)
public boolean validatePassword(UserModel user, String password)
validatePassword
in interface RealmModel
public boolean validateTOTP(UserModel user, String password, String token)
validateTOTP
in interface RealmModel
public void updateCredential(UserModel user, UserCredentialModel cred)
updateCredential
in interface RealmModel
public List<UserCredentialValueModel> getCredentialsDirectly(UserModel user)
getCredentialsDirectly
in interface RealmModel
public void updateCredentialDirectly(UserModel user, UserCredentialValueModel credModel)
updateCredentialDirectly
in interface RealmModel
public UserModel getUserBySocialLink(SocialLinkModel socialLink)
getUserBySocialLink
in interface RealmModel
public Set<SocialLinkModel> getSocialLinks(UserModel user)
getSocialLinks
in interface RealmModel
public SocialLinkModel getSocialLink(UserModel user, String socialProvider)
getSocialLink
in interface RealmModel
public void addSocialLink(UserModel user, SocialLinkModel socialLink)
addSocialLink
in interface RealmModel
public boolean removeSocialLink(UserModel user, String socialProvider)
removeSocialLink
in interface RealmModel
public AuthenticationLinkModel getAuthenticationLink(UserModel user)
getAuthenticationLink
in interface RealmModel
public void setAuthenticationLink(UserModel user, AuthenticationLinkModel authenticationLink)
setAuthenticationLink
in interface RealmModel
protected void updateRealm()
protected RequiredCredentialModel initRequiredCredentialModel(String type)
public List<UserModel> getUsers()
getUsers
in interface RealmModel
public List<UserModel> searchForUser(String search)
searchForUser
in interface RealmModel
public List<UserModel> searchForUserByAttributes(Map<String,String> attributes)
searchForUserByAttributes
in interface RealmModel
protected List<UserModel> convertUserEntities(List<MongoUserEntity> userEntities)
public Map<String,String> getSmtpConfig()
getSmtpConfig
in interface RealmModel
public void setSmtpConfig(Map<String,String> smtpConfig)
setSmtpConfig
in interface RealmModel
public Map<String,String> getSocialConfig()
getSocialConfig
in interface RealmModel
public void setSocialConfig(Map<String,String> socialConfig)
setSocialConfig
in interface RealmModel
public Map<String,String> getLdapServerConfig()
getLdapServerConfig
in interface RealmModel
public void setLdapServerConfig(Map<String,String> ldapServerConfig)
setLdapServerConfig
in interface RealmModel
public List<AuthenticationProviderModel> getAuthenticationProviders()
getAuthenticationProviders
in interface RealmModel
public void setAuthenticationProviders(List<AuthenticationProviderModel> authenticationProviders)
setAuthenticationProviders
in interface RealmModel
public boolean isAuditEnabled()
isAuditEnabled
in interface RealmModel
public void setAuditEnabled(boolean enabled)
setAuditEnabled
in interface RealmModel
public long getAuditExpiration()
getAuditExpiration
in interface RealmModel
public void setAuditExpiration(long expiration)
setAuditExpiration
in interface RealmModel
public Set<String> getAuditListeners()
getAuditListeners
in interface RealmModel
public void setAuditListeners(Set<String> listeners)
setAuditListeners
in interface RealmModel
public ApplicationModel getMasterAdminApp()
getMasterAdminApp
in interface RealmModel
public void setMasterAdminApp(ApplicationModel app)
setMasterAdminApp
in interface RealmModel
public MongoRealmEntity getMongoEntity()
getMongoEntity
in class AbstractMongoAdapter<MongoRealmEntity>
public UserSessionModel createUserSession(UserModel user, String ipAddress)
createUserSession
in interface RealmModel
public UserSessionModel getUserSession(String id)
getUserSession
in interface RealmModel
public List<UserSessionModel> getUserSessions(UserModel user)
getUserSessions
in interface RealmModel
public void removeUserSession(UserSessionModel session)
removeUserSession
in interface RealmModel
public void removeUserSessions(UserModel user)
removeUserSessions
in interface RealmModel
public void removeUserSessions()
removeUserSessions
in interface RealmModel
public void removeExpiredUserSessions()
removeExpiredUserSessions
in interface RealmModel
Copyright © 2014. All Rights Reserved.