nl.surfnet.coin.api
Interface GroupProviderConfiguration

All Known Implementing Classes:
GroupProviderConfigurationImpl, MockServiceImpl

public interface GroupProviderConfiguration

Compound strategy to encapsulate all complexity regarding GroupProviders. It is very important that first all GroupProviders are selected and used in subsequent method calls (the signature of the methods demands this also), because we are caching the call getAllGroupProviders.


Nested Class Summary
static class GroupProviderConfiguration.Service
           
 
Field Summary
static Pattern INTERNAL_GROUP_PATTERN
           
 
Method Summary
 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.
 Group20 getGroup20(GroupProvider groupProvider, String userId, String groupId)
          Get a single group
 Group20Entry getGroup20Entry(GroupProvider groupProvider, String userId, int limit, int offset)
           
 GroupMembersEntry getGroupMembersEntry(GroupProvider groupProvider, String onBehalfOf, String groupId, int limit, int offset)
          Gets group members with paginating information for the user's oauth configuration
 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.
 

Field Detail

INTERNAL_GROUP_PATTERN

static final Pattern INTERNAL_GROUP_PATTERN
Method Detail

isInternalGroup

boolean isInternalGroup(String groupId)
Verify if the given groupId is from an internal e.g. grouper group

Parameters:
groupId - the group identifier
Returns:
boolean true id the group is external

getAllowedGroupProviders

List<GroupProvider> getAllowedGroupProviders(GroupProviderConfiguration.Service service,
                                             String spEntityId,
                                             List<GroupProvider> allGroupProviders)
Get all GroupProviders that have the correct ACL configured based on the Service. Note that the SP entityId that is used to check against is retrieved from the SecurityContextHolder.getContext().getAuthentication().getPrincipal() context

Parameters:
service - the ACL to check for
spEntityId - the entity of the Service provider
allGroupProviders - all of the Group Providers
Returns:
All GroupProviders who are configured to

getAllGroupProviders

List<GroupProvider> getAllGroupProviders()
Get all group providers

Returns:
all group providers

isCallAllowed

boolean isCallAllowed(GroupProviderConfiguration.Service service,
                      String spEntityId,
                      GroupProvider groupProvider)
Is the call allowed? e.g. is there an ServiceProviderGroupAcl for the given GroupProviderConfiguration.Service and GroupProvider

Parameters:
service - the ACL to check for
spEntityId - the entity of the Service provider
groupProvider - the Group Provider
Returns:
true if Grouper is present

getGroupMembersEntry

GroupMembersEntry getGroupMembersEntry(GroupProvider groupProvider,
                                       String onBehalfOf,
                                       String groupId,
                                       int limit,
                                       int offset)
Gets group members with paginating information for the user's oauth configuration

Parameters:
groupProvider - GroupProvider for the settings
groupId - the groupId as we know it in SURFconext context (e.g. urn:collab:group:myuniversity.nl:testgroup)
limit - maximum number of items
offset - starting point for paging
Returns:
GroupMembersEntry, can be null

getGroup20Entry

Group20Entry getGroup20Entry(GroupProvider groupProvider,
                             String userId,
                             int limit,
                             int offset)
Parameters:
groupProvider - GroupProvider for the settings
userId - the userId as we know it in SURFconext context (e.g. urn:collab:person:myuniversity.nl:testuser)
limit - maximum number of items
offset - starting point for paging
Returns:
Group20Entry, can be null

cutOffUrnPartForGrouper

String cutOffUrnPartForGrouper(List<GroupProvider> groupProviders,
                               String groupId)
Strip the urn part off the groupId

Parameters:
groupProviders - all groupPrviders
groupId - the long version with the urn part of the Group
Returns:
a GroupId that Grouper understands

getGroup20

Group20 getGroup20(GroupProvider groupProvider,
                   String userId,
                   String groupId)
Get a single group

Parameters:
groupProvider - the GroupProvider
userId - the userId
groupId - the groupId
Returns:
Group20 can be null

addUrnPartForGrouper

Group20Entry addUrnPartForGrouper(List<GroupProvider> groupProviders,
                                  Group20Entry group20Entry)
Add to all the groups the conext urn part for grouper

Parameters:
groupProviders - all groupProvider
group20Entry - the group20Entry with Grouper id's
Returns:
group20Entry the same group20Entry but now with long conext urn's


Copyright © 2009-2013 SURFnet bv, The Netherlands. All Rights Reserved.