Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (909 KB)
Chapter 7 Properties FunctionsThis chapter provides a reference to the properties map used by clients of the Sun JavaTM System Access Manager Client APIs. Function summaries include a short description, syntax, parameters and returns. The following functions are contained in the header file am_properties.h : am_properties_copy()Makes a copy of a properties object. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_copy(am_properties_t source_properties,
am_properties_t *properties_ptr);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsCreates an instance of am_properties_t and assigns it to properties_ptr. The function copies all the elements in the source_ptr to properties_ptr. The source_ptr is not affected during this operation. Memory Concerns: After the usage of the instance properties_ptr the caller must call am_properties_destroy to clean up the allocated memory. The removal of any item in either structures do not affect the other. am_properties_create()Creates an empty properties object. Syntax#include "am_properties.h" AM_EXPORT am_status_t am_properties_create(am_properties_t *properties_ptr); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsCreates an instance of am_properties_t and assigns it to properties_ptr. Memory Concerns: After the usage of the instance the caller must call am_properties_destroy to clean up the allocated memory. am_properties_destroy()Destroys the properties object referenced by the provided handle. Syntax#include "am_properties.h" AM_EXPORT void am_properties_destroy(am_properties_t properties); ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values:
DetailsDestroys an instance of am_properties_t. Memory Concerns: Caller must make sure not to pass the same instance of am_properties_t to be destroyed more than once. After calling this function it is advised that the caller initializes properties to NULL. am_properties_get()This function and all functions beginning with am_properties_get retrieve values from the properties map. The following parameters and exceptions are common to all functions in the am_propteries_get collection. Additional return values may be specified some functions. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get(am_properties_t properties, const char *key,
const char **value_ptr);
ParametersThis function takes the following parameters:
ReturnsThis function returns the unparsed string form of the value associated with one of the following keys:
DetailsThis function checks if the key is present is the properties instance and returns its value. Memory Concerns: Caller must not modify the value_ptr structure or free the memory. am_properties_get_boolean()Retrieves values from the properties map. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_boolean(am_properties_t properties, const char *key,
int *value_ptr);
ParametersSee am_properties_get(). Returns
DetailsIf the associated value does not match any of the recognized boolean values, then AM_INVALID_VALUE will be returned. See also am_properties_get(). am_properties_get_boolean_with_default()Retrieves values from the properties map. Syntax#include "am_properties.h"
am_properties_get_boolean_with_default(am_properties_t properties,
const char *key, int default_value,
int *value_ptr);
ParametersSee am_properties_get(). Returns
DetailsIf the associated value does not match any of the recognized boolean values, then AM_INVALID_VALUE will be returned. See also am_properties_get(). am_properties_get_entries()Returns an iterator object that can be used to enumerate all of the entries in the specified properties object. See also am_properties_get() . Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_entries(am_properties_t properties,
am_properties_iter_t *properties_iter_ptr);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsIf the properties_iter_ptr argument is non-NULL, then the location that it refers to will be set to NULL if an error is returned. See also am_properties_get(). am_properties_get_signed()Retrieves values from the properties map. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_signed(am_properties_t properties,
const char *key, long *value_ptr);
ParametersSee am_properties_get(). ReturnsThis function returns the value stored in value_ptr which is the signed integer value associated with the specified key. DetailsIf the associated value cannot be parsed as an integer or cannot be represented in the range LONG_MIN to LONG_MAX, then AM_INVALID_VALUE will be returned. See also am_properties_get(). am_properties_get_signed_with_default()Retrieve values from the properties map. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_signed_with_default(am_properties_t properties,
const char *key, long default_value,
long *value_ptr);
ParametersSee am_properties_get(). ReturnsThis function returns the value stored in value_ptr which is the signed integer value associated with the specified key. DetailsIf the associated value cannot be parsed as an integer or cannot be represented in the range LONG_MIN to LONG_MAX, then AM_INVALID_VALUE will be returned. See also am_properties_get(). am_properties_get_unsigned()See am_properties_get(). Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_unsigned(am_properties_t properties, const char *key,
unsigned long *value_ptr);
ParametersSee am_properties_get(). ReturnsThis function returns the unsigned integer value associated with the specified keyDetails. DetailsSee am_properties_get(). am_properties_get_unsigned_with_default()See am_properties_get(). Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_unsigned_with_default(am_properties_t properties,
const char *key,
unsigned long default_value,
unsigned long *value_ptr);
ParametersSee am_properties_get(). ReturnsThis function returns the unsigned integer value associated with the specified keyDetails. DetailsSee am_properties_get(). am_properties_get_with_default()Retrieves values from the properties map. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get_with_default(am_properties_t properties,
const char *key, const char *default_value,
const char **value_ptr);
ParametersThis function takes the following parameters:
DetailsThis function checks if the key is present is the properties instance. If the key is not present, the function returns the default value passed in. Otherwise it returns the value of the key. Memory Concerns: Caller must not modify the value_ptr structure or free the memory. am_properties_is_set()Determines whether the object contains property with the specified name. Syntax#include "am_properties.h"
AM_EXPORT boolean_t
am_properties_is_set(am_properties_t properties,
const char *key);
ParametersThis function takes the following parameters:
ReturnsThis function returns boolean_t with one of the following values:
am_properties_iter_destroy()Destroys the properties iterator object referenced by the provided handle. Syntax#include "am_properties.h" AM_EXPORT void am_properties_iter_destroy(am_properties_iter_t properties_iter); ParametersThis function takes the following parameters:
ReturnsNone am_properties_iter_get_key()Returns the key of the element currently referenced by the specified iterator. Syntax#include "am_properties.h"
AM_EXPORT const char * am_properties_iter_get_key
(am_properties_iter_t properties_iter);
ParametersThis function takes the following parameters:
ReturnsThis function returns const char * with one of the following values:
am_properties_iter_get_value()Returns the value of the element currently referenced by the specified iterator. Syntax#include "am_properties.h"
AM_EXPORT const char * am_properties_iter_get_value
(am_properties_iter_t properties_iter);
ParametersThis function takes the following parameters:
ReturnsThis function returns const char * with one of the following values:
am_properties_load()Loads property information from the specified file. Syntax#include "am_properties.h" AM_EXPORT am_status_t am_properties_load(am_properties_t properties, const char *file_name); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThe file is expected to use the standard Java Properties file syntax. am_properties_set()Sets the value associated with the specified key. Syntax#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_set(am_properties_t properties, const char *key,
const char *value);
ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
DetailsThe specified value will replace any previously existing value. am_properties_store()Stores the property information in the specified file. Syntax#include "am_properties.h" AM_EXPORT am_status_t am_properties_store(am_properties_t properties, const char *file_name); ParametersThis function takes the following parameters:
ReturnsThis function returns am_status_t with one of the following values:
|