public class InMemoryUserAdapter extends UserModelDefaultMethods.Streams
UserModelDefaultMethods.StreamsUserModel.RequiredAction, UserModel.Streams, UserModel.UserRemovedEventCOMPARE_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 |
|---|
InMemoryUserAdapter(KeycloakSession session,
RealmModel realm,
String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaults() |
void |
addRequiredAction(String action) |
void |
addRequiredAction(UserModel.RequiredAction action) |
protected void |
checkReadonly() |
void |
deleteRoleMapping(RoleModel role)
Removes the given role mapping from this object.
|
boolean |
equals(Object o) |
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 |
getFederationLink() |
String |
getFirstAttribute(String name) |
Stream<GroupModel> |
getGroupsStream()
Obtains the groups associated with the user.
|
String |
getId() |
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.
|
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 |
setEmailVerified(boolean verified) |
void |
setEnabled(boolean enabled) |
void |
setFederationLink(String link) |
void |
setReadonly(boolean flag) |
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.
|
getEmail, getFirstName, getLastName, setEmail, setFirstName, setLastName, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttribute, getGroups, getRequiredActionsgetEmail, getFirstName, getGroups, getGroups, getGroupsCount, getGroupsCountByNameContaining, getGroupsStream, getLastName, setEmail, setFirstName, setLastNamegetClientRoleMappings, getRealmRoleMappings, getRoleMappingspublic InMemoryUserAdapter(KeycloakSession session, RealmModel realm, String id)
public String getUsername()
public void setUsername(String username)
UserModelusername - username stringpublic void addDefaults()
public void setReadonly(boolean flag)
protected void checkReadonly()
public String getId()
public 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 void addRequiredAction(UserModel.RequiredAction action)
public void removeRequiredAction(UserModel.RequiredAction action)
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.