Class RegistryService


  • @Component("RegistryService")
    @CrossOrigin("*")
    public class RegistryService
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RegistryService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response cancelManagerInvitations​(String type, String id, String email)
      Cancel invitation to user with email for managing a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response cancelMemberInvitations​(String type, String id, String email)
      Cancel invitation to user with email for being member of a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response createCuratorRole​(String type)
      Create a new curator role with the given type(Community, etc.).
      javax.ws.rs.core.Response createMemberRole​(String type, String id)
      Create a new role with the given type(Community, etc.) with id(ee, egi, etc.).
      javax.ws.rs.core.Response deleteVerification​(String id)
      Delete the verification with a specific id.
      javax.ws.rs.core.Response getCurators​(String type)
      Get infos of the curators of a type(Community, etc.)
      javax.ws.rs.core.Response getInvitedManagers​(String type, String id)
      Get the invited managers for a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response getInviteMembers​(String type, String id)
      Get the invited members for a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response getManagers​(String type, String id)
      Get infos of the managers of a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response getMembers​(String type, String id)
      Get infos of the members of a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response getMembersCount​(String type, String id)
      Get the number of the members of a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response getVerification​(String id)
      Get the verification with a specific id only if it refers to the logged in user
      javax.ws.rs.core.Response inviteManager​(String type, String id, String body)
      Invite user with email to manage a type(Community, etc.) with id(ee, egi, etc.) Auto generated link and code will be sent as response.
      javax.ws.rs.core.Response inviteMember​(String type, String id, String body)
      Invite user with email to be a member of a type(Community, etc.) with id(ee, egi, etc.) Auto generated link and code will be sent as response.
      javax.ws.rs.core.Response removeManagerRole​(String type, String id, String email)
      Remove the manager role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response removeMemberRole​(String type, String id, String email)
      Remove the member role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response subscribe​(String type, String id, javax.servlet.http.HttpServletRequest request)
      Subscribe to a type(Community, etc.) with id(ee, egi, etc.)
      javax.ws.rs.core.Response unsubscribe​(String type, String id, javax.servlet.http.HttpServletRequest request)
      Unsubscribe from type(Community, etc.) with id(ee, egi, etc.).
      javax.ws.rs.core.Response verifyManager​(String id, String code, javax.servlet.http.HttpServletRequest request)
      Verify the verification with the specific id, if the code is correct and it refers to the logged in user.
      javax.ws.rs.core.Response verifyMember​(String id, String code, javax.servlet.http.HttpServletRequest request)
      Verify the verification with the specific id, if the code is correct and it refers to the logged in user.
    • Constructor Detail

      • RegistryService

        public RegistryService()
    • Method Detail

      • subscribe

        @PreAuthorize("isAuthenticated() and @AuthorizationService.isCommunity(#type)")
        public javax.ws.rs.core.Response subscribe​(String type,
                                                   String id,
                                                   @Context
                                                   javax.servlet.http.HttpServletRequest request)
        Subscribe to a type(Community, etc.) with id(ee, egi, etc.)
      • unsubscribe

        @PreAuthorize("isAuthenticated() and @AuthorizationService.isCommunity(#type)")
        public javax.ws.rs.core.Response unsubscribe​(String type,
                                                     String id,
                                                     @Context
                                                     javax.servlet.http.HttpServletRequest request)
        Unsubscribe from type(Community, etc.) with id(ee, egi, etc.). If user has manager role for this entity, it will be removed too.
      • createCuratorRole

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
        public javax.ws.rs.core.Response createCuratorRole​(String type)
        Create a new curator role with the given type(Community, etc.).
      • createMemberRole

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type))")
        public javax.ws.rs.core.Response createMemberRole​(String type,
                                                          String id)
        Create a new role with the given type(Community, etc.) with id(ee, egi, etc.).
      • inviteManager

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response inviteManager​(String type,
                                                       String id,
                                                       @RequestBody
                                                       String body)
        Invite user with email to manage a type(Community, etc.) with id(ee, egi, etc.) Auto generated link and code will be sent as response.
      • inviteMember

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response inviteMember​(String type,
                                                      String id,
                                                      @RequestBody
                                                      String body)
        Invite user with email to be a member of a type(Community, etc.) with id(ee, egi, etc.) Auto generated link and code will be sent as response.
      • cancelManagerInvitations

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response cancelManagerInvitations​(String type,
                                                                  String id,
                                                                  String email)
        Cancel invitation to user with email for managing a type(Community, etc.) with id(ee, egi, etc.)
      • cancelMemberInvitations

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response cancelMemberInvitations​(String type,
                                                                 String id,
                                                                 String email)
        Cancel invitation to user with email for being member of a type(Community, etc.) with id(ee, egi, etc.)
      • getInvitedManagers

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response getInvitedManagers​(String type,
                                                            String id)
        Get the invited managers for a type(Community, etc.) with id(ee, egi, etc.)
      • getInviteMembers

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response getInviteMembers​(String type,
                                                          String id)
        Get the invited members for a type(Community, etc.) with id(ee, egi, etc.)
      • getVerification

        @PreAuthorize("isAuthenticated()")
        public javax.ws.rs.core.Response getVerification​(String id)
        Get the verification with a specific id only if it refers to the logged in user
      • deleteVerification

        @PreAuthorize("isAuthenticated() && @VerificationUtils.ownedVerification(#id)")
        public javax.ws.rs.core.Response deleteVerification​(String id)
        Delete the verification with a specific id.
      • verifyManager

        @PreAuthorize("isAuthenticated()")
        public javax.ws.rs.core.Response verifyManager​(String id,
                                                       @RequestBody
                                                       String code,
                                                       @Context
                                                       javax.servlet.http.HttpServletRequest request)
        Verify the verification with the specific id, if the code is correct and it refers to the logged in user. Manager role is assigned to this user, along with the member role.
      • verifyMember

        @PreAuthorize("isAuthenticated()")
        public javax.ws.rs.core.Response verifyMember​(String id,
                                                      @RequestBody
                                                      String code,
                                                      @Context
                                                      javax.servlet.http.HttpServletRequest request)
        Verify the verification with the specific id, if the code is correct and it refers to the logged in user. Member role is assigned to this user, along with the member role.
      • removeManagerRole

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response removeManagerRole​(String type,
                                                           String id,
                                                           String email)
        Remove the manager role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
      • removeMemberRole

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response removeMemberRole​(String type,
                                                          String id,
                                                          String email)
        Remove the member role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
      • getMembersCount

        public javax.ws.rs.core.Response getMembersCount​(String type,
                                                         String id)
        Get the number of the members of a type(Community, etc.) with id(ee, egi, etc.)
      • getMembers

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN,@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
        public javax.ws.rs.core.Response getMembers​(String type,
                                                    String id)
        Get infos of the members of a type(Community, etc.) with id(ee, egi, etc.)
      • getManagers

        public javax.ws.rs.core.Response getManagers​(String type,
                                                     String id)
        Get infos of the managers of a type(Community, etc.) with id(ee, egi, etc.)
      • getCurators

        @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type))")
        public javax.ws.rs.core.Response getCurators​(String type)
        Get infos of the curators of a type(Community, etc.)