Class OrganizationMemberService
java.lang.Object
edu.ucsb.cs156.frontiers.services.OrganizationMemberService
-
Constructor Summary
ConstructorsConstructorDescriptionOrganizationMemberService(JwtService jwtService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.springframework.boot.web.client.RestTemplateBuilder builder, RosterStudentRepository rosterStudentRepository) -
Method Summary
Modifier and TypeMethodDescriptiongetOrganizationAdmins(Course course) This endpoint returns the list of **admins** for the organization.getOrganizationInvitees(Course course) This endpoint returns the list of users who have been **invited** to the organization but have not yet accepted.getOrganizationMembers(Course course) This endpoint returns the list of **members**, not admins for the organization.inviteOrganizationMember(RosterStudent student) voidremoveOrganizationMember(CourseStaff staffMember) Removes a member from an organization.voidremoveOrganizationMember(RosterStudent student) Removes a member from an organization.voidremoveOrganizationMember(String orgName, String githubLogin, String token) Remove member from organization
-
Constructor Details
-
OrganizationMemberService
public OrganizationMemberService(JwtService jwtService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.springframework.boot.web.client.RestTemplateBuilder builder, RosterStudentRepository rosterStudentRepository)
-
-
Method Details
-
getOrganizationMembers
public Iterable<OrgMember> getOrganizationMembers(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException This endpoint returns the list of **members**, not admins for the organization. This is so that the roles are known for the return values.- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
getOrganizationAdmins
public Iterable<OrgMember> getOrganizationAdmins(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException This endpoint returns the list of **admins** for the organization. This is so that the roles are known for the return values.- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
getOrganizationInvitees
public Iterable<OrgMember> getOrganizationInvitees(Course course) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException This endpoint returns the list of users who have been **invited** to the organization but have not yet accepted.- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
inviteOrganizationMember
public OrgStatus inviteOrganizationMember(RosterStudent student) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
inviteOrganizationOwner
public OrgStatus inviteOrganizationOwner(CourseStaff staff) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
removeOrganizationMember
public void removeOrganizationMember(RosterStudent student) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException Removes a member from an organization.- Parameters:
student- The roster student to remove from the organization- Throws:
NoSuchAlgorithmException- if there is an algorithm errorInvalidKeySpecException- if there is a key specification errorcom.fasterxml.jackson.core.JsonProcessingException- if there is an error processing JSONIllegalArgumentException- if student has no GitHub login or course has no linked organizationException- if there is an error removing the student from the organization
-
removeOrganizationMember
public void removeOrganizationMember(CourseStaff staffMember) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException Removes a member from an organization.- Parameters:
staffMember- The staff member to remove from the organization- Throws:
NoSuchAlgorithmException- if there is an algorithm errorInvalidKeySpecException- if there is a key specification errorcom.fasterxml.jackson.core.JsonProcessingException- if there is an error processing JSONIllegalArgumentException- if student has no GitHub login or course has no linked organizationException- if there is an error removing the student from the organization
-
removeOrganizationMember
public void removeOrganizationMember(String orgName, String githubLogin, String token) throws NoSuchAlgorithmException, InvalidKeySpecException, com.fasterxml.jackson.core.JsonProcessingException Remove member from organization- Parameters:
orgName-githubLogin-token-- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecExceptioncom.fasterxml.jackson.core.JsonProcessingException
-