Package org.keycloak.models.map.role
Class MapRoleAdapter
- java.lang.Object
-
- org.keycloak.models.map.role.AbstractRoleModel<MapRoleEntity>
-
- org.keycloak.models.map.role.MapRoleAdapter
-
- All Implemented Interfaces:
RoleModel
public class MapRoleAdapter extends AbstractRoleModel<MapRoleEntity> implements RoleModel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.RoleModel
RoleModel.RoleNameChangeEvent, RoleModel.SearchableFields
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.role.AbstractRoleModel
entity, realm, session
-
-
Constructor Summary
Constructors Constructor Description MapRoleAdapter(KeycloakSession session, RealmModel realm, MapRoleEntity entity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompositeRole(RoleModel role)Map<String,List<String>>getAttributes()Stream<String>getAttributeStream(String name)Returns all role's attributes that match the given name as a stream.Stream<RoleModel>getCompositesStream()Returns all composite roles as a stream.Stream<RoleModel>getCompositesStream(String search, Integer first, Integer max)Returns a paginated stream of composite roles ofthisrole that contain given string in its name.RoleContainerModelgetContainer()StringgetContainerId()StringgetDescription()StringgetId()StringgetName()booleanhasRole(RoleModel role)booleanisClientRole()booleanisComposite()voidremoveAttribute(String name)voidremoveCompositeRole(RoleModel role)voidsetAttribute(String name, List<String> values)voidsetDescription(String description)voidsetName(String name)voidsetSingleAttribute(String name, String value)StringtoString()-
Methods inherited from class org.keycloak.models.map.role.AbstractRoleModel
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.RoleModel
getFirstAttribute
-
-
-
-
Constructor Detail
-
MapRoleAdapter
public MapRoleAdapter(KeycloakSession session, RealmModel realm, MapRoleEntity entity)
-
-
Method Detail
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceRoleModel
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfaceRoleModel
-
isComposite
public boolean isComposite()
- Specified by:
isCompositein interfaceRoleModel
-
getCompositesStream
public Stream<RoleModel> getCompositesStream()
Description copied from interface:RoleModelReturns all composite roles as a stream.- Specified by:
getCompositesStreamin interfaceRoleModel- Returns:
- Stream of
RoleModel. Never returnsnull.
-
getCompositesStream
public Stream<RoleModel> getCompositesStream(String search, Integer first, Integer max)
Description copied from interface:RoleModelReturns a paginated stream of composite roles ofthisrole that contain given string in its name.- Specified by:
getCompositesStreamin interfaceRoleModel- Parameters:
search- Case-insensitive search stringfirst- Index of the first result to return. Ignored if negative ornull.max- Maximum number of results to return. Ignored if negative ornull.- Returns:
- A stream of requested roles ordered by the role name
-
addCompositeRole
public void addCompositeRole(RoleModel role)
- Specified by:
addCompositeRolein interfaceRoleModel
-
removeCompositeRole
public void removeCompositeRole(RoleModel role)
- Specified by:
removeCompositeRolein interfaceRoleModel
-
isClientRole
public boolean isClientRole()
- Specified by:
isClientRolein interfaceRoleModel
-
getContainerId
public String getContainerId()
- Specified by:
getContainerIdin interfaceRoleModel
-
getContainer
public RoleContainerModel getContainer()
- Specified by:
getContainerin interfaceRoleModel
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttributein interfaceRoleModel
-
setSingleAttribute
public void setSingleAttribute(String name, String value)
- Specified by:
setSingleAttributein interfaceRoleModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceRoleModel
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributesin interfaceRoleModel
-
getAttributeStream
public Stream<String> getAttributeStream(String name)
Description copied from interface:RoleModelReturns all role's attributes that match the given name as a stream.- Specified by:
getAttributeStreamin interfaceRoleModel- Parameters:
name-StringName of an attribute to be used as a filter.- Returns:
- Stream of
String. Never returnsnull.
-
-