Class JpaGroup

java.lang.Object
org.opencastproject.security.impl.jpa.JpaGroup
All Implemented Interfaces:
Group

@Entity public final class JpaGroup extends Object implements Group
JPA-annotated group object.
  • Constructor Details

    • JpaGroup

      public JpaGroup()
      No-arg constructor needed by JPA
    • JpaGroup

      public JpaGroup(String groupId, JpaOrganization organization, String name, String description) throws IllegalArgumentException
      Constructs a group with the specified groupId, name, description and group role.
      Parameters:
      groupId - the group id
      organization - the organization
      name - the name
      description - the description
      Throws:
      IllegalArgumentException - if group id or name is longer than 128 Bytes
    • JpaGroup

      public JpaGroup(String groupId, JpaOrganization organization, String name, String description, Set<JpaRole> roles) throws IllegalArgumentException
      Constructs a group with the specified groupId, name, description, group role and roles.
      Parameters:
      groupId - the group id
      organization - the organization
      name - the name
      description - the description
      roles - the additional group roles
      Throws:
      IllegalArgumentException - if group id or name is longer than 128 Bytes
    • JpaGroup

      public JpaGroup(String groupId, JpaOrganization organization, String name, String description, Set<JpaRole> roles, Set<String> members) throws IllegalArgumentException
      Constructs a group with the specified groupId, name, description, group role and roles.
      Parameters:
      groupId - the group id
      organization - the organization
      name - the name
      description - the description
      roles - the additional group roles
      members - the group members
      Throws:
      IllegalArgumentException - if group id or name is longer than 128 Bytes
  • Method Details

    • getGroupId

      public String getGroupId()
      Description copied from interface: Group
      Gets the group identifier.
      Specified by:
      getGroupId in interface Group
      Returns:
      the group identifier
      See Also:
    • getName

      public String getName()
      Description copied from interface: Group
      Gets the group name.
      Specified by:
      getName in interface Group
      Returns:
      the group name
      See Also:
    • setName

      public void setName(String name)
      Sets the group name
      Parameters:
      name - the name
    • getOrganization

      public JpaOrganization getOrganization()
      Description copied from interface: Group
      Gets the user's organization.
      Specified by:
      getOrganization in interface Group
      Returns:
      the organization
      See Also:
    • getDescription

      public String getDescription()
      Description copied from interface: Group
      Gets the role description.
      Specified by:
      getDescription in interface Group
      Returns:
      the description
      See Also:
    • setDescription

      public void setDescription(String description)
      Sets the description
      Parameters:
      description - the description
    • getRole

      public String getRole()
      Description copied from interface: Group
      Gets the group role.
      Specified by:
      getRole in interface Group
      Returns:
      the group role
    • getMembers

      public Set<String> getMembers()
      Description copied from interface: Group
      Gets the group members
      Specified by:
      getMembers in interface Group
      Returns:
      the group members
    • setMembers

      public void setMembers(Set<String> members)
      Sets the members
      Parameters:
      members - the members
    • addMember

      public void addMember(String member)
      Add a member
      Parameters:
      member - The member's name.
    • removeMember

      public void removeMember(String member)
      Remove a member
      Parameters:
      member - The member's name.
    • getRoles

      public Set<Role> getRoles()
      Description copied from interface: Group
      Gets the group's roles.
      Specified by:
      getRoles in interface Group
      Returns:
      the group's roles
    • getRoleNames

      public Set<String> getRoleNames()
      Get only the names of the roles
      Returns:
      the role names in a set
    • setRoles

      public void setRoles(Set<JpaRole> roles)
      Sets the roles
      Parameters:
      roles - the roles
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object