Class ExactMatchResourceName

    • Constructor Detail

      • ExactMatchResourceName

        public ExactMatchResourceName()
    • Method Detail

      • initialize

        public void initialize​(Map configParams)
        Description copied from interface: BaseResourceName
        Initializes the resource name with configuration information, usually set by the administrators.
        Specified by:
        initialize in interface BaseResourceName<ResourceMatch,​EntitlementException>
        Parameters:
        configParams - configuration parameters as a map. The keys of the map are the configuration parameters. Each key is corresponding to one String value which specifies the configuration parameter value.
      • compare

        public int compare​(Object o1,
                           Object o2)
        This method is used to compare two url query parameter strings. A query parameter string is in the form of variablename=value.
        Specified by:
        compare in interface Comparator
        Parameters:
        o1 - a url query parameter to be compared
        o2 - a url query parameter to be compared
        Returns:
        -1 if o1 < o2; 0 if o1 = o2; 1 if o1 > o2
      • getSubResource

        public String getSubResource​(String resource,
                                     String superResource)
        Description copied from interface: BaseResourceName
        Gets sub-resource from an original resource minus a super resource. This is the complementary method of append().
        Specified by:
        getSubResource in interface BaseResourceName<ResourceMatch,​EntitlementException>
        Parameters:
        resource - name of the original resource consisting of the second parameter superRes and the returned value
        superResource - name of the super-resource which the first parameter begins with.
        Returns:
        returns the sub-resource which the first parameter ends with. If the first parameter does not begin with the the first parameter, then the return value is null.
      • compare

        public ResourceMatch compare​(String requestResource,
                                     String targetResource,
                                     boolean wildcardCompare)
        Description copied from interface: BaseResourceName
        Compares two resources.
        Specified by:
        compare in interface BaseResourceName<ResourceMatch,​EntitlementException>
        Parameters:
        requestResource - name of the resource which will be compared
        targetResource - name of the resource which will be compared with
        wildcardCompare - flag for wildcard comparison
        Returns:
        returns ResourceMatch that specifies if the resources are exact match, or otherwise.
        • ResourceMatch.NO_MATCH means two resources do not match
        • ResourceMatch.EXACT_MATCH means two resources match
        • ResourceMatch.SUB_RESOURCE_MATCH means compRes is the sub resource of the origRes
        • ResourceMatch.SUPER_RESOURCE_MATCH means compRes is the super resource of the origRes
        • ResourceMatch.WILDCARD_MATCH means two resources match with respect to the wildcard
      • split

        public String[] split​(String res)
        Description copied from interface: BaseResourceName
        Method to split a resource into the smallest necessary sub resource units.
        Specified by:
        split in interface BaseResourceName<ResourceMatch,​EntitlementException>
        Parameters:
        res - name of the resource to be split
        Returns:
        returns the array of sub-resources, with the first element being what the original resource begins with, and the last one being what it ends with