nl.surfnet.coin.teams.service.impl
Class GrouperTeamServiceWsImpl

java.lang.Object
  extended by nl.surfnet.coin.teams.service.impl.AbstractGrouperDaoImpl
      extended by nl.surfnet.coin.teams.service.impl.GrouperDaoImpl
          extended by nl.surfnet.coin.teams.service.impl.GrouperTeamServiceWsImpl
All Implemented Interfaces:
GrouperDao, GrouperTeamService

public class GrouperTeamServiceWsImpl
extends GrouperDaoImpl
implements GrouperTeamService

GrouperTeamService using Grouper LDAP as persistent store


Nested Class Summary
 
Nested classes/interfaces inherited from class nl.surfnet.coin.teams.service.impl.AbstractGrouperDaoImpl
nl.surfnet.coin.teams.service.impl.AbstractGrouperDaoImpl.GrouperRowMapper<T>
 
Field Summary
 
Fields inherited from class nl.surfnet.coin.teams.service.impl.AbstractGrouperDaoImpl
SQL_ADD_MEMBER_COUNT_TO_TEAMS, SQL_FIND_ALL_TEAMS, SQL_FIND_ALL_TEAMS_BY_MEMBER, SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, SQL_FIND_ALL_TEAMS_BY_MEMBER_SORTED, SQL_FIND_ALL_TEAMS_ROWCOUNT, SQL_FIND_STEMS_BY_MEMBER, SQL_FIND_TEAM_BY_MEMBER_AND_BY_GROUPNAME, SQL_FIND_TEAMS_BY_GROUPIDS, SQL_FIND_TEAMS_BY_GROUPIDS_ROWCOUNT, SQL_FIND_TEAMS_BY_MEMBER, SQL_FIND_TEAMS_BY_MEMBER_ROWCOUNT, SQL_FIND_TEAMS_LIKE_GROUPNAME, SQL_FIND_TEAMS_LIKE_GROUPNAME_ROWCOUNT, SQL_MEMBERS_BY_TEAM, SQL_ROLES_BY_TEAM_AND_MEMBERS, SQL_ROLES_BY_TEAMS
 
Constructor Summary
GrouperTeamServiceWsImpl()
           
 
Method Summary
 void addMember(String teamId, nl.surfnet.coin.api.client.domain.Person person)
          Adds a person to the team
 boolean addMemberRole(String teamId, String memberId, Role role, String actAsUserId)
          Add Role to a Team
 String addTeam(String teamId, String displayName, String teamDescription, String stemName)
          Add a Team.
 void deleteMember(String teamId, String personId)
          Delete a Member from a Team
 void deleteTeam(String teamId)
          Delete a Team
 boolean doesStemExists(String stemName)
          Does the Stem exists?
 Set<Member> findAdmins(Team team)
          Returns a Set of Member's that have the admin role for this team
 Member findMember(String teamId, String memberId)
          Tries to find a Member in a Team
 Stem findStem(String stemId)
           
 Team findTeamById(String teamId)
          Find Team by id
 TeamResultWrapper findTeams(String personId, String partOfGroupname, int offset, int pageSize)
          Return all teams using a specific stem with a name like, , without the teams being private except if the personId is a member of the private team
 String getGrouperPowerUser()
           
 boolean removeMemberRole(String teamId, String memberId, Role role, String actAsUserId)
          Remove Role to a Team
 void setEnvironment(TeamEnvironment environment)
           
 void setVisibilityGroup(String teamId, boolean viewable)
          Update the Team to be (not) visible
protected  String teamIdWithContext(String teamId)
          Prepend the teamId with the (environment specific) context.
 void updateTeam(String teamId, String displayName, String teamDescription, String actAsSubject)
          Update a Team
 
Methods inherited from class nl.surfnet.coin.teams.service.impl.GrouperDaoImpl
findAllTeams, findAllTeamsByMember, findStemsByMember, findTeamsByMember
 
Methods inherited from class nl.surfnet.coin.teams.service.impl.AbstractGrouperDaoImpl
correctOffset, correctPageSize, wildCard
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.surfnet.coin.teams.service.GrouperDao
findAllTeams, findAllTeamsByMember, findStemsByMember, findTeamsByMember
 

Constructor Detail

GrouperTeamServiceWsImpl

public GrouperTeamServiceWsImpl()
Method Detail

findTeamById

public Team findTeamById(String teamId)
Find Team by id

Specified by:
findTeamById in interface GrouperTeamService
Parameters:
teamId - unique identifier for a Team
Returns:
Team with all members

doesStemExists

public boolean doesStemExists(String stemName)
Description copied from interface: GrouperTeamService
Does the Stem exists?

Specified by:
doesStemExists in interface GrouperTeamService
Parameters:
stemName - the exact name of the stem
Returns:
true if the Stem is an existing Stem

findStem

public Stem findStem(String stemId)
Specified by:
findStem in interface GrouperTeamService

addTeam

public String addTeam(String teamId,
                      String displayName,
                      String teamDescription,
                      String stemName)
               throws DuplicateTeamException
Add a Team. Note that the teamId is altered if not compliant to the rules for correct id's.

Specified by:
addTeam in interface GrouperTeamService
Parameters:
teamId - the teamId
displayName - the displayName
teamDescription - description of the team
stemName - name of the stem
Returns:
The id of the team
Throws:
DuplicateTeamException - when a team with with the given teamId already exists.

deleteMember

public void deleteMember(String teamId,
                         String personId)
Delete a Member from a Team

Specified by:
deleteMember in interface GrouperTeamService
Parameters:
teamId - the unique identifier for a Team
personId - the unique identifier for a Member

deleteTeam

public void deleteTeam(String teamId)
Delete a Team

Specified by:
deleteTeam in interface GrouperTeamService
Parameters:
teamId - the unique identifier

updateTeam

public void updateTeam(String teamId,
                       String displayName,
                       String teamDescription,
                       String actAsSubject)
Update a Team

Specified by:
updateTeam in interface GrouperTeamService
Parameters:
teamId - the id of a Team
displayName - the new displayName
teamDescription - the new description of the Team
actAsSubject - the unique identifier that performs the request in Grouper. Can be the power user or the memberId

setVisibilityGroup

public void setVisibilityGroup(String teamId,
                               boolean viewable)
Update the Team to be (not) visible

Specified by:
setVisibilityGroup in interface GrouperTeamService
Parameters:
teamId - unique identifier for a Team
viewable - boolean

addMemberRole

public boolean addMemberRole(String teamId,
                             String memberId,
                             Role role,
                             String actAsUserId)
Add Role to a Team

Specified by:
addMemberRole in interface GrouperTeamService
Parameters:
teamId - the unique identifier of a Team
memberId - the unique identifier of a Member
role - the Role to be added
actAsUserId - the unique identifier that performs the request in Grouper. Can be the power user or the memberId
Returns:
boolean true if the Role has been successfully added false if the Role has not been added

removeMemberRole

public boolean removeMemberRole(String teamId,
                                String memberId,
                                Role role,
                                String actAsUserId)
Remove Role to a Team

Specified by:
removeMemberRole in interface GrouperTeamService
Parameters:
teamId - the unique identifier of a Team
memberId - the unique identifier of a Member
role - the Role to be removed
actAsUserId - the unique identifier that performs the request in Grouper. Can be the power user of the memberId
Returns:
boolean true if the Role has been successfully added false if the Role has not been added

addMember

public void addMember(String teamId,
                      nl.surfnet.coin.api.client.domain.Person person)
Adds a person to the team

Specified by:
addMember in interface GrouperTeamService
Parameters:
teamId - the unique identifier of the Team
person - Person to add as Member to the Team

findMember

public Member findMember(String teamId,
                         String memberId)
Tries to find a Member in a Team

Specified by:
findMember in interface GrouperTeamService
Parameters:
teamId - the unique identifier of the Team
memberId - the unique identifier of a Member
Returns:
Member or null if the Team does not contain a Member by the memberId

findAdmins

public Set<Member> findAdmins(Team team)
Returns a Set of Member's that have the admin role for this team

Specified by:
findAdmins in interface GrouperTeamService
Parameters:
team - Team
Returns:
Set of Member's with admin role, can be empty

setEnvironment

public void setEnvironment(TeamEnvironment environment)
Parameters:
environment - the environment to set

findTeams

public TeamResultWrapper findTeams(String personId,
                                   String partOfGroupname,
                                   int offset,
                                   int pageSize)
Description copied from interface: GrouperDao
Return all teams using a specific stem with a name like, , without the teams being private except if the personId is a member of the private team

Specified by:
findTeams in interface GrouperDao
Overrides:
findTeams in class GrouperDaoImpl
Parameters:
personId - the logged in person
partOfGroupname - part of group name
offset - the row number of the start
pageSize - the maximum result size
Returns:
teams including the number of total records

getGrouperPowerUser

public String getGrouperPowerUser()

teamIdWithContext

protected String teamIdWithContext(String teamId)
Prepend the teamId with the (environment specific) context. E.g.: urn:collab:group:surfteams.nl:

Parameters:
teamId - the teamId without context (e.g.: nl:surfnet:diensten:mygroup)
Returns:
the concatenation: urn:collab:group:surfteams.nl:nl:surfnet:diensten:mygroup


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