public class GroupAdapter extends Object implements GroupModel, JpaModel<GroupEntity>
GroupModel.GroupRemovedEvent
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected GroupEntity |
group |
protected RealmModel |
realm |
Constructor and Description |
---|
GroupAdapter(RealmModel realm,
javax.persistence.EntityManager em,
GroupEntity group) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup
|
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)
Returns set of client roles that are directly set to this object for the given client.
|
GroupEntity |
getEntity() |
String |
getFirstAttribute(String name) |
protected javax.persistence.TypedQuery<GroupRoleMappingEntity> |
getGroupRoleMappingEntityTypedQuery(RoleModel role) |
String |
getId() |
String |
getName() |
GroupModel |
getParent() |
String |
getParentId() |
Set<RoleModel> |
getRealmRoleMappings()
Returns set of realm roles that are directly set to this object.
|
Set<RoleModel> |
getRoleMappings()
Returns set of all role (both realm all client) that are directly set to this object.
|
Set<GroupModel> |
getSubGroups() |
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. |
void |
removeAttribute(String name) |
void |
removeChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup
|
void |
setAttribute(String name,
List<String> values) |
void |
setName(String name) |
void |
setParent(GroupModel parent)
You must also call addChild on the parent group, addChild on RealmModel if there is no parent group
|
void |
setSingleAttribute(String name,
String value)
Set single value of specified attribute.
|
static GroupEntity |
toEntity(GroupModel model,
javax.persistence.EntityManager em) |
protected GroupEntity group
protected javax.persistence.EntityManager em
protected RealmModel realm
public GroupAdapter(RealmModel realm, javax.persistence.EntityManager em, GroupEntity group)
public GroupEntity getEntity()
getEntity
in interface JpaModel<GroupEntity>
public String getId()
getId
in interface GroupModel
public String getName()
getName
in interface GroupModel
public void setName(String name)
setName
in interface GroupModel
public GroupModel getParent()
getParent
in interface GroupModel
public String getParentId()
getParentId
in interface GroupModel
public static GroupEntity toEntity(GroupModel model, javax.persistence.EntityManager em)
public void setParent(GroupModel parent)
GroupModel
setParent
in interface GroupModel
public void addChild(GroupModel subGroup)
GroupModel
addChild
in interface GroupModel
public void removeChild(GroupModel subGroup)
GroupModel
removeChild
in interface GroupModel
public Set<GroupModel> getSubGroups()
getSubGroups
in interface GroupModel
public void setSingleAttribute(String name, String value)
GroupModel
setSingleAttribute
in interface GroupModel
public void setAttribute(String name, List<String> values)
setAttribute
in interface GroupModel
public void removeAttribute(String name)
removeAttribute
in interface GroupModel
public String getFirstAttribute(String name)
getFirstAttribute
in interface GroupModel
public List<String> getAttribute(String name)
getAttribute
in interface GroupModel
public Map<String,List<String>> getAttributes()
getAttributes
in interface GroupModel
public boolean hasRole(RoleModel role)
RoleMapperModel
true
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 RoleMapperModel
protected javax.persistence.TypedQuery<GroupRoleMappingEntity> getGroupRoleMappingEntityTypedQuery(RoleModel role)
public void grantRole(RoleModel role)
RoleMapperModel
grantRole
in interface RoleMapperModel
public Set<RoleModel> getRealmRoleMappings()
RoleMapperModel
getRealmRoleMappings
in interface RoleMapperModel
public Set<RoleModel> getRoleMappings()
RoleMapperModel
getRoleMappings
in interface RoleMapperModel
public void deleteRoleMapping(RoleModel role)
RoleMapperModel
deleteRoleMapping
in interface RoleMapperModel
role
- Role to removepublic Set<RoleModel> getClientRoleMappings(ClientModel app)
RoleMapperModel
getClientRoleMappings
in interface RoleMapperModel
app
- Client to get the roles forCopyright © 2020 JBoss by Red Hat. All rights reserved.