Grid Community Toolkit  6.2.1541705016
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 
42 /*
43  * Codes returned by globus_gass_cache module
44  */
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
48 
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
53 /* not used in a first impl.: */
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
59 /* only for "done" or delete :*/
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
73 
74 #define GLOBUS_GASS_CACHE_TIMESTAMP_UNKNOWN 0UL
75 
84 typedef struct globus_i_gass_cache_t * globus_gass_cache_t;
85 
86 
87 extern
88 int
89 globus_gass_cache_open(const char* cache_directory_path,
90  globus_gass_cache_t* cache_handle);
91 
92 extern int
94 
95 extern
96 int
98  const char *url,
99  const char *tag,
100  globus_bool_t create,
101  unsigned long *timestamp,
102  char **local_filename);
103 
104 extern
105 int
107  globus_gass_cache_t cache_handle,
108  const char *url,
109  const char *tag,
110  unsigned long timestamp);
111 
112 extern
113 int
115  globus_gass_cache_t cache_handle,
116  const char *url,
117  const char *tag,
118  globus_bool_t wait_for_lock,
119  unsigned long *timestamp,
120  char **local_filename,
121  globus_bool_t *is_locked );
122 
123 
124 extern
125 int
127  globus_gass_cache_t cache_handle,
128  const char *url,
129  const char *tag,
130  unsigned long *timestamp);
131 
132 extern
133 int
135  globus_gass_cache_t cache_handle,
136  const char *url,
137  const char *tag,
138  unsigned long timestamp,
139  globus_bool_t is_locked);
140 
141 extern
142 int
144  globus_gass_cache_t cache_handle,
145  const char *url,
146  const char *tag);
147 
148 extern
149 int
151  globus_gass_cache_t cache_handle,
152  char *tag );
153 
154 extern
155 int
157  const char *url,
158  char **mangled_url,
159  int *length );
160 
161 extern
162 int
164  const char *tag,
165  char **mangled_tag,
166  int *length );
167 
168 extern
169 int
171  const char *url,
172  const char *tag,
173  char **global_root,
174  char **local_root,
175  char **tmp_root,
176  char **log_root,
177  char **global_dir,
178  char **local_dir );
179 
180 extern
181 int
183  char **cache_dir );
184 
185 extern
186 int
188  char **cache_type );
189 
190 extern
191 const char *
193  int error_code);
194 
199 #define GLOBUS_GASS_CACHE_MODULE (&globus_i_gass_cache_module)
200 
201 extern globus_module_descriptor_t globus_i_gass_cache_module;
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #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:84
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_handle)
Open a GASS Cache.
Definition: globus_gass_cache.c:4669
int globus_gass_cache_close(globus_gass_cache_t *cache_handle)
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:69
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