public abstract class AbstractUserAdapterFederatedStorage extends Object implements UserModel
UserModel.RequiredAction, UserModel.UserRemovedEvent| Modifier and Type | Field and Description |
|---|---|
static String |
CREATED_TIMESTAMP_ATTRIBUTE |
static String |
EMAIL_ATTRIBUTE |
static String |
EMAIL_VERIFIED_ATTRIBUTE |
static String |
ENABLED_ATTRIBUTE |
static String |
FIRST_NAME_ATTRIBUTE |
static String |
LAST_NAME_ATTRIBUTE |
protected RealmModel |
realm |
protected KeycloakSession |
session |
protected StorageId |
storageId |
protected ComponentModel |
storageProviderModel |
EMAIL, FIRST_NAME, GROUPS, INCLUDE_SERVICE_ACCOUNT, LAST_NAME, LOCALE, USERNAME| Constructor and Description |
|---|
AbstractUserAdapterFederatedStorage(KeycloakSession session,
RealmModel realm,
ComponentModel storageProviderModel) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRequiredAction(String action) |
void |
addRequiredAction(UserModel.RequiredAction action) |
protected boolean |
appendDefaultGroups()
Should the realm's default groups be appended to getGroups() call?
If your storage provider is not managing group mappings then it is recommended that
this method return true
|
protected boolean |
appendDefaultRolesToRoleMappings()
Should the realm's default roles be appended to getRoleMappings() call?
If your storage provider is not managing all role mappings then it is recommended that
this method return true
|
void |
deleteRoleMapping(RoleModel role)
Removes the given role mapping from this object.
|
boolean |
equals(Object o) |
List<String> |
getAttribute(String name) |
Map<String,List<String>> |
getAttributes() |
Set<RoleModel> |
getClientRoleMappings(ClientModel app)
Gets role mappings from federated storage and automatically appends default roles.
|
Long |
getCreatedTimestamp()
Get timestamp of user creation.
|
String |
getEmail() |
protected Set<RoleModel> |
getFederatedRoleMappings() |
UserFederatedStorageProvider |
getFederatedStorage() |
String |
getFederationLink()
This method should not be overriden
|
String |
getFirstAttribute(String name) |
String |
getFirstName() |
Set<GroupModel> |
getGroups()
Gets groups from federated storage and automatically appends default groups of realm.
|
protected Set<GroupModel> |
getGroupsInternal()
Get group membership mappings that are managed by this storage provider
|
String |
getId()
Defaults to 'f:' + storageProvider.getId() + ':' + getUsername()
|
String |
getLastName() |
Set<RoleModel> |
getRealmRoleMappings()
Gets role mappings from federated storage and automatically appends default roles.
|
Set<String> |
getRequiredActions() |
Set<RoleModel> |
getRoleMappings()
Gets role mappings from federated storage and automatically appends default roles.
|
protected Set<RoleModel> |
getRoleMappingsInternal() |
String |
getServiceAccountClientLink()
This method should not be overriden
|
void |
grantRole(RoleModel role)
Grants the given role to this object.
|
int |
hashCode() |
boolean |
hasRole(RoleModel role)
Returns
true if this object is directly or indirectly assigned the given role, false otherwise. |
boolean |
isEmailVerified() |
boolean |
isEnabled() |
boolean |
isMemberOf(GroupModel group) |
void |
joinGroup(GroupModel group) |
void |
leaveGroup(GroupModel group) |
void |
removeAttribute(String name) |
void |
removeRequiredAction(String action) |
void |
removeRequiredAction(UserModel.RequiredAction action) |
void |
setAttribute(String name,
List<String> values) |
void |
setCreatedTimestamp(Long timestamp) |
void |
setEmail(String email)
Stores as attribute in federated storage.
|
void |
setEmailVerified(boolean verified)
Stores as attribute in federated storage.
|
void |
setEnabled(boolean enabled) |
void |
setFederationLink(String link)
This method should not be overriden
|
void |
setFirstName(String firstName)
Stores as attribute in federated storage.
|
void |
setLastName(String lastName)
Stores as attribute in federated storage.
|
void |
setServiceAccountClientLink(String clientInternalId)
This method should not be overriden
|
void |
setSingleAttribute(String name,
String value)
Set single value of specified attribute.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetGroups, getGroups, getGroupsCount, getGroupsCountByNameContaining, getUsername, setUsernamepublic static String FIRST_NAME_ATTRIBUTE
public static String LAST_NAME_ATTRIBUTE
public static String EMAIL_ATTRIBUTE
public static String EMAIL_VERIFIED_ATTRIBUTE
public static String CREATED_TIMESTAMP_ATTRIBUTE
public static String ENABLED_ATTRIBUTE
protected KeycloakSession session
protected RealmModel realm
protected ComponentModel storageProviderModel
protected StorageId storageId
public AbstractUserAdapterFederatedStorage(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel)
public UserFederatedStorageProvider getFederatedStorage()
public Set<String> getRequiredActions()
getRequiredActions in interface UserModelpublic void addRequiredAction(String action)
addRequiredAction in interface UserModelpublic void removeRequiredAction(String action)
removeRequiredAction in interface UserModelpublic void addRequiredAction(UserModel.RequiredAction action)
addRequiredAction in interface UserModelpublic void removeRequiredAction(UserModel.RequiredAction action)
removeRequiredAction in interface UserModelprotected Set<GroupModel> getGroupsInternal()
protected boolean appendDefaultGroups()
public Set<GroupModel> getGroups()
public void joinGroup(GroupModel group)
public void leaveGroup(GroupModel group)
leaveGroup in interface UserModelpublic boolean isMemberOf(GroupModel group)
isMemberOf in interface UserModelpublic Set<RoleModel> getRealmRoleMappings()
getRealmRoleMappings in interface RoleMapperModelpublic Set<RoleModel> getClientRoleMappings(ClientModel app)
getClientRoleMappings in interface RoleMapperModelapp - Client to get the roles forpublic boolean hasRole(RoleModel role)
RoleMapperModeltrue if this object is directly or indirectly assigned the given role, false otherwise.
For example, true is returned for hasRole(R) if:
hasRole in interface RoleMapperModelpublic void grantRole(RoleModel role)
RoleMapperModelgrantRole in interface RoleMapperModelprotected boolean appendDefaultRolesToRoleMappings()
public Set<RoleModel> getRoleMappings()
getRoleMappings in interface RoleMapperModelpublic void deleteRoleMapping(RoleModel role)
RoleMapperModeldeleteRoleMapping in interface RoleMapperModelrole - Role to removepublic void setEnabled(boolean enabled)
setEnabled in interface UserModelpublic String getFederationLink()
getFederationLink in interface UserModelpublic void setFederationLink(String link)
setFederationLink in interface UserModelpublic String getServiceAccountClientLink()
getServiceAccountClientLink in interface UserModelpublic void setServiceAccountClientLink(String clientInternalId)
setServiceAccountClientLink in interface UserModelpublic String getId()
public Long getCreatedTimestamp()
UserModelgetCreatedTimestamp in interface UserModelpublic void setCreatedTimestamp(Long timestamp)
setCreatedTimestamp in interface UserModelpublic void setSingleAttribute(String name, String value)
UserModelsetSingleAttribute in interface UserModelpublic void removeAttribute(String name)
removeAttribute in interface UserModelpublic void setAttribute(String name, List<String> values)
setAttribute in interface UserModelpublic String getFirstAttribute(String name)
getFirstAttribute in interface UserModelpublic Map<String,List<String>> getAttributes()
getAttributes in interface UserModelpublic List<String> getAttribute(String name)
getAttribute in interface UserModelpublic String getFirstName()
getFirstName in interface UserModelpublic void setFirstName(String firstName)
setFirstName in interface UserModelfirstName - public String getLastName()
getLastName in interface UserModelpublic void setLastName(String lastName)
setLastName in interface UserModellastName - public void setEmail(String email)
public boolean isEmailVerified()
isEmailVerified in interface UserModelpublic void setEmailVerified(boolean verified)
setEmailVerified in interface UserModelverified - Copyright © 2019 JBoss by Red Hat. All rights reserved.