public abstract class MapUserAdapter extends AbstractUserModel<MapUserEntity>
UserModel.RequiredAction, UserModel.Streams, UserModel.UserRemovedEvententity, realm, sessionCOMPARE_BY_USERNAME, EMAIL, EMAIL_VERIFIED, ENABLED, EXACT, FIRST_NAME, GROUPS, IDP_ALIAS, IDP_USER_ID, INCLUDE_SERVICE_ACCOUNT, LAST_NAME, LOCALE, SEARCH, USERNAME| Constructor and Description |
|---|
MapUserAdapter(KeycloakSession session,
RealmModel realm,
MapUserEntity entity) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRequiredAction(String action) |
abstract boolean |
checkEmailUniqueness(RealmModel realm,
String email) |
abstract boolean |
checkUsernameUniqueness(RealmModel realm,
String username) |
void |
deleteRoleMapping(RoleModel role)
Removes the given role mapping from this object.
|
Map<String,List<String>> |
getAttributes() |
Stream<String> |
getAttributeStream(String name)
Obtains all values associated with the specified attribute name.
|
Stream<RoleModel> |
getClientRoleMappingsStream(ClientModel app)
Returns stream of client roles that are directly set to this object for the given client.
|
Long |
getCreatedTimestamp()
Get timestamp of user creation.
|
String |
getEmail() |
String |
getFederationLink() |
String |
getFirstAttribute(String name) |
String |
getFirstName() |
Stream<GroupModel> |
getGroupsStream()
Obtains the groups associated with the user.
|
String |
getId() |
String |
getLastName() |
Stream<RoleModel> |
getRealmRoleMappingsStream()
Returns stream of realm roles that are directly set to this object.
|
Stream<String> |
getRequiredActionsStream()
Obtains the names of required actions associated with the user.
|
Stream<RoleModel> |
getRoleMappingsStream()
Returns stream of all role (both realm all client) that are directly set to this object.
|
String |
getServiceAccountClientLink() |
String |
getUsername() |
void |
grantRole(RoleModel role)
Grants the given role to this object.
|
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 |
setAttribute(String name,
List<String> values) |
void |
setCreatedTimestamp(Long timestamp) |
void |
setEmail(String email)
Sets email for this user.
|
void |
setEmailVerified(boolean verified) |
void |
setEnabled(boolean enabled) |
void |
setFederationLink(String link) |
void |
setFirstName(String firstName) |
void |
setLastName(String lastName) |
void |
setServiceAccountClientLink(String clientInternalId) |
void |
setSingleAttribute(String name,
String value)
Set single value of specified attribute.
|
void |
setUsername(String username)
Sets username for this user.
|
equals, hashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetAttribute, getGroups, getRequiredActionsaddRequiredAction, getGroups, getGroups, getGroupsCount, getGroupsCountByNameContaining, getGroupsStream, removeRequiredActiongetClientRoleMappings, getRealmRoleMappings, getRoleMappingspublic MapUserAdapter(KeycloakSession session, RealmModel realm, MapUserEntity entity)
public String getId()
public String getUsername()
public void setUsername(String username)
UserModelusername - username stringpublic Long getCreatedTimestamp()
UserModelpublic void setCreatedTimestamp(Long timestamp)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public void setSingleAttribute(String name, String value)
UserModelpublic void removeAttribute(String name)
public String getFirstAttribute(String name)
public Stream<String> getAttributeStream(String name)
UserModelname - the name of the attribute.Stream of attribute values.public Stream<String> getRequiredActionsStream()
UserModelStream of required action names.public void addRequiredAction(String action)
public void removeRequiredAction(String action)
public String getFirstName()
public void setFirstName(String firstName)
public String getLastName()
public void setLastName(String lastName)
public String getEmail()
public void setEmail(String email)
UserModelemail - the emailpublic abstract boolean checkEmailUniqueness(RealmModel realm, String email)
public abstract boolean checkUsernameUniqueness(RealmModel realm, String username)
public boolean isEmailVerified()
public void setEmailVerified(boolean verified)
public Stream<GroupModel> getGroupsStream()
UserModelStream of groups.public void joinGroup(GroupModel group)
public void leaveGroup(GroupModel group)
public boolean isMemberOf(GroupModel group)
public String getFederationLink()
public void setFederationLink(String link)
public String getServiceAccountClientLink()
public void setServiceAccountClientLink(String clientInternalId)
public Stream<RoleModel> getRealmRoleMappingsStream()
RoleMapperModelRoleModelpublic Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
RoleMapperModelapp - Client to get the roles forRoleModelpublic 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:
public void grantRole(RoleModel role)
RoleMapperModelpublic Stream<RoleModel> getRoleMappingsStream()
RoleMapperModelRoleModelpublic void deleteRoleMapping(RoleModel role)
RoleMapperModelrole - Role to removeCopyright © 2021 JBoss by Red Hat. All rights reserved.