Loading...
Searching...
No Matches
globus_gass_cache.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_GASS_CACHE_H
#define GLOBUS_GASS_CACHE_H
#include "globus_common.h"
#include <sys/param.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
#endif
/*
* Codes returned by globus_gass_cache module
*/
#define GLOBUS_GASS_CACHE_ADD_NEW 1
#define GLOBUS_GASS_CACHE_URL_NOT_FOUND 2
#define GLOBUS_GASS_CACHE_ADD_EXISTS 3
#define GLOBUS_GASS_CACHE_ERROR_NO_HOME -1
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE -2
#define GLOBUS_GASS_CACHE_ERROR_NAME_TOO_LONG -3
#define GLOBUS_GASS_CACHE_ERROR_LOCK_ERROR -4
/* not used in a first impl.: */
#define GLOBUS_GASS_CACHE_ERROR_LOCK_TIME_OUT -5
#define GLOBUS_GASS_CACHE_ERROR_OPEN_STATE -6
#define GLOBUS_GASS_CACHE_ERROR_STATE_F_CORRUPT -7
#define GLOBUS_GASS_CACHE_ERROR_NO_MEMORY -8
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_CREATE_DATA_F -9
/* only for "done" or delete :*/
#define GLOBUS_GASS_CACHE_ERROR_URL_NOT_FOUND -10
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DEL_LOCK -11
#define GLOBUS_GASS_CACHE_ERROR_WRONG_TAG -12
#define GLOBUS_GASS_CACHE_ERROR_ALREADY_DONE -13
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_WRITE -14
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_READ -15
#define GLOBUS_GASS_CACHE_ERROR_CAN_NOT_DELETE_DATA_F -16
#define GLOBUS_GASS_CACHE_ERROR_CACHE_NOT_OPENED -17
#define GLOBUS_GASS_CACHE_ERROR_CACHE_ALREADY_OPENED -18
#define GLOBUS_GASS_CACHE_ERROR_INVALID_PARRAMETER -19
#define GLOBUS_GASS_CACHE_ERROR_INVALID_VERSION -20
#define GLOBUS_GASS_CACHE_ERROR_NO_SPACE -21
#define GLOBUS_GASS_CACHE_ERROR_QUOTA_EXCEEDED -22
#define GLOBUS_GASS_CACHE_TIMESTAMP_UNKNOWN 0UL
typedef struct globus_i_gass_cache_t * globus_gass_cache_t;
extern
int
globus_gass_cache_open(const char* cache_directory_path,
globus_gass_cache_t* cache_handle);
extern int
globus_gass_cache_close(globus_gass_cache_t * cache_handle);
extern
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);
extern
int
globus_gass_cache_add_done(
globus_gass_cache_t cache_handle,
const char *url,
const char *tag,
unsigned long timestamp);
extern
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 );
extern
int
globus_gass_cache_delete_start(
globus_gass_cache_t cache_handle,
const char *url,
const char *tag,
unsigned long *timestamp);
extern
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);
extern
int
globus_gass_cache_cleanup_tag(
globus_gass_cache_t cache_handle,
const char *url,
const char *tag);
extern
int
globus_gass_cache_cleanup_tag_all(
globus_gass_cache_t cache_handle,
char *tag );
extern
int
globus_gass_cache_mangle_url( const globus_gass_cache_t cache_handle,
const char *url,
char **mangled_url,
int *length );
extern
int
globus_gass_cache_mangle_tag( const globus_gass_cache_t cache_handle,
const char *tag,
char **mangled_tag,
int *length );
extern
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 );
extern
int
globus_gass_cache_get_cache_dir( const globus_gass_cache_t cache_handle,
char **cache_dir );
extern
int
globus_gass_cache_get_cache_type_string( const globus_gass_cache_t cache_handle,
char **cache_type );
extern
const char *
globus_gass_cache_error_string(
int error_code);
#define GLOBUS_GASS_CACHE_MODULE (&globus_i_gass_cache_module)
extern globus_module_descriptor_t globus_i_gass_cache_module;
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_GASS_CACHE_H */
globus_gass_cache_add_done
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:5544
globus_gass_cache_get_dirs
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:6282
globus_gass_cache_close
int globus_gass_cache_close(globus_gass_cache_t *cache_handle)
Close a cache handle.
Definition globus_gass_cache.c:5160
globus_gass_cache_cleanup_tag_all
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:6001
globus_gass_cache_get_cache_type_string
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:6402
globus_gass_cache_mangle_tag
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:6191
globus_gass_cache_open
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:4668
globus_gass_cache_error_string
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:6441
globus_gass_cache_delete_start
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:5740
globus_gass_cache_get_cache_dir
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:6226
globus_gass_cache_cleanup_tag
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:5924
globus_gass_cache_delete
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:5844
globus_gass_cache_t
struct globus_i_gass_cache_t * globus_gass_cache_t
GASS Cache Handle.
Definition globus_gass_cache.h:85
globus_gass_cache_add
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:5288
globus_gass_cache_query
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:5640
globus_gass_cache_mangle_url
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:6147