内に含まその他のドキュメントサポート リソース | PDF 文書ファイルをダウンロードする (909 KB)
Chapter 6 Policy FunctionsThis chapter provides a reference to the public functions for using Sun JavaTM System Access Manager Access Management SDK policy objects. Function summaries include a short description, syntax, parameters and returns. The following functions are contained in the header file am_policy.h . 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);
ParametersIf 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. ReturnsThis function returns am_resource_match_t with one of the following values:
DetailsIn cases of SUB/SUPER_RESOURCE_MATCH, if the usePatterns is * AM_TRUE, the patterns are sub/super matching patterns. am_policy_destroy()Frees an initialized policy evaluator. Syntax#include "am_policy.h" AM_EXPORT am_status_t am_policy_destroy(am_policy_t policy); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThis function destroys a policy service instance. Memory Concerns: Caller must call make sure the same service instance not be destroyed more than once. am_policy_evaluate()Evaluates a policy for a given resource and returns the policy result. Syntax#include "am_policy.h"
AM_EXPORT am_status_t
am_policy_evaluate(am_policy_t policy_handle,
const char *sso_token,
const char *resource_name,
const char *action_name,
const am_map_t env_parameter_map,
am_map_t policy_response_map_ptr,
am_policy_result_t *policy_result);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThis function destroys a policy service instance. Memory Concerns: After using the results the caller must call am_policy_result_destroy on the policy_result to cleanup the memory allocated by the evaluation operation. am_map_destroy must also be called on response and env_parameter_map after their respective usage scope. am_policy_get_url_resource_root()Populates the pointer resourceRoot with the resource root. Syntax#include "am_policy.h"
AM_EXPORT boolean_t am_policy_get_url_resource_root
(const char *resource_name, char *resource_root,
size_t length);
ParametersThis function takes a URL resource name. ReturnsThis function returns boolean_t with one of the following values:
DetailsThis function is takes a URL and extracts a root of the URL. For example, http://www.sun.com/index.html will return http://www.sun.com/ and http://www.sun.com:8080/index.html will return http://www.sun.com:8080/. Memory Concerns: In an implementation for a different resource other than URLs, the service writer implementing this function must make accurate judgement about the minimum size of resourceRoot. am_policy_init()Initializes the policy evaluation engine. Syntax#include "am_policy.h" AM_EXPORT am_status_t am_policy_init(am_properties_t policy_config_properties); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThis function initializes a policy service instance. Memory Concerns: Caller must call am_policy_destroy structure or free the memory. am_policy_is_notification_enabled()Checks if notification is enabled in the SDK. Syntax#include "am_policy.h" AM_EXPORT boolean_t am_policy_is_notification_enabled(am_policy_t policy_handle); ParametersThis function takes the following parameters:
ReturnsThis function returns boolean_t with one of the following values:
am_policy_notify()Refreshes policy cache when a policy notification is received by the client. Syntax#include "am_policy.h"
AM_EXPORT am_status_t am_policy_notify(am_policy_t policy_handle,
const char *notification_data,
size_t notification_data_len);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
am_policy_resource_canonicalize()Canonicalize the given resource name. Syntax#include "am_policy.h" AM_EXPORT void am_policy_resource_canonicalize(const char *resource, char **c_resource); ParametersThis function takes the following parameters:
am_policy_resource_has_patterns()Returns whether the given resource name has patterns such as ’*’. Syntax#include "am_policy.h" AM_EXPORT boolean_t am_policy_resource_has_patterns(const char *resource_name); ParametersThis function takes the following parameter:
ReturnsThis function returns boolean_t with one of the following values:
am_policy_result_destroy()Destroys am_policy_result internal structures. Syntax#include "am_policy.h" AM_EXPORT void am_policy_result_destroy(am_policy_result_t *result); ParametersThis function takes the following parameters:
ReturnsNone am_policy_service_init()Initializes one specific instance of service for policy evaluation. Syntax#include "am_policy.h"
AM_EXPORT am_status_t
am_policy_service_init(const char *service_name,
const char *instance_name,
am_resource_traits_t rsrc_traits,
am_properties_t service_config_properties,
am_policy_t *policy_handle_ptr);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
|