Class JpaGroup
java.lang.Object
org.opencastproject.security.impl.jpa.JpaGroup
- All Implemented Interfaces:
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 memberbooleanGets the role description.Gets the group identifier.Gets the group membersgetName()Gets the group name.Gets the user's organization.getRole()Gets the group role.Get only the names of the rolesgetRoles()Gets the group's roles.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
Description copied from interface:GroupGets the group identifier.- Specified by:
getGroupIdin interfaceGroup- Returns:
- the group identifier
- See Also:
-
getName
Description copied from interface:GroupGets the group name. -
setName
Sets the group name- Parameters:
name- the name
-
getOrganization
Description copied from interface:GroupGets the user's organization.- Specified by:
getOrganizationin interfaceGroup- Returns:
- the organization
- See Also:
-
getDescription
Description copied from interface:GroupGets the role description.- Specified by:
getDescriptionin interfaceGroup- Returns:
- the description
- See Also:
-
setDescription
Sets the description- Parameters:
description- the description
-
getRole
Description copied from interface:GroupGets the group role. -
getMembers
Description copied from interface:GroupGets the group members- Specified by:
getMembersin interfaceGroup- Returns:
- the group members
-
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
Description copied from interface:GroupGets the group's roles. -
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
-