Class AnnouncementSpaceScopeResolver

java.lang.Object
io.meeds.gamification.mcp.AnnouncementSpaceScopeResolver
All Implemented Interfaces:
io.meeds.mcp.server.plugin.SpaceScopeResolver

@Service("gamificationAnnouncementSpaceScopeResolver") @Profile("mcp-server") public class AnnouncementSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a quest announcement belongs to: the space of the campaign of the quest it announces, when that is a space campaign. An announcement of a quest of an open campaign, of a deleted quest, or a missing one belongs to no space. Read without any access check, for the space scope decision only.
  • Field Details

  • Constructor Details

    • AnnouncementSpaceScopeResolver

      public AnnouncementSpaceScopeResolver(AnnouncementService announcementService, RuleService ruleService)
      Parameters:
      announcementService - the announcement service
      ruleService - the rule service
  • Method Details

    • getName

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

      public Long spaceOf(String objectId)
      Specified by:
      spaceOf in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the announcement id
      Returns:
      the id of the space of the announced quest's campaign, or null for an announcement of a quest of an open campaign or of no space, of a deleted quest, a missing one, an id that isn't a number, or a lookup that fails