Class ScopeTemplateUtil


  • public class ScopeTemplateUtil
    extends Object
    Utilities for working with scopes. These are static since they will be used by QDL functions for instance to make sure there is a single place with ALL the logic and edge cases.

    Created by Jeff Gaynor
    on 1/21/21 at 10:32 AM

    • Constructor Detail

      • ScopeTemplateUtil

        public ScopeTemplateUtil()
    • Method Detail

      • compareAsURI

        public static String compareAsURI​(String requestedScope,
                                          String computedScope,
                                          boolean isQuery)
        There is a URI.compareTo(URI) method that is crap. This does it right.
        Parameters:
        requestedScope -
        computedScope -
        isQuery -
        Returns:
      • replaceTemplate

        public static List<String> replaceTemplate​(String currentTemplate,
                                                   Map<String,​List<String>> groups,
                                                   Map claimsNoGroups)
        resolve a single template for groups (if any) and other claims. Such a template would look like head:/path/${groupName} where the name of the group is there. This returns a list of templates that have been resolved, one per group.
        Parameters:
        currentTemplate -
        groups -
      • simpleReplacement

        protected static String simpleReplacement​(String currentTemplate,
                                                  Map claims)