@Component(value="mockService") public class MockServiceImpl extends Object implements PersonService, GroupService, ConfigurableGroupProvider, GroupProviderConfiguration
GroupProviderConfiguration.ServiceINTERNAL_GROUP_PATTERN| Constructor and Description |
|---|
MockServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(Group20 group) |
void |
addPerson(Person person) |
void |
addPersonToGroup(String personId,
String groupId) |
Group20Entry |
addUrnPartForGrouper(List<GroupProvider> groupProviders,
Group20Entry group20Entry)
Add to all the groups the conext urn part for grouper
|
String |
cutOffUrnPartForGrouper(List<GroupProvider> groupProviders,
String groupId)
Strip the urn part off the groupId
|
List<GroupProvider> |
getAllGroupProviders()
Get all group providers
|
List<GroupProvider> |
getAllowedGroupProviders(GroupProviderConfiguration.Service service,
String spEntityId,
List<GroupProvider> allGroupProviders)
Get all GroupProviders that have the correct ACL configured based on the
Service.
|
GroupEntry |
getGroup(String userId,
String groupId,
String onBehalfOf)
Get specific Group
|
Group20 |
getGroup20(GroupProvider groupProvider,
String userId,
String groupId)
Get a single group
|
Group20Entry |
getGroup20(String userId,
String groupId,
String onBehalfOf)
Get specific Group
|
Group20Entry |
getGroup20Entry(GroupProvider groupProvider,
String userId,
int limit,
int offset) |
GroupMembersEntry |
getGroupMembers(String groupId,
String onBehalfOf,
String spEntityId,
Integer count,
Integer startIndex,
String sortBy)
Get the group members of the given group.
|
GroupMembersEntry |
getGroupMembersEntry(GroupProvider groupProvider,
String onBehalfOf,
String groupId,
int limit,
int offset)
Gets group members with paginating information for the user's oauth
configuration
|
GroupEntry |
getGroups(String userId,
String onBehalfOf,
Integer count,
Integer startIndex,
String sortBy)
Get Persons' Groups
|
Group20Entry |
getGroups20(String userId,
String onBehalfOf,
Integer count,
Integer startIndex,
String sortBy)
Get Persons' Groups
|
Group20Entry |
getGroups20ByIds(String personId,
String[] ids,
Integer count,
Integer startIndex)
Get a list of Group20's by the given list of group ids
|
PersonEntry |
getPerson(String userId,
String loggedInUser,
String spEntityId)
Get the OpenSocial Person.
|
boolean |
isActive() |
boolean |
isCallAllowed(GroupProviderConfiguration.Service service,
String spEntityId,
GroupProvider groupProvider)
Is the call allowed? e.g.
|
boolean |
isInternalGroup(String groupId)
Verify if the given groupId is from an internal e.g.
|
protected List<? extends Object> |
processQueryOptions(AbstractEntry parent,
Integer count,
Integer startIndex,
String sortBy,
List<? extends Object> entry)
Filter/mangle a result set based on query parameters
|
void |
reset() |
void |
setActive(boolean isActive) |
void |
sleep(long millSeconds) |
public PersonEntry getPerson(String userId, String loggedInUser, String spEntityId)
PersonServicegetPerson in interface PersonServiceuserId - the unique identifierloggedInUser - the unique identifier of the user on behalf of whom the request is made.spEntityId - the entity that performs the requestPersonEntrypublic GroupMembersEntry getGroupMembers(String groupId, String onBehalfOf, String spEntityId, Integer count, Integer startIndex, String sortBy)
PersonServicegetGroupMembers in interface PersonServicegroupId - String the unique identifier for the grouponBehalfOf - the unique identifier of the user on behalf of whom the request is made.spEntityId - the entity that performs the requestcount - nr of records to fetchstartIndex - first record nr.sortBy - field to sort by.ArrayList containing Person'spublic GroupEntry getGroups(String userId, String onBehalfOf, Integer count, Integer startIndex, String sortBy)
GroupServicegetGroups in interface GroupServiceuserId - the unique identifieronBehalfOf - the unique identifier of the user that is going to make the
requestcount - nr of records to returnstartIndex - first record of result setsortBy - field to sort byList containing the Groupspublic Group20Entry getGroups20(String userId, String onBehalfOf, Integer count, Integer startIndex, String sortBy)
GroupServicegetGroups20 in interface GroupServiceuserId - the unique identifieronBehalfOf - the unique identifier of the user that is going to make the
requestcount - nr of records to returnstartIndex - first record of result setsortBy - field to sort byList containing the Groupspublic GroupEntry getGroup(String userId, String groupId, String onBehalfOf)
GroupServicegetGroup in interface GroupServiceuserId - the unique identifiergroupId - the unique identifieronBehalfOf - the unique identifier of the user that is going to make the
requestpublic Group20Entry getGroup20(String userId, String groupId, String onBehalfOf)
GroupServicegetGroup20 in interface GroupServiceuserId - the unique identifiergroupId - the unique identifieronBehalfOf - the unique identifier of the user that is going to make the
requestpublic Group20Entry getGroups20ByIds(String personId, String[] ids, Integer count, Integer startIndex)
GroupServicegetGroups20ByIds in interface GroupServicepersonId - the personIdids - the array of idscount - nr of records to returnstartIndex - first record of result setpublic boolean isActive()
public void setActive(boolean isActive)
public void reset()
reset in interface ConfigurableGroupProviderpublic void addPerson(Person person)
addPerson in interface ConfigurableGroupProviderpublic void addGroup(Group20 group)
addGroup in interface ConfigurableGroupProviderpublic void addPersonToGroup(String personId, String groupId)
addPersonToGroup in interface ConfigurableGroupProviderprotected List<? extends Object> processQueryOptions(AbstractEntry parent, Integer count, Integer startIndex, String sortBy, List<? extends Object> entry)
parent - the root object; effectively this parameter is altered by setting
the totalResults propertycount - nr of records to fetchstartIndex - the start indexsortBy - field to sort byentry - the result list of entriespublic void sleep(long millSeconds)
sleep in interface ConfigurableGroupProviderpublic boolean isInternalGroup(String groupId)
GroupProviderConfigurationisInternalGroup in interface GroupProviderConfigurationgroupId - the group identifierpublic List<GroupProvider> getAllowedGroupProviders(GroupProviderConfiguration.Service service, String spEntityId, List<GroupProvider> allGroupProviders)
GroupProviderConfigurationSecurityContextHolder.getContext().getAuthentication().getPrincipal()
contextgetAllowedGroupProviders in interface GroupProviderConfigurationservice - the ACL to check forspEntityId - the entity of the Service providerallGroupProviders - all of the Group Providerspublic List<GroupProvider> getAllGroupProviders()
GroupProviderConfigurationgetAllGroupProviders in interface GroupProviderConfigurationpublic boolean isCallAllowed(GroupProviderConfiguration.Service service, String spEntityId, GroupProvider groupProvider)
GroupProviderConfigurationServiceProviderGroupAcl for
the given GroupProviderConfiguration.Service and GroupProviderisCallAllowed in interface GroupProviderConfigurationservice - the ACL to check forspEntityId - the entity of the Service providerpublic GroupMembersEntry getGroupMembersEntry(GroupProvider groupProvider, String onBehalfOf, String groupId, int limit, int offset)
GroupProviderConfigurationgetGroupMembersEntry in interface GroupProviderConfigurationgroupProvider - GroupProvider for the settingsgroupId - the groupId as we know it in SURFconext context (e.g.
urn:collab:group:myuniversity.nl:testgroup)limit - maximum number of itemsoffset - starting point for pagingGroupMembersEntry, can be nullpublic Group20Entry getGroup20Entry(GroupProvider groupProvider, String userId, int limit, int offset)
getGroup20Entry in interface GroupProviderConfigurationgroupProvider - GroupProvider for the settingsuserId - the userId as we know it in SURFconext context (e.g.
urn:collab:person:myuniversity.nl:testuser)limit - maximum number of itemsoffset - starting point for pagingGroup20Entry, can be nullpublic String cutOffUrnPartForGrouper(List<GroupProvider> groupProviders, String groupId)
GroupProviderConfigurationcutOffUrnPartForGrouper in interface GroupProviderConfigurationgroupProviders - all groupPrvidersgroupId - the long version with the urn part of the Grouppublic Group20 getGroup20(GroupProvider groupProvider, String userId, String groupId)
GroupProviderConfigurationgetGroup20 in interface GroupProviderConfigurationgroupProvider - the GroupProvideruserId - the userIdgroupId - the groupIdpublic Group20Entry addUrnPartForGrouper(List<GroupProvider> groupProviders, Group20Entry group20Entry)
GroupProviderConfigurationaddUrnPartForGrouper in interface GroupProviderConfigurationgroupProviders - all groupProvidergroup20Entry - the group20Entry with Grouper id'sCopyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.