Class SpaceMcpTool

java.lang.Object
io.meeds.mcp.server.tool.SpaceMcpTool
All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin

@Service public class SpaceMcpTool extends Object implements io.meeds.mcp.server.plugin.McpToolPlugin
  • Constructor Details

    • SpaceMcpTool

      public SpaceMcpTool()
  • Method Details

    • createSpace

      public SpaceModel createSpace(long spaceTemplateId, String name, String description, Visibility visibility, Registration registration, List<String> usernamesToInvite, Long parentSpaceId) throws org.exoplatform.social.core.space.SpaceException
      Throws:
      org.exoplatform.social.core.space.SpaceException
    • updateSpaceSettings

      public SpaceModel updateSpaceSettings(long spaceId, String name, String description, Visibility visibility, Registration registration)
      Updates the settings of a space the current user manages. The current user is the editor of the update, as in the Social REST endpoint.
      Parameters:
      spaceId - the space
      name - the new display name, ignored when blank
      description - the new description, ignored when blank
      visibility - the new visibility, ignored when null
      registration - the new registration, ignored when null
      Returns:
      the updated space
    • getAllSpaces

      public List<SpaceModel> getAllSpaces(String query, Integer offset, Integer limit)
    • getMySpaces

      public List<SpaceModel> getMySpaces(String query, Integer offset, Integer limit)
    • countMySpaces

      public long countMySpaces(String query)
    • getManagedSpaces

      public List<SpaceModel> getManagedSpaces(String query, Integer offset, Integer limit)
    • getSpaceById

      public SpaceModel getSpaceById(long spaceId)
    • listUsersOfSpaceByRole

      public List<UserModel> listUsersOfSpaceByRole(long spaceId, SpaceRole spaceRole, Integer offset, Integer limit)
    • inviteUsersToSpace

      public void inviteUsersToSpace(long spaceId, List<String> usernamesToInvite)
    • removeUsersFromSpace

      public void removeUsersFromSpace(long spaceId, List<String> usernamesToRemove)
      Removes users from a space the current user manages. Refused before any removal when one of them is the space's only manager, or when the list holds every manager; each user is then checked again against the space as stored, right before its removal, so that a change made elsewhere before that read is taken into account. The read and the removal are not one transaction: a manager demoted or removed elsewhere between them, by a concurrent removal of the other manager among others, can still leave the space without one. A refusal at that point leaves the users removed before it removed. The current user is the editor of each removal, as in the Social REST endpoint.
      Parameters:
      spaceId - the space
      usernamesToRemove - the users, possibly prefixed with "@"
      Throws:
      IllegalStateException - when the space doesn't exist, the current user can't manage it, or a removal would leave it without a manager
    • setUserRoleInSpace

      public void setUserRoleInSpace(long spaceId, String username, SpaceRole spaceRole)
    • removeUserRoleInSpace

      public void removeUserRoleInSpace(long spaceId, String username, SpaceRole spaceRole)
      Removes a role of a member of a space the current user manages. The current user is the editor of the change, as in the Social REST endpoint.
      Parameters:
      spaceId - the space
      username - the member
      spaceRole - the role to remove
      Throws:
      IllegalStateException - when the space doesn't exist, the current user can't manage it, the user isn't a member of it, or the role is the manager one of its only manager
    • setSpaceAvatar

      public SpaceModel setSpaceAvatar(long spaceId, String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • setSpaceBanner

      public SpaceModel setSpaceBanner(long spaceId, String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • joinSpace

      public SpaceModel joinSpace(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • requestToJoinSpace

      public SpaceModel requestToJoinSpace(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • cancelJoinRequest

      public SpaceModel cancelJoinRequest(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • leaveSpace

      public SpaceModel leaveSpace(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • acceptSpaceInvitation

      public SpaceModel acceptSpaceInvitation(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • declineSpaceInvitation

      public SpaceModel declineSpaceInvitation(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • listSpaceJoinRequests

      public List<UserModel> listSpaceJoinRequests(long spaceId, Integer offset, Integer limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • acceptSpaceJoinRequest

      public void acceptSpaceJoinRequest(long spaceId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • declineSpaceJoinRequest

      public void declineSpaceJoinRequest(long spaceId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getSpaceMembers

      public List<SpaceMemberModel> getSpaceMembers(long spaceId, Integer offset, Integer limit) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • listSubSpaces

      public List<SpaceModel> listSubSpaces(long parentSpaceId, Integer offset, Integer limit) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • deleteSpace

      public void deleteSpace(long spaceId) throws org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.social.core.space.SpaceException
      Deletes a space the current user holds the delete permission on, with the current user as the editor of the deletion, as the Social REST endpoint does.
      Parameters:
      spaceId - technical id of the space
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the space doesn't exist
      org.exoplatform.social.core.space.SpaceException - when the space service refuses the deletion