Class RuleSpaceScopeResolver

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

@Service("gamificationRuleSpaceScopeResolver") @Profile("mcp-server") public class RuleSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a quest (a rule) belongs to: the space of its campaign, when that is a space campaign. A quest of an open campaign, a deleted quest and a quest without a campaign belong to no space. Read without any access check, for the space scope decision only.
  • Field Details

  • Constructor Details

    • RuleSpaceScopeResolver

      public RuleSpaceScopeResolver(RuleService ruleService)
      Parameters:
      ruleService - the rule service
  • Method Details

    • getName

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

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