public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected CollectionService |
collectionService |
protected CommunityService |
communityService |
protected EPersonService |
ePersonService |
protected Group2GroupCacheDAO |
group2GroupCacheDAO |
protected GroupDAO |
groupDAO |
choiceAuthorityService, handleService, metadataAuthorityService, metadataFieldService, metadataValueServiceNAME| Modifier | Constructor and Description |
|---|---|
protected |
GroupServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(Context context,
Group group,
EPerson e)
add an eperson member
|
void |
addMember(Context context,
Group groupParent,
Group groupChild)
add group to this group
|
List<Group> |
allMemberGroups(Context context,
EPerson ePerson)
Get all of the groups that an eperson is a member of.
|
List<EPerson> |
allMembers(Context c,
Group g)
Get all of the epeople who are a member of the
specified group, or a member of a sub-group of the
specified group, etc.
|
int |
countTotal(Context context)
Count the total number of groups in DSpace
|
Group |
create(Context context)
Create a new group
|
void |
delete(Context context,
Group group) |
protected boolean |
epersonInGroup(Context context,
String groupName,
EPerson ePerson) |
Group |
find(Context context,
UUID id)
Generic find for when the precise type of a DSO is not known, just the
a pair of type number and database ID.
|
List<Group> |
findAll(Context context,
int sortField)
Deprecated.
|
List<Group> |
findAll(Context context,
List<MetadataField> metadataSortFields)
Finds all groups in the site
|
Group |
findByIdOrLegacyId(Context context,
String id) |
Group |
findByLegacyId(Context context,
int id)
Generic find for when the precise type of a DSO is not known, just the
a pair of type number and database ID.
|
List<Group> |
findByMetadataField(Context context,
String searchValue,
MetadataField metadataField)
Look up groups based on their value for a certain metadata field (NOTE: name is not stored as metadata)
|
Group |
findByName(Context context,
String name)
Find the group by its name - assumes name is unique
|
protected Set<UUID> |
getChildren(Map<UUID,Set<UUID>> parents,
UUID parent)
Used recursively to generate a map of ALL of the children of the given
parent
|
List<Group> |
getEmptyGroups(Context context)
Find all empty groups in DSpace
|
DSpaceObject |
getParentObject(Context context,
Group group)
Return the dspace object that "own" the current object in the hierarchy.
|
int |
getSupportsTypeConstant()
Returns the Constants which this service supports
|
void |
initDefaultGroupNames(Context context)
Initializes the group names for anonymous & administrator, and marks them
"permanent".
|
boolean |
isDirectMember(Group group,
EPerson ePerson)
check to see if an eperson is a direct member.
|
boolean |
isEmpty(Group group)
Return true if group has no direct or indirect members
|
boolean |
isMember(Context context,
Group group)
fast check to see if an eperson is a member called with eperson id, does
database lookup without instantiating all of the epeople objects and is
thus a static method
|
boolean |
isMember(Context context,
String groupName)
fast check to see if an eperson is a member called with eperson id, does
database lookup without instantiating all of the epeople objects and is
thus a static method
|
boolean |
isMember(Group owningGroup,
Group childGroup)
Check to see if childGroup is a direct group member of owningGroup.
|
void |
removeMember(Context context,
Group group,
EPerson ePerson)
remove an eperson from a group
|
void |
removeMember(Context context,
Group groupParent,
Group childGroup)
remove group from this group
|
protected void |
rethinkGroupCache(Context context,
boolean flushQueries)
Regenerate the group cache AKA the group2groupcache table in the database -
meant to be called when a group is added or removed from another group
|
List<Group> |
search(Context context,
String groupIdentifier)
Find the groups that match the search query across eperson_group_id or name
|
List<Group> |
search(Context context,
String groupIdentifier,
int offset,
int limit)
Find the groups that match the search query across eperson_group_id or name
|
int |
searchResultCount(Context context,
String groupIdentifier)
Returns the total number of groups returned by a specific query, without the overhead
of creating the Group objects to store the results.
|
void |
setName(Group group,
String name)
set name of group
|
void |
update(Context context,
Group group)
Update the group - writing out group object and EPerson list if necessary
|
void |
updateLastModified(Context context,
Group dso) |
addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, getAdminObject, getAuthoritiesAndConfidences, getElements, getElementsFilled, getIdentifiers, getMDValueByField, getMDValueByLegacyField, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getMetadataValuePlace, getName, getTypeText, match, removeMetadataValues, setMetadataSingleValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getTypeText, removeMetadataValues, setMetadataSingleValue@Autowired(required=true) protected GroupDAO groupDAO
@Autowired(required=true) protected Group2GroupCacheDAO group2GroupCacheDAO
@Autowired(required=true) protected CollectionService collectionService
@Autowired(required=true) protected EPersonService ePersonService
@Autowired(required=true) protected CommunityService communityService
@Autowired(required=true) protected AuthorizeService authorizeService
public Group create(Context context) throws SQLException, AuthorizeException
GroupServicecreate in interface GroupServicecontext - DSpace context objectSQLException - if database errorAuthorizeException - if authorization errorpublic void setName(Group group, String name) throws SQLException
GroupServicesetName in interface GroupServicegroup - DSpace groupname - new group nameSQLException - if database errorpublic void addMember(Context context, Group group, EPerson e)
GroupServiceaddMember in interface GroupServicecontext - DSpace context objectgroup - DSpace groupe - epersonpublic void addMember(Context context, Group groupParent, Group groupChild) throws SQLException
GroupServiceaddMember in interface GroupServicecontext - DSpace context objectgroupParent - parent groupgroupChild - child groupSQLException - if database errorpublic void removeMember(Context context, Group group, EPerson ePerson)
GroupServiceremoveMember in interface GroupServicecontext - DSpace context objectgroup - DSpace groupePerson - epersonpublic void removeMember(Context context, Group groupParent, Group childGroup) throws SQLException
GroupServiceremoveMember in interface GroupServicecontext - DSpace context objectgroupParent - parent groupchildGroup - child groupSQLException - if database errorpublic boolean isDirectMember(Group group, EPerson ePerson)
GroupServicefalseisDirectMember in interface GroupServicegroup - DSpace groupePerson - eperson to check membershippublic boolean isMember(Group owningGroup, Group childGroup)
GroupServicefalseisMember in interface GroupServiceowningGroup - parent groupchildGroup - child grouppublic boolean isMember(Context context, Group group) throws SQLException
GroupServiceisMember in interface GroupServicecontext - contextgroup - group to checkSQLException - if database errorpublic boolean isMember(Context context, String groupName) throws SQLException
GroupServiceisMember in interface GroupServicecontext - contextgroupName - the name of the group to checkSQLException - if database errorpublic List<Group> allMemberGroups(Context context, EPerson ePerson) throws SQLException
GroupServiceallMemberGroups in interface GroupServicecontext - DSpace contenxtePerson - ePerson objectSQLException - if database errorpublic List<EPerson> allMembers(Context c, Group g) throws SQLException
GroupServiceallMembers in interface GroupServicec - DSpace contextg - Group objectSQLException - if errorpublic Group find(Context context, UUID id) throws SQLException
DSpaceObjectServicefind in interface DSpaceObjectService<Group>context - - the contextid - - id within table of type'd objectsSQLException - only upon failure accessing the database.public Group findByName(Context context, String name) throws SQLException
GroupServicefindByName in interface GroupServiceSQLException - if error@Deprecated public List<Group> findAll(Context context, int sortField) throws SQLException
findAll(Context context, List<MetadataField> metadataSortFields) insteadfindAll in interface GroupServicecontext - DSpace contextsortField - sort field indexSQLException - if errorpublic List<Group> findAll(Context context, List<MetadataField> metadataSortFields) throws SQLException
GroupServicefindAll in interface GroupServicecontext - DSpace contextmetadataSortFields - metadata fields to sort by, leave empty to sort by NameSQLException - if errorpublic List<Group> search(Context context, String groupIdentifier) throws SQLException
GroupServicesearch in interface GroupServicecontext - DSpace contextgroupIdentifier - The group name or group IDSQLException - if errorpublic List<Group> search(Context context, String groupIdentifier, int offset, int limit) throws SQLException
GroupServicesearch in interface GroupServicecontext - DSpace contextgroupIdentifier - The group name or group IDoffset - Inclusive offsetlimit - Maximum number of matches returnedSQLException - if errorpublic int searchResultCount(Context context, String groupIdentifier) throws SQLException
GroupServicesearchResultCount in interface GroupServicecontext - DSpace contextgroupIdentifier - The search stringSQLException - if errorpublic void delete(Context context, Group group) throws SQLException
delete in interface DSpaceObjectService<Group>SQLExceptionpublic int getSupportsTypeConstant()
DSpaceObjectServicegetSupportsTypeConstant in interface DSpaceObjectLegacySupportService<Group>getSupportsTypeConstant in interface DSpaceObjectService<Group>public boolean isEmpty(Group group)
isEmpty in interface GroupServicegroup - DSpace grouppublic void initDefaultGroupNames(Context context) throws SQLException, AuthorizeException
GroupServiceinitDefaultGroupNames in interface GroupServicecontext - the DSpace contextSQLException - database exceptionAuthorizeException - authorization errorpublic List<Group> getEmptyGroups(Context context) throws SQLException
GroupServicegetEmptyGroups in interface GroupServicecontext - The DSpace contextSQLException - database exceptionpublic void update(Context context, Group group) throws SQLException, AuthorizeException
update in interface DSpaceObjectService<Group>update in class DSpaceObjectServiceImpl<Group>SQLExceptionAuthorizeExceptionprotected boolean epersonInGroup(Context context, String groupName, EPerson ePerson) throws SQLException
SQLExceptionprotected void rethinkGroupCache(Context context, boolean flushQueries) throws SQLException
SQLExceptionpublic DSpaceObject getParentObject(Context context, Group group) throws SQLException
DSpaceObjectServicegetParentObject in interface DSpaceObjectService<Group>getParentObject in class DSpaceObjectServiceImpl<Group>context - DSpace contextgroup - DSpaceObjectSQLException - if database errorpublic void updateLastModified(Context context, Group dso)
updateLastModified in interface DSpaceObjectService<Group>protected Set<UUID> getChildren(Map<UUID,Set<UUID>> parents, UUID parent)
parents - Map of parent,child relationshipsparent - the parent you're interested inpublic Group findByIdOrLegacyId(Context context, String id) throws SQLException
findByIdOrLegacyId in interface DSpaceObjectLegacySupportService<Group>SQLExceptionpublic Group findByLegacyId(Context context, int id) throws SQLException
DSpaceObjectLegacySupportServicefindByLegacyId in interface DSpaceObjectLegacySupportService<Group>context - - the contextid - - the legacy id within table of type'd objectsSQLException - only upon failure accessing the database.public int countTotal(Context context) throws SQLException
GroupServicecountTotal in interface GroupServicecontext - The DSpace contextSQLException - database exceptionpublic List<Group> findByMetadataField(Context context, String searchValue, MetadataField metadataField) throws SQLException
GroupServicefindByMetadataField in interface GroupServicecontext - The DSpace contextsearchValue - The value to matchmetadataField - The metadata field to search inSQLException - database exceptionCopyright © 2016 DuraSpace. All rights reserved.