is_prefix:=jpis_
sample_jobs:=sample_job_aborted sample_job_cleared sample_job_tagged_done sample_job_waiting
-plugins:=glite-jp-tags.la glite-jp-ftpdauth.la glite-jp-classad.la glite-jp-sandbox.la
+plugins:=glite-jp-ftpdauth.la glite-jp-classad.la glite-jp-sandbox.la
HDRS_I=file_plugin.h
HDRS_S=builtin_plugins.h backend.h feed.h
SRCS:= bones_server.c soap_ops.c \
new_ftp_backend.c mysql.c file_plugin.c \
feed.c authz.c attrs.c\
+ tags.c\
is_client.c \
soap_switch.c
/** Close the file. Free data associated to a handle */
int (*close)(void *fpctx,void *handle);
+/** "Preprocess" the file -- this function is called once after the file is commited */
+ int (*filecom)(void *fpctx,void *handle);
+
/** Retrieve value(s) of an attribute.
\param[in] fpctx Plugin context.
\param[in] handle Handle of the opened file.
static int classad_open(void *fpctx, void *bhandle, const char *uri, void **handle);
static int classad_open_str(void *fpctx, const char *str, const char *uri, const char *ns, void **handle);
static int classad_close(void *fpctx, void *handle);
+static int classad_filecom(void *fpctx, void *handle);
int init(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data) {
data->fpctx = ctx;
data->ops.close = classad_close;
data->ops.attr = classad_query;
data->ops.open_str = classad_open_str;
+ data->ops.filecom = classad_filecom;
#ifdef PLUGIN_DEBUG
fprintf(stderr,"classad_plugin: init OK\n");
return glite_jp_stack_error(ctx,&err);
}
}
+
+static int classad_filecom(void *fpctx, void *handle){
+ return -1;
+}
static int sandbox_open(void *,void *,const char *uri,void **);
static int sandbox_close(void *,void *);
static int sandbox_attr(void *,void *,const char*,const char *,glite_jp_attrval_t **);
-
+static int sandbox_filecom(void *,void *);
int init(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data)
{
data->ops.open = sandbox_open;
data->ops.close = sandbox_close;
data->ops.attr = sandbox_attr;
+ data->ops.filecom = sandbox_filecom;
printf("sandbox_plugin: URI: \"%s\"\n",GLITE_JP_FILETYPE_ISB);
return glite_jp_stack_error(ctx,&err);
}
+static int sandbox_filecom(void *fpctx,void *handle){
+ return -1;
+}
+
/* XXX: ignore errors but don't fail silenty */
glite_jpps_match_file(ctx,job,class,name);
+ // apply plugins to commited file
+ glite_jpps_fplug_data_t *pd;
+ int i, j;
+ void *beh, *ph;
+ if (ctx->plugins)
+ for (i = 0; ctx->plugins[i]; i++) {
+ pd = ctx->plugins[i];
+ if (pd->classes)
+ for (j = 0; pd->classes[j]; j++)
+ if (strcmp(class, pd->classes[j]) == 0){
+ if (! glite_jppsbe_open_file(ctx,job,class, name, O_RDONLY, &beh)) {
+ if (!pd->ops.open(pd->fpctx,beh,pd->uris[j],&ph)) {
+ pd->ops.filecom(pd->fpctx, ph);
+ pd->ops.close(pd->fpctx, ph);
+ }
+ glite_jppsbe_close_file(ctx,beh);
+ }
+
+ }
+ }
+
free(job); free(class); free(name);
return SOAP_OK;