22 #ifndef GLOBUS_GASS_CACHE_H
23 #define GLOBUS_GASS_CACHE_H
25 #include "globus_common.h"
27 #include <sys/param.h>
33 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
45 #define GLOBUS_GASS_CACHE_ADD_NEW 1
46 #define GLOBUS_GASS_CACHE_URL_NOT_FOUND 2
47 #define GLOBUS_GASS_CACHE_ADD_EXISTS 3
49 #define GLOBUS_GASS_CACHE_ERROR_NO_HOME -1
50 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE -2
51 #define GLOBUS_GASS_CACHE_ERROR_NAME_TOO_LONG -3
52 #define GLOBUS_GASS_CACHE_ERROR_LOCK_ERROR -4
54 #define GLOBUS_GASS_CACHE_ERROR_LOCK_TIME_OUT -5
55 #define GLOBUS_GASS_CACHE_ERROR_OPEN_STATE -6
56 #define GLOBUS_GASS_CACHE_ERROR_STATE_F_CORRUPT -7
57 #define GLOBUS_GASS_CACHE_ERROR_NO_MEMORY -8
58 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE_DATA_F -9
60 #define GLOBUS_GASS_CACHE_ERROR_URL_NOT_FOUND -10
61 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DEL_LOCK -11
62 #define GLOBUS_GASS_CACHE_ERROR_WRONG_TAG -12
63 #define GLOBUS_GASS_CACHE_ERROR_ALREADY_DONE -13
64 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_WRITE -14
65 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_READ -15
66 #define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DELETE_DATA_F -16
67 #define GLOBUS_GASS_CACHE_ERROR_CACHE_NOT_OPENED -17
68 #define GLOBUS_GASS_CACHE_ERROR_CACHE_ALREADY_OPENED -18
69 #define GLOBUS_GASS_CACHE_ERROR_INVALID_PARRAMETER -19
70 #define GLOBUS_GASS_CACHE_ERROR_INVALID_VERSION -20
71 #define GLOBUS_GASS_CACHE_ERROR_NO_SPACE -21
72 #define GLOBUS_GASS_CACHE_ERROR_QUOTA_EXCEEDED -22
74 #define GLOBUS_GASS_CACHE_TIMESTAMP_UNKNOWN 0UL
90 globus_gass_cache_t* cache_handle);
100 globus_bool_t create,
101 unsigned long *timestamp,
102 char **local_filename);
107 globus_gass_cache_t cache_handle,
110 unsigned long timestamp);
115 globus_gass_cache_t cache_handle,
118 globus_bool_t wait_for_lock,
119 unsigned long *timestamp,
120 char **local_filename,
121 globus_bool_t *is_locked );
127 globus_gass_cache_t cache_handle,
130 unsigned long *timestamp);
135 globus_gass_cache_t cache_handle,
138 unsigned long timestamp,
139 globus_bool_t is_locked);
144 globus_gass_cache_t cache_handle,
151 globus_gass_cache_t cache_handle,
199 #define GLOBUS_GASS_CACHE_MODULE (&globus_i_gass_cache_module)
201 extern globus_module_descriptor_t globus_i_gass_cache_module;
int globus_gass_cache_query(globus_gass_cache_t cache_handle, const char *url, const char *tag, globus_bool_t wait_for_lock, unsigned long *timestamp, char **local_filename, globus_bool_t *is_locked)
Query the GASS Cache.
Definition: globus_gass_cache.c:5620
int globus_gass_cache_cleanup_tag_all(globus_gass_cache_t cache_handle, char *tag)
Remove a tag from all cache entriesRemove all instances of the tag from the cache entry's tag list...
Definition: globus_gass_cache.c:5981
int globus_gass_cache_delete_start(globus_gass_cache_t cache_handle, const char *url, const char *tag, unsigned long *timestamp)
Remove a cache tag.
Definition: globus_gass_cache.c:5720
int globus_gass_cache_add(globus_gass_cache_t cache_handle, const char *url, const char *tag, globus_bool_t create, unsigned long *timestamp, char **local_filename)
Add a tag to an URL in the cache.
Definition: globus_gass_cache.c:5268
struct globus_i_gass_cache_t * globus_gass_cache_t
GASS Cache Handle.
Definition: globus_gass_cache.h:84
int globus_gass_cache_get_cache_dir(const globus_gass_cache_t cache_handle, char **cache_dir)
Get the GASS Cache's root directory.
Definition: globus_gass_cache.c:6198
int globus_gass_cache_get_cache_type_string(const globus_gass_cache_t cache_handle, char **cache_type)
Get the type of GASS Cache directory layout.
Definition: globus_gass_cache.c:6374
int globus_gass_cache_get_dirs(const globus_gass_cache_t cache_handle, const char *url, const char *tag, char **global_root, char **local_root, char **tmp_root, char **log_root, char **global_dir, char **local_dir)
Get the set of directories used by a GASS Cache.
Definition: globus_gass_cache.c:6254
int globus_gass_cache_delete(globus_gass_cache_t cache_handle, const char *url, const char *tag, unsigned long timestamp, globus_bool_t is_locked)
Remove one instance of the tag from the cache entry's tag list.
Definition: globus_gass_cache.c:5824
int globus_gass_cache_mangle_tag(const globus_gass_cache_t cache_handle, const char *tag, char **mangled_tag, int *length)
Convert a tag to a string suitable as a file path.
Definition: globus_gass_cache.c:6163
int globus_gass_cache_mangle_url(const globus_gass_cache_t cache_handle, const char *url, char **mangled_url, int *length)
Convert a URL to a string suitable as a file path.
Definition: globus_gass_cache.c:6119
int globus_gass_cache_open(const char *cache_directory_path, globus_gass_cache_t *cache_handle)
Open a GASS Cache.
Definition: globus_gass_cache.c:4653
int globus_gass_cache_close(globus_gass_cache_t *cache_handle)
Close a cache handle.
Definition: globus_gass_cache.c:5140
int globus_gass_cache_cleanup_tag(globus_gass_cache_t cache_handle, const char *url, const char *tag)
Remove a tag from a cache entry.
Definition: globus_gass_cache.c:5904
int globus_gass_cache_add_done(globus_gass_cache_t cache_handle, const char *url, const char *tag, unsigned long timestamp)
Complete adding a cache entry and unlock it.
Definition: globus_gass_cache.c:5524
const char * globus_gass_cache_error_string(int error_code)
Look up the error string corresponding to a GASS Cache error.
Definition: globus_gass_cache.c:6413