34 #ifndef _ASTERISK_BUCKET_H 35 #define _ASTERISK_BUCKET_H 37 #if defined(__cplusplus) || defined(c_plusplus) 68 struct timeval created;
70 struct timeval modified;
89 struct timeval created;
91 struct timeval modified;
137 #define ast_bucket_scheme_register(name, bucket, file, create_cb, destroy_cb) __ast_bucket_scheme_register(name, bucket, file, create_cb, destroy_cb, AST_MODULE_SELF) 473 #if defined(__cplusplus) || defined(c_plusplus) struct ast_bucket_metadata * ast_bucket_file_metadata_get(struct ast_bucket_file *file, const char *name)
Retrieve a metadata attribute from a file.
struct ast_bucket * ast_bucket_alloc(const char *uri)
Allocate a new bucket.
int ast_bucket_create(struct ast_bucket *bucket)
Create a new bucket in backend storage.
void(* bucket_file_destroy_cb)(struct ast_bucket_file *file)
A callback function invoked when destroying a file snapshot.
int ast_bucket_file_metadata_set(struct ast_bucket_file *file, const char *name, const char *value)
Set a metadata attribute on a file to a specific value.
struct ao2_container * files
Container of string URIs of files within this bucket.
struct ast_bucket * ast_bucket_clone(struct ast_bucket *bucket)
Clone a bucket.
int __ast_bucket_scheme_register(const char *name, struct ast_sorcery_wizard *bucket, struct ast_sorcery_wizard *file, bucket_file_create_cb create_cb, bucket_file_destroy_cb destroy_cb, struct ast_module *module)
Register support for a specific scheme.
Bucket structure, contains other buckets and files.
int(* bucket_file_create_cb)(struct ast_bucket_file *file)
A callback function invoked when creating a file snapshot.
struct ast_bucket_file * ast_bucket_file_retrieve(const char *uri)
Retrieve a bucket file.
int ast_bucket_init(void)
Initialize bucket support.
struct ast_bucket_scheme * scheme_impl
Scheme implementation in use.
struct ast_bucket_file * ast_bucket_file_copy(struct ast_bucket_file *file, const char *uri)
Copy a bucket file to a new URI.
int ast_bucket_file_observer_add(const struct ast_sorcery_observer *callbacks)
Add an observer for bucket file creation and deletion operations.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
int ast_bucket_observer_add(const struct ast_sorcery_observer *callbacks)
Add an observer for bucket creation and deletion operations.
struct ast_bucket_file * ast_bucket_file_alloc(const char *uri)
Allocate a new bucket file.
int() ao2_callback_fn(void *obj, void *arg, int flags)
Type of a generic callback function.
struct ao2_container * buckets
Container of string URIs of buckets within this bucket.
struct ast_bucket_file * ast_bucket_file_clone(struct ast_bucket_file *file)
Clone a bucket file.
#define AST_STRING_FIELD(name)
Declare a string field.
int ast_bucket_file_delete(struct ast_bucket_file *file)
Delete a bucket file from backend storage.
struct ast_json * ast_bucket_file_json(const struct ast_bucket_file *file)
Get a JSON representation of a bucket file.
int ast_bucket_file_is_stale(struct ast_bucket_file *file)
Retrieve whether or not the backing datastore views the bucket file as stale.
void ast_bucket_file_metadata_callback(struct ast_bucket_file *file, ao2_callback_fn cb, void *arg)
Execute a callback function on the metadata associated with a file.
Bucket file structure, contains reference to file and information about it.
void ast_bucket_observer_remove(const struct ast_sorcery_observer *callbacks)
Remove an observer from bucket creation and deletion.
struct ast_bucket * ast_bucket_retrieve(const char *uri)
Retrieve information about a bucket.
#define SORCERY_OBJECT(details)
Macro which must be used at the beginning of each sorcery capable object.
Interface for a sorcery object type observer.
struct ao2_container * metadata
Container of metadata attributes about file.
int ast_bucket_delete(struct ast_bucket *bucket)
Delete a bucket from backend storage.
struct ast_bucket_scheme * scheme_impl
Scheme implementation in use.
int ast_bucket_file_temporary_create(struct ast_bucket_file *file)
Common file snapshot creation callback for creating a temporary file.
Interface for a sorcery wizard.
int ast_bucket_file_update(struct ast_bucket_file *file)
Update an existing bucket file in backend storage.
void ast_bucket_file_observer_remove(const struct ast_sorcery_observer *callbacks)
Remove an observer from bucket file creation and deletion.
int ast_bucket_file_metadata_unset(struct ast_bucket_file *file, const char *name)
Unset a specific metadata attribute on a file.
Structure for available schemes.
Abstract JSON element (object, array, string, int, ...).
struct ast_json * ast_bucket_json(const struct ast_bucket *bucket)
Get a JSON representation of a bucket.
void ast_bucket_file_temporary_destroy(struct ast_bucket_file *file)
Common file snapshot destruction callback for deleting a temporary file.
int ast_bucket_is_stale(struct ast_bucket *bucket)
Retrieve whether or not the backing datastore views the bucket as stale.
int ast_bucket_file_create(struct ast_bucket_file *file)
Create a new bucket file in backend storage.
Sorcery Data Access Layer API.