Class RegExResourceName

    • Constructor Detail

      • RegExResourceName

        public RegExResourceName()
    • 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 ResourceMatch compare​(String origRes,
                                     String compRes,
                                     boolean wildcardCompare)
        Description copied from interface: BaseResourceName
        Compares two resources.
        Specified by:
        compare in interface BaseResourceName<ResourceMatch,​EntitlementException>
        Parameters:
        origRes - name of the resource which will be compared
        compRes - 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
      • 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.
      • 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