Sun Java System Access Manager 7 2005Q4 C API Reference

am_policy_compare_urls()

Takes two url resources compares theme, and returns an appropriate result.

Syntax

#include "am_policy.h"
AM_EXPORT am_resource_match_t
am_policy_compare_urls(const am_resource_traits_t *rsrc_traits,
               const char *policy_resource_name,
               const char *resource_name,
               boolean_t use_patterns);

Parameters

If the usePatterns is AM_TRUE, this function will consider occurrences of ’*’ in the policy resource name as wildcards. If usePatterns is AM_FALSE, ’*’ occurrences are taken as a literal characters.

Returns

This function returns am_resource_match_t with one of the following values:

EXACT_MATCH

If both the resource names exactly matched.

SUB_RESOURCE_MATCH

If the resourceName is a sub-resource to the resource name defined in the policy.

SUPER_RESOURCE_MATCH

If the resourcName is a ancestor of the policy resource name.

NO_MATCH

If the there is no kind of match between the policy resource and the requested resource name.

EXACT_PATTERN_MATCH

This result will be returned only if the policy is matches resource name. Distinction is not made whether it was a EXACT_MATCH or a pattern match.

Details

In cases of SUB/SUPER_RESOURCE_MATCH, if the usePatterns is * AM_TRUE, the patterns are sub/super matching patterns.