Class JpaGroup
java.lang.Object
org.opencastproject.security.impl.jpa.JpaGroup
- All Implemented Interfaces:
org.opencastproject.security.api.Group
@Entity
public final class JpaGroup
extends Object
implements org.opencastproject.security.api.Group
JPA-annotated group object.
-
Field Summary
Fields inherited from interface org.opencastproject.security.api.Group
ROLE_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionJpaGroup()No-arg constructor needed by JPAJpaGroup(String groupId, JpaOrganization organization, String name, String description) Constructs a group with the specified groupId, name, description and group role.JpaGroup(String groupId, JpaOrganization organization, String name, String description, Set<JpaRole> roles) Constructs a group with the specified groupId, name, description, group role and roles.JpaGroup(String groupId, JpaOrganization organization, String name, String description, Set<JpaRole> roles, Set<String> members) Constructs a group with the specified groupId, name, description, group role and roles. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a memberbooleangetName()getRole()Get only the names of the rolesSet<org.opencastproject.security.api.Role> getRoles()inthashCode()voidremoveMember(String member) Remove a membervoidsetDescription(String description) Sets the descriptionvoidsetMembers(Set<String> members) Sets the membersvoidSets the group namevoidSets the rolestoString()
-
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 idorganization- the organizationname- the namedescription- 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 idorganization- the organizationname- the namedescription- the descriptionroles- 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 idorganization- the organizationname- the namedescription- the descriptionroles- the additional group rolesmembers- the group members- Throws:
IllegalArgumentException- if group id or name is longer than 128 Bytes
-
-
Method Details
-
getGroupId
- Specified by:
getGroupIdin interfaceorg.opencastproject.security.api.Group- See Also:
-
getName
- Specified by:
getNamein interfaceorg.opencastproject.security.api.Group- See Also:
-
setName
Sets the group name- Parameters:
name- the name
-
getOrganization
- Specified by:
getOrganizationin interfaceorg.opencastproject.security.api.Group- See Also:
-
getDescription
- Specified by:
getDescriptionin interfaceorg.opencastproject.security.api.Group- See Also:
-
setDescription
Sets the description- Parameters:
description- the description
-
getRole
- Specified by:
getRolein interfaceorg.opencastproject.security.api.Group
-
getMembers
- Specified by:
getMembersin interfaceorg.opencastproject.security.api.Group
-
setMembers
Sets the members- Parameters:
members- the members
-
addMember
Add a member- Parameters:
member- The member's name.
-
removeMember
Remove a member- Parameters:
member- The member's name.
-
getRoles
- Specified by:
getRolesin interfaceorg.opencastproject.security.api.Group
-
getRoleNames
Get only the names of the roles- Returns:
- the role names in a set
-
setRoles
Sets the roles- Parameters:
roles- the roles
-
hashCode
public int hashCode() -
equals
-
toString
-