Interface RewriteRuleService

    • Method Detail

      • find

        @Deprecated(since="2.1.0")
        @NotNull
        @NotNull Set<String> find​(@NotNull
                                  @NotNull org.apache.sling.api.resource.Resource resource)
        Deprecated.
        Lists all resource paths that match any rules of which this service is aware.

        This method may result in fuzzy matches to improve performance and prevent resource utilization overhead.

        Parameters:
        resource - Resource for the root of the search
        Returns:
        list of mappings that match rules or empty set if none found or an error occurs
      • listRules

        @Deprecated(since="2.1.0")
        @NotNull
        @NotNull Set<RewriteRule> listRules​(@NotNull
                                            @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                            String... slingResourceType)
        Deprecated.
        Lists all rules that may apply to the specified sling:resourceType.

        This method may result in fuzzy matches to improve performance and prevent resource utilization overhead.

        Parameters:
        resourceResolver - ResourceResolver for searching
        slingResourceType - the sling:resourceType(s) to check
        Returns:
        set of rules by path or PID
      • listRules

        @NotNull
        @NotNull Set<String> listRules​(@NotNull
                                       @NotNull org.apache.sling.api.resource.Resource resource)
        Finds set of rule ids of which this service is aware, that may match the provided resource's sling:resourceType.

        This method may result in fuzzy matches to improve performance and prevent resource utilization overhead.

        Parameters:
        resource - Resource to find matching rules
        Returns:
        set of rules by path or PID
      • getRule

        @Nullable
        @Nullable RewriteRule getRule​(@NotNull
                                      @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                      @NotNull
                                      @NotNull String id)
        Returns the rule based on its unique identifier.
        Parameters:
        resourceResolver - the Resource Resolver to use to for rule lookup
        id - the id for the rule
        Returns:
        the rule associated with the id or null if none exists