Grid Community Toolkit  6.2.1653033972 (tag: v6.2.20220524)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
30 extern "C" {
31 #endif
32 
33 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
34 
38 #endif
39 
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 
85 typedef struct globus_i_gass_cache_t * globus_gass_cache_t;
86 
87 
88 extern
89 int
90 globus_gass_cache_open(const char* cache_directory_path,
91  globus_gass_cache_t* cache_handle);
92 
93 extern int
94 globus_gass_cache_close(globus_gass_cache_t * cache_handle);
95 
96 extern
97 int
98 globus_gass_cache_add(globus_gass_cache_t cache_handle,
99  const char *url,
100  const char *tag,
101  globus_bool_t create,
102  unsigned long *timestamp,
103  char **local_filename);
104 
105 extern
106 int
108  globus_gass_cache_t cache_handle,
109  const char *url,
110  const char *tag,
111  unsigned long timestamp);
112 
113 extern
114 int
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 
125 extern
126 int
128  globus_gass_cache_t cache_handle,
129  const char *url,
130  const char *tag,
131  unsigned long *timestamp);
132 
133 extern
134 int
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 
142 extern
143 int
145  globus_gass_cache_t cache_handle,
146  const char *url,
147  const char *tag);
148 
149 extern
150 int
152  globus_gass_cache_t cache_handle,
153  char *tag );
154 
155 extern
156 int
157 globus_gass_cache_mangle_url( const globus_gass_cache_t cache_handle,
158  const char *url,
159  char **mangled_url,
160  int *length );
161 
162 extern
163 int
164 globus_gass_cache_mangle_tag( const globus_gass_cache_t cache_handle,
165  const char *tag,
166  char **mangled_tag,
167  int *length );
168 
169 extern
170 int
171 globus_gass_cache_get_dirs( const globus_gass_cache_t cache_handle,
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 
181 extern
182 int
183 globus_gass_cache_get_cache_dir( const globus_gass_cache_t cache_handle,
184  char **cache_dir );
185 
186 extern
187 int
188 globus_gass_cache_get_cache_type_string( const globus_gass_cache_t cache_handle,
189  char **cache_type );
190 
191 extern
192 const char *
194  int error_code);
195 
200 #define GLOBUS_GASS_CACHE_MODULE (&globus_i_gass_cache_module)
201 
202 extern 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_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_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&#39;s tag list...
Definition: globus_gass_cache.c:6002
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_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_bool_t
Boolean type.
Definition: globus_types.h:93
struct globus_i_gass_cache_t * globus_gass_cache_t
GASS Cache Handle.
Definition: globus_gass_cache.h:85
int globus_gass_cache_get_cache_dir(const globus_gass_cache_t cache_handle, char **cache_dir)
Get the GASS Cache&#39;s root directory.
Definition: globus_gass_cache.c:6227
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_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_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&#39;s tag list.
Definition: globus_gass_cache.c:5845
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_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
int globus_gass_cache_open(const char *cache_directory_path, globus_gass_cache_t *cache_handlep)
Open a GASS Cache.
Definition: globus_gass_cache.c:4669
int globus_gass_cache_close(globus_gass_cache_t *cache_handlep)
Close a cache handle.
Definition: globus_gass_cache.c:5161
Headers common to all of Globus.
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_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
Module Descriptor.
Definition: globus_module.h:71
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