Class CommentSpaceScopeResolver

java.lang.Object
io.meeds.mcp.server.tool.plugin.CommentSpaceScopeResolver
All Implemented Interfaces:
io.meeds.mcp.server.plugin.SpaceScopeResolver

@Service("commentSpaceScopeResolver") public class CommentSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a comment belongs to: the space of the activity it comments on. A reply to a comment belongs there too, since its parent is always the top activity of the thread. An activity that isn't a comment, a comment on a user stream's activity, a missing comment or parent belong to no space. Kept apart from the "activity" resolver so that a tool taking an activity never accepts a comment id. Read as the system, for the space scope decision only.
  • Field Details

  • Constructor Details

    • CommentSpaceScopeResolver

      public CommentSpaceScopeResolver()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Returns:
      "comment"
    • spaceOf

      public Long spaceOf(String objectId)
      Specified by:
      spaceOf in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the comment id, without its comment prefix
      Returns:
      the id of the space whose stream holds the commented activity, or null for an activity that isn't a comment, a comment on a user stream's activity, a missing comment or parent, an id that isn't one, or a lookup that fails