Class MapGroupAdapter

All Implemented Interfaces:
GroupModel, RoleMapperModel

public abstract class MapGroupAdapter extends AbstractGroupModel<MapGroupEntity>
  • Constructor Details

  • Method Details

    • getId

      public String getId()
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • setSingleAttribute

      public void setSingleAttribute(String name, String value)
      Description copied from interface: GroupModel
      Set single value of specified attribute. Remove all other existing values
    • setAttribute

      public void setAttribute(String name, List<String> values)
    • removeAttribute

      public void removeAttribute(String name)
    • getFirstAttribute

      public String getFirstAttribute(String name)
      Returns:
      null if there is not any value of specified attribute or first value otherwise. Don't throw exception if there are more values of the attribute
    • getAttributeStream

      public Stream<String> getAttributeStream(String name)
      Description copied from interface: GroupModel
      Returns group attributes that match the given name as a stream.
      Parameters:
      name - String Name of the attribute to be used as a filter.
      Returns:
      Stream of all attribute values or empty stream if there are not any values. Never return null.
    • getAttributes

      public Map<String,List<String>> getAttributes()
    • getParent

      public GroupModel getParent()
    • getParentId

      public String getParentId()
    • setParent

      public void setParent(GroupModel group)
      Description copied from interface: GroupModel
      You must also call addChild on the parent group, addChild on RealmModel if there is no parent group
    • addChild

      public void addChild(GroupModel subGroup)
      Description copied from interface: GroupModel
      Automatically calls setParent() on the subGroup
    • removeChild

      public void removeChild(GroupModel subGroup)
      Description copied from interface: GroupModel
      Automatically calls setParent() on the subGroup
    • getRealmRoleMappingsStream

      public Stream<RoleModel> getRealmRoleMappingsStream()
      Description copied from interface: RoleMapperModel
      Returns stream of realm roles that are directly set to this object.
      Returns:
      Stream of RoleModel. Never returns null.
    • getClientRoleMappingsStream

      public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
      Description copied from interface: RoleMapperModel
      Returns stream of client roles that are directly set to this object for the given client.
      Parameters:
      app - ClientModel Client to get the roles for.
      Returns:
      Stream of RoleModel. Never returns null.
    • hasDirectRole

      public boolean hasDirectRole(RoleModel role)
      Description copied from interface: RoleMapperModel
      Returns true, if this object is directly assigned the given role.
      Parameters:
      role - the role
      Returns:
      see description
      See Also:
    • hasRole

      public boolean hasRole(RoleModel role)
      Description copied from interface: RoleMapperModel
      Returns true if this object is directly or indirectly assigned the given role, false otherwise.

      For example, true is returned for hasRole(R) if:

      • R is directly assigned to this object
      • R is indirectly assigned to this object via composites
      • R is not assigned to this object but this object belongs to a group G which is assigned the role R
      • R is not assigned to this object but this object belongs to a group G, and G belongs to group H which is assigned the role R
      Returns:
      see description
      See Also:
    • grantRole

      public void grantRole(RoleModel role)
      Description copied from interface: RoleMapperModel
      Grants the given role to this object.
    • getRoleMappingsStream

      public Stream<RoleModel> getRoleMappingsStream()
      Description copied from interface: RoleMapperModel
      Returns stream of all role (both realm all client) that are directly set to this object.
      Returns:
      Stream of RoleModel. Never returns null.
    • deleteRoleMapping

      public void deleteRoleMapping(RoleModel role)
      Description copied from interface: RoleMapperModel
      Removes the given role mapping from this object.
      Parameters:
      role - Role to remove