A file system based persistence implementation. More...
#include "OsWrapper.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include "MQTTClientPersistence.h"
#include "MQTTPersistenceDefault.h"
#include "StackTrace.h"
#include "Heap.h"
Go to the source code of this file.
Functions | |
int | clearUnix (char *) |
int | containskeyUnix (char *, char *) |
int | keysUnix (char *, char ***, int *) |
int | pstclear (void *handle) |
int | pstclose (void *handle) |
int | pstcontainskey (void *handle, char *key) |
int | pstget (void *handle, char *key, char **buffer, int *buflen) |
int | pstkeys (void *handle, char ***keys, int *nkeys) |
int | pstmkdir (char *pPathname) |
int | pstopen (void **handle, const char *clientID, const char *serverURI, void *context) |
int | pstput (void *handle, char *key, int bufcount, char *buffers[], int buflens[]) |
int | pstremove (void *handle, char *key) |
A file system based persistence implementation.
A directory is specified when the MQTT client is created. When the persistence is then opened (see Persistence_open), a sub-directory is made beneath the base for this particular client ID and connection key. This allows one persistence base directory to be shared by multiple clients.
Definition in file MQTTPersistenceDefault.c.
int clearUnix | ( | char * | dirname | ) |
Definition at line 578 of file MQTTPersistenceDefault.c.
int containskeyUnix | ( | char * | dirname, |
char * | key | ||
) |
Definition at line 451 of file MQTTPersistenceDefault.c.
int keysUnix | ( | char * | dirname, |
char *** | keys, | ||
int * | nkeys | ||
) |
Definition at line 722 of file MQTTPersistenceDefault.c.
int pstclear | ( | void * | handle | ) |
Delete all the persisted message in the client persistence directory. See Persistence_clear
Definition at line 504 of file MQTTPersistenceDefault.c.
int pstclose | ( | void * | handle | ) |
Delete client persistence directory (if empty). See Persistence_close
Definition at line 344 of file MQTTPersistenceDefault.c.
int pstcontainskey | ( | void * | handle, |
char * | key | ||
) |
Returns whether if a wire message is persisted in the client persistence directory. See Persistence_containskey
Definition at line 378 of file MQTTPersistenceDefault.c.
int pstget | ( | void * | handle, |
char * | key, | ||
char ** | buffer, | ||
int * | buflen | ||
) |
Retrieve a wire message from the client persistence directory. See Persistence_get
Definition at line 243 of file MQTTPersistenceDefault.c.
int pstkeys | ( | void * | handle, |
char *** | keys, | ||
int * | nkeys | ||
) |
Returns the keys (file names w/o the extension) in the client persistence directory. See Persistence_keys
Definition at line 609 of file MQTTPersistenceDefault.c.
int pstmkdir | ( | char * | pPathname | ) |
Function to create a directory. Returns 0 on success or if the directory already exists.
Definition at line 157 of file MQTTPersistenceDefault.c.
int pstopen | ( | void ** | handle, |
const char * | clientID, | ||
const char * | serverURI, | ||
void * | context | ||
) |
Create persistence directory for the client: context/clientID-serverURI. See Persistence_open
Definition at line 64 of file MQTTPersistenceDefault.c.
int pstput | ( | void * | handle, |
char * | key, | ||
int | bufcount, | ||
char * | buffers[], | ||
int | buflens[] | ||
) |
Write wire message to the client persistence directory. See Persistence_put
Definition at line 187 of file MQTTPersistenceDefault.c.
int pstremove | ( | void * | handle, |
char * | key | ||
) |
Delete a persisted message from the client persistence directory. See Persistence_remove
Definition at line 300 of file MQTTPersistenceDefault.c.