| libinfinity-0.6 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ||||
#include <libinfinity/server/infd-filesystem-account-storage.h>
InfdFilesystemAccountStorage;
struct InfdFilesystemAccountStorageClass;
enum InfdFilesystemAccountStorageError;
InfdFilesystemAccountStorage * infd_filesystem_account_storage_new
(void);
gboolean infd_filesystem_account_storage_set_filesystem
(InfdFilesystemAccountStorage *s,
InfdFilesystemStorage *fs,
GError **error);
This class implements the InfdAccountStorage interface via an underlying InfdFilesystemStorage. It uses the "root-directory" of that underlying storage to store an XML file there which contains the account information.
This is a simple implementation of an account storage which keeps all accounts read from the file in memory. When you have more than a thousand accounts or so you should start thinking of using a more sophisticated account storage, for example a database backend.
typedef struct _InfdFilesystemAccountStorage InfdFilesystemAccountStorage;
InfdFilesystemAccountStorage is an opaque data type. You should only access it via the public API functions.
struct InfdFilesystemAccountStorageClass {
};
This structure does not contain any public fields.
typedef enum {
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR_INVALID_FORMAT,
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR_DUPLICATE_NAME,
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR_DUPLICATE_CERTIFICATE,
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR_IDS_EXHAUSTED,
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR_NO_SUCH_ACCOUNT
} InfdFilesystemAccountStorageError;
Specifies the possible error codes in the
INFD_FILESYSTEM_ACCOUNT_STORAGE_ERROR error domain.
Such errors can occur when reading the accounts file from disk.
| An on-disk XML file is not formatted correctly. | |
| An account name is already in use. | |
| An account which uses the same certificate to login exists already. | |
| Could not obtain a unique account ID. | |
| The account with the given ID does not exist. |
InfdFilesystemAccountStorage * infd_filesystem_account_storage_new
(void);
Creates a new InfdFilesystemAccountStorage that stores its account list as
a file in the filesystem. Use
infd_filesystem_account_storage_set_filesystem() to set the underlying
InfdFilesystemStorage object.
Returns : |
A new InfdFilesystemAccountStorage. |
gboolean infd_filesystem_account_storage_set_filesystem (InfdFilesystemAccountStorage *s,InfdFilesystemStorage *fs,GError **error);
Uses fs as the underlying InfdFilesystemStorage for s. The
"root-directory" property specifies where the account
list is stored.
If an error occurs while loading the account list, the function returns
FALSE and error is set.
|
A InfdFilesystemAccountStorage. |
|
The underlying InfdFilesystemStorage to use. |
|
Location for error information, if any, or NULL. |
Returns : |
TRUE on success or FALSE on error. |
"filesystem-storage" property"filesystem-storage" InfdFilesystemStorage* : Read / Write
The filesystem storage which to use the store the accounts file.