nl.surfnet.coin.api
Class GroupProviderConfigurationImpl

java.lang.Object
  extended by nl.surfnet.coin.api.GroupProviderConfigurationImpl
All Implemented Interfaces:
GroupProviderConfiguration

@Component(value="groupProviderConfiguration")
public class GroupProviderConfigurationImpl
extends Object
implements GroupProviderConfiguration

The GroupProviderConfigurationImpl is thread-safe.


Nested Class Summary
 
Nested classes/interfaces inherited from interface nl.surfnet.coin.api.GroupProviderConfiguration
GroupProviderConfiguration.Service
 
Field Summary
 
Fields inherited from interface nl.surfnet.coin.api.GroupProviderConfiguration
INTERNAL_GROUP_PATTERN
 
Constructor Summary
GroupProviderConfigurationImpl()
           
 
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.
 void setBasicAuthGroupService(BasicAuthGroupService basicAuthGroupService)
           
 void setGroupProviderService(GroupProviderService groupProviderService)
           
 void setOauthGroupService(OauthGroupService oauthGroupService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupProviderConfigurationImpl

public GroupProviderConfigurationImpl()
Method Detail

isInternalGroup

public boolean isInternalGroup(String groupId)
Description copied from interface: GroupProviderConfiguration
Verify if the given groupId is from an internal e.g. grouper group

Specified by:
isInternalGroup in interface GroupProviderConfiguration
Parameters:
groupId - the group identifier
Returns:
boolean true id the group is external

getAllowedGroupProviders

public List<GroupProvider> getAllowedGroupProviders(GroupProviderConfiguration.Service service,
                                                    String spEntityId,
                                                    List<GroupProvider> allGroupProviders)
Description copied from interface: GroupProviderConfiguration
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

Specified by:
getAllowedGroupProviders in interface GroupProviderConfiguration
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

@Cacheable(value="group-providers",
           key="methodName")
public List<GroupProvider> getAllGroupProviders()
Description copied from interface: GroupProviderConfiguration
Get all group providers

Specified by:
getAllGroupProviders in interface GroupProviderConfiguration
Returns:
all group providers

isCallAllowed

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

Specified by:
isCallAllowed in interface GroupProviderConfiguration
Parameters:
service - the ACL to check for
spEntityId - the entity of the Service provider
Returns:
true if Grouper is present

getGroupMembersEntry

public GroupMembersEntry getGroupMembersEntry(GroupProvider groupProvider,
                                              String onBehalfOf,
                                              String groupId,
                                              int limit,
                                              int offset)
Description copied from interface: GroupProviderConfiguration
Gets group members with paginating information for the user's oauth configuration

Specified by:
getGroupMembersEntry in interface GroupProviderConfiguration
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

public Group20Entry getGroup20Entry(GroupProvider groupProvider,
                                    String userId,
                                    int limit,
                                    int offset)
Specified by:
getGroup20Entry in interface GroupProviderConfiguration
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

getGroup20

public Group20 getGroup20(GroupProvider groupProvider,
                          String userId,
                          String groupId)
Description copied from interface: GroupProviderConfiguration
Get a single group

Specified by:
getGroup20 in interface GroupProviderConfiguration
Parameters:
groupProvider - the GroupProvider
userId - the userId
groupId - the groupId
Returns:
Group20 can be null

cutOffUrnPartForGrouper

public String cutOffUrnPartForGrouper(List<GroupProvider> groupProviders,
                                      String groupId)
Description copied from interface: GroupProviderConfiguration
Strip the urn part off the groupId

Specified by:
cutOffUrnPartForGrouper in interface GroupProviderConfiguration
Parameters:
groupProviders - all groupPrviders
groupId - the long version with the urn part of the Group
Returns:
a GroupId that Grouper understands

addUrnPartForGrouper

public Group20Entry addUrnPartForGrouper(List<GroupProvider> groupProviders,
                                         Group20Entry group20Entry)
Description copied from interface: GroupProviderConfiguration
Add to all the groups the conext urn part for grouper

Specified by:
addUrnPartForGrouper in interface GroupProviderConfiguration
Parameters:
groupProviders - all groupProvider
group20Entry - the group20Entry with Grouper id's
Returns:
group20Entry the same group20Entry but now with long conext urn's

setGroupProviderService

public void setGroupProviderService(GroupProviderService groupProviderService)
Parameters:
groupProviderService - the groupProviderService to set

setOauthGroupService

public void setOauthGroupService(OauthGroupService oauthGroupService)
Parameters:
oauthGroupService - the oauthGroupService to set

setBasicAuthGroupService

public void setBasicAuthGroupService(BasicAuthGroupService basicAuthGroupService)
Parameters:
basicAuthGroupService - the basicAuthGroupService to set


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