Interface RuleLabelService

All Known Implementing Classes:
RuleLabelServiceImpl

public interface RuleLabelService
  • Field Details

  • Method Details

    • getLabels

      List<RuleLabelBean> getLabels(RemoteConnectUser remoteUser, TenantContext context)
      Retrieves all the rule labels for a tenant
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      Returns:
      the complete list or rule labels for the tenant
    • getLabelsWithUsageOutsideScope

      List<RuleLabelWithUsageBean> getLabelsWithUsageOutsideScope(RemoteConnectUser remoteUser, TenantContext context, List<com.codebarrel.automation.api.config.RuleConfigBean> rulesInScope)
      Retrieves rule labels with usage outside current scope.
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      rulesInScope - The list of rules in current scope
      Returns:
      the list of rule labels with usage outside current scope
    • getLabel

      Optional<RuleLabelBean> getLabel(RemoteConnectUser remoteUser, TenantContext context, long labelId)
      Gets a single rule label by id
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      labelId - The id of the label
      Returns:
      an optional of the label
    • getLabelToRuleUsage

      LabelRuleUsageBean getLabelToRuleUsage(RemoteConnectUser remoteUser, TenantContext context, long labelId)
      Gets the usage of rules associated with a specific label.
      Parameters:
      remoteUser - the user requesting the label to rule count
      context - the database tenant context
      labelId - the id of the label
      Returns:
      a bean containing the label id and the count of associated rules
    • updateLabel

      io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> updateLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label)
      Updates given label if it passes validation
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      label - The label with the updates to apply
      Returns:
      The updated label or validation errors
    • createLabel

      io.atlassian.fugue.Either<ErrorCollection,RuleLabelBean> createLabel(RemoteConnectUser remoteUser, TenantContext context, RuleLabelBean label)
      Creates label if it passes validation
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      label - The label to create
      Returns:
      The created label or validation errors
    • deleteLabel

      boolean deleteLabel(RemoteConnectUser remoteUser, TenantContext context, Long labelId)
      Deletes label if it passes validation
      Parameters:
      remoteUser - the user requesting the labels
      context - The database tenant context
      labelId - The id of label to delete
      Returns:
      true when deleted, false when doesn't exist
    • isFeatureEnabled

      boolean isFeatureEnabled(TenantContext context)
      Should the rule label feature be visible to tenant
      Parameters:
      context - The database tenant context
      Returns:
      Whether or not to surface the feature to tenant