Interface GroupModel

All Superinterfaces:
Model, RoleMapperModel
All Known Implementing Classes:
GroupAdapter, GroupAdapter

public interface GroupModel extends RoleMapperModel, Model
Version:
$Revision: 1 $
Author:
Bill Burke
  • Field Details

  • Method Details

    • getCreatedTimestamp

      default Long getCreatedTimestamp()
      Get timestamp of group creation. May be null for groups created before this feature introduction.
    • setCreatedTimestamp

      default void setCreatedTimestamp(Long timestamp)
    • getLastModifiedTimestamp

      default Long getLastModifiedTimestamp()
      Get timestamp of last group modification. May be null for groups that have not been modified since this feature was introduced.
    • setLastModifiedTimestamp

      default void setLastModifiedTimestamp(Long timestamp)
    • getId

      String getId()
      Description copied from interface: Model

      Returns the unique identifier of this model. The identifier is generated by the persistence layer and is not supposed to be manually set. It is used internally to identify the model and should not be confused with any user-facing identifier, such as a username or email.

      The identifier is immutable and should not be changed after the model is created.

      Specified by:
      getId in interface Model
      Returns:
      the unique identifier of this model, not null
    • getName

      String getName()
    • setName

      void setName(String name)
    • getDescription

      String getDescription()
    • setDescription

      void setDescription(String description)
    • setSingleAttribute

      void setSingleAttribute(String name, String value)
      Set single value of specified attribute. Remove all other existing values
      Parameters:
      name -
      value -
    • setAttribute

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

      void removeAttribute(String name)
    • getFirstAttribute

      String getFirstAttribute(String name)
      Parameters:
      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

      Stream<String> getAttributeStream(String name)
      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

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

      GroupModel getParent()
    • getParentId

      String getParentId()
    • getSubGroupsStream

      Stream<GroupModel> getSubGroupsStream()
      Returns all sub groups for the parent group as a stream. The stream is sorted by the group name.
      Returns:
      Stream of GroupModel. Never returns null.
    • getSubGroupsStream

      default Stream<GroupModel> getSubGroupsStream(String search, Integer firstResult, Integer maxResults)
      Returns all sub groups for the parent group matching the fuzzy search as a stream, paginated. Stream is sorted by the group name.
      Parameters:
      search - searched string. If empty or null all subgroups are returned.
      Returns:
      Stream of GroupModel. Never returns null.
    • getSubGroupsStream

      default Stream<GroupModel> getSubGroupsStream(Integer firstResult, Integer maxResults)
      Returns all sub groups for the parent group as a stream, paginated.
      Parameters:
      firstResult - First result to return. Ignored if negative or null.
      maxResults - Maximum number of results to return. Ignored if negative or null.
      Returns:
    • getSubGroupsStream

      default Stream<GroupModel> getSubGroupsStream(String search, Boolean exact, Integer firstResult, Integer maxResults)
      Returns all subgroups for the parent group matching the search as a stream, paginated. Stream is sorted by the group name.
      Parameters:
      search - search string. If empty or null all subgroups are returned.
      exact - toggles fuzzy searching
      firstResult - First result to return. Ignored if negative or null.
      maxResults - Maximum number of results to return. Ignored if negative or null.
      Returns:
      Stream of GroupModel. Never returns null.
    • getSubGroupsCount

      default Long getSubGroupsCount()
      Returns the number of groups contained beneath this group.
      Returns:
      The number of groups beneath this group. Never returns null.
    • setParent

      void setParent(GroupModel group)
      You must also call addChild on the parent group, addChild on RealmModel if there is no parent group
      Parameters:
      group -
    • addChild

      void addChild(GroupModel subGroup)
      Automatically calls setParent() on the subGroup
      Parameters:
      subGroup -
    • removeChild

      void removeChild(GroupModel subGroup)
      Automatically calls setParent() on the subGroup
      Parameters:
      subGroup -
    • escapeSlashesInGroupPath

      default boolean escapeSlashesInGroupPath()
    • getType

      default GroupModel.Type getType()
    • getOrganization

      OrganizationModel getOrganization()
      Returns:
      Organization this group belongs to, or null if the group is of GroupModel.Type.REALM.