Fire Foot API Reference Manual |
---|
FFService — Class for handling service managed task.
#include <ff-service.h> struct FFService; struct FFServiceClass; FFService* ff_service_new (void); void ff_service_set_server_address (FFService *self, const gchar *server_address); const gchar* ff_service_get_server_address (FFService *self); void ff_service_set_user_name (FFService *self, const gchar *user_name); const gchar* ff_service_get_user_name (FFService *self); void ff_service_set_password (FFService *self, const gchar *password); const gchar* ff_service_get_password (FFService *self); gboolean ff_service_is_attached (FFService *self); gboolean ff_service_attach (FFService *self); gboolean ff_service_detach (FFService *self); gboolean ff_service_add_user (FFService *self, FFUser *new_user, gboolean free_user); gboolean ff_service_modify_user (FFService *self, FFUser *user, gboolean free_user); gboolean ff_service_delete_user (FFService *self, const gchar *user_name); FFUser* ff_service_get_user (FFService *self, const gchar *user_name); GList* ff_service_get_user_list (FFService *self); gboolean ff_service_make_backup (FFService *self, const gchar *db_file, const gchar *bkp_file, gulong options); gboolean ff_service_restore_backup (FFService *self, const gchar *bkp_file, const gchar *db_file, gulong options);
struct FFServiceClass { void (* on_error) (FFService *self, gchar *message, gpointer data); void (* on_attach) (FFService *self, gpointer data); void (* on_dettach) (FFService *self, gpointer data); };
FFService* ff_service_new (void);
Constructor for FFService class.
Returns : | A new FFService object. |
void ff_service_set_server_address (FFService *self, const gchar *server_address);
Set database server address where service will be connected.
self : | A FFService. |
server_address : | A string containing a server address (an IP number). |
const gchar* ff_service_get_server_address (FFService *self);
Get database server address where service will be connected.
self : | A FFService. |
Returns : | A string containing server address, or NULL. |
void ff_service_set_user_name (FFService *self, const gchar *user_name);
Set the user name that the service will use to identify itself to the server.
self : | A FFService. |
user_name : | A string containing a user name. |
const gchar* ff_service_get_user_name (FFService *self);
Get the user name that the service will use to identify itself to the server.
self : | A FFService. |
Returns : | A string containing the user name, or NULL. |
void ff_service_set_password (FFService *self, const gchar *password);
Set password for the current service user (user name assigned with ff_service_set_user_name()). The password is used to autenticate service against database server.
self : | A FFService. |
password : | A string containing a password. |
const gchar* ff_service_get_password (FFService *self);
Get password for the current service user.
self : | A FFService. |
Returns : | A string containing the password, or NULL. |
gboolean ff_service_is_attached (FFService *self);
Get service attached status.
self : | A FFService. |
Returns : | TRUE if service is attached to server, or FALSE otherwise. |
gboolean ff_service_attach (FFService *self);
Attach service to database server. This function must be called before the execution of any action.
self : | A FFService. |
Returns : | TRUE if service attached successfully to server, or FALSE otherwise. |
gboolean ff_service_detach (FFService *self);
Detach service from database server. This function must be called when the service wont be used anymore.
self : | A FFService. |
Returns : | TRUE if service detached successfully from server, or FALSE otherwise. |
gboolean ff_service_add_user (FFService *self, FFUser *new_user, gboolean free_user);
Add a new user in database server. If free_user is TRUE then new_user will be released after this function ends. Parameter new_user must be initialized by programmer with the correct values.
gboolean ff_service_modify_user (FFService *self, FFUser *user, gboolean free_user);
Modify a user in database server. If free_user is TRUE then user will be released after this function ends. Parameter user must be initialized by programmer with the correct values. And user->user_name must be the name of the user to be modified. This is why the user name can't be modified, in the case you need to modify it you should delete and recreate the user with the new name.
gboolean ff_service_delete_user (FFService *self, const gchar *user_name);
Delete the user from database server.
self : | A FFService. |
user_name : | A string containing a valid user name. |
Returns : | TRUE if user was deleted successfully, or FALSE otherwise. |
FFUser* ff_service_get_user (FFService *self, const gchar *user_name);
Get info of a user.
GList* ff_service_get_user_list (FFService *self);
Get a list of FFUser nodes, with information about all available users in database server.
gboolean ff_service_make_backup (FFService *self, const gchar *db_file, const gchar *bkp_file, gulong options);
Make a backup of db_file.
Backup options:
self : | A FFService. |
db_file : | A string containing full path and name of database file to backup. |
bkp_file : | A string containing full path and name of database backup file. |
options : | Bitmask of backup options. |
Returns : | TRUE if a backup was made, or FALSE otherwise. |
gboolean ff_service_restore_backup (FFService *self, const gchar *bkp_file, const gchar *db_file, gulong options);
Restore a Firebird backup file.
Restore options:
self : | A FFService. |
bkp_file : | A string containing full path and name of database backup file. |
db_file : | A string containing full path and name of database file to restore. |
options : | Bitmask of restore options. |
Returns : | TRUE if a backup was restored, or FALSE otherwise. |
<< FFValue | FFParameter >> |