globus_gass_cache 10.3
Loading...
Searching...
No Matches
globus_gass_cache.h
Go to the documentation of this file.
1/*
2 * Copyright 1999-2006 University of Chicago
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
22#ifndef GLOBUS_GASS_CACHE_H
23#define GLOBUS_GASS_CACHE_H
24
25#include "globus_common.h"
26
27#include <sys/param.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
38#endif
43/*
44 * Codes returned by globus_gass_cache module
45 */
46#define GLOBUS_GASS_CACHE_ADD_NEW 1
47#define GLOBUS_GASS_CACHE_URL_NOT_FOUND 2
48#define GLOBUS_GASS_CACHE_ADD_EXISTS 3
49
50#define GLOBUS_GASS_CACHE_ERROR_NO_HOME -1
51#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE -2
52#define GLOBUS_GASS_CACHE_ERROR_NAME_TOO_LONG -3
53#define GLOBUS_GASS_CACHE_ERROR_LOCK_ERROR -4
54/* not used in a first impl.: */
55#define GLOBUS_GASS_CACHE_ERROR_LOCK_TIME_OUT -5
56#define GLOBUS_GASS_CACHE_ERROR_OPEN_STATE -6
57#define GLOBUS_GASS_CACHE_ERROR_STATE_F_CORRUPT -7
58#define GLOBUS_GASS_CACHE_ERROR_NO_MEMORY -8
59#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE_DATA_F -9
60/* only for "done" or delete :*/
61#define GLOBUS_GASS_CACHE_ERROR_URL_NOT_FOUND -10
62#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DEL_LOCK -11
63#define GLOBUS_GASS_CACHE_ERROR_WRONG_TAG -12
64#define GLOBUS_GASS_CACHE_ERROR_ALREADY_DONE -13
65#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_WRITE -14
66#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_READ -15
67#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DELETE_DATA_F -16
68#define GLOBUS_GASS_CACHE_ERROR_CACHE_NOT_OPENED -17
69#define GLOBUS_GASS_CACHE_ERROR_CACHE_ALREADY_OPENED -18
70#define GLOBUS_GASS_CACHE_ERROR_INVALID_PARRAMETER -19
71#define GLOBUS_GASS_CACHE_ERROR_INVALID_VERSION -20
72#define GLOBUS_GASS_CACHE_ERROR_NO_SPACE -21
73#define GLOBUS_GASS_CACHE_ERROR_QUOTA_EXCEEDED -22
74
75#define GLOBUS_GASS_CACHE_TIMESTAMP_UNKNOWN 0UL
76
85typedef struct globus_i_gass_cache_t * globus_gass_cache_t;
86
87
88extern
89int
90globus_gass_cache_open(const char* cache_directory_path,
91 globus_gass_cache_t* cache_handle);
92
93extern int
95
96extern
97int
99 const char *url,
100 const char *tag,
101 globus_bool_t create,
102 unsigned long *timestamp,
103 char **local_filename);
104
105extern
106int
108 globus_gass_cache_t cache_handle,
109 const char *url,
110 const char *tag,
111 unsigned long timestamp);
112
113extern
114int
116 globus_gass_cache_t cache_handle,
117 const char *url,
118 const char *tag,
119 globus_bool_t wait_for_lock,
120 unsigned long *timestamp,
121 char **local_filename,
122 globus_bool_t *is_locked );
123
124
125extern
126int
128 globus_gass_cache_t cache_handle,
129 const char *url,
130 const char *tag,
131 unsigned long *timestamp);
132
133extern
134int
136 globus_gass_cache_t cache_handle,
137 const char *url,
138 const char *tag,
139 unsigned long timestamp,
140 globus_bool_t is_locked);
141
142extern
143int
145 globus_gass_cache_t cache_handle,
146 const char *url,
147 const char *tag);
148
149extern
150int
152 globus_gass_cache_t cache_handle,
153 char *tag );
154
155extern
156int
158 const char *url,
159 char **mangled_url,
160 int *length );
161
162extern
163int
165 const char *tag,
166 char **mangled_tag,
167 int *length );
168
169extern
170int
172 const char *url,
173 const char *tag,
174 char **global_root,
175 char **local_root,
176 char **tmp_root,
177 char **log_root,
178 char **global_dir,
179 char **local_dir );
180
181extern
182int
184 char **cache_dir );
185
186extern
187int
189 char **cache_type );
190
191extern
192const char *
194 int error_code);
195
200#define GLOBUS_GASS_CACHE_MODULE (&globus_i_gass_cache_module)
201
202extern globus_module_descriptor_t globus_i_gass_cache_module;
203
204#ifdef __cplusplus
205}
206#endif
207
208#endif /* GLOBUS_GASS_CACHE_H */
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:5545
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:6283
int globus_gass_cache_close(globus_gass_cache_t *cache_handle)
Close a cache handle.
Definition globus_gass_cache.c:5161
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:6002
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:6403
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:6192
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:4669
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:6442
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:5741
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:6227
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:5925
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:5845
struct globus_i_gass_cache_t * globus_gass_cache_t
GASS Cache Handle.
Definition globus_gass_cache.h:85
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:5289
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:5641
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:6148