globus_scheduler_event_generator_app.h

00001 /*
00002  * Copyright 1999-2014 University of Chicago
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H
00017 #define GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H 1
00018 
00019 #include "globus_common.h"
00020 #include "globus_gram_protocol.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 typedef enum
00027 {
00028     GLOBUS_SCHEDULER_EVENT_PENDING = GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING,
00029     GLOBUS_SCHEDULER_EVENT_ACTIVE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE,
00030     GLOBUS_SCHEDULER_EVENT_FAILED = GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED,
00031     GLOBUS_SCHEDULER_EVENT_DONE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE,
00032     GLOBUS_SCHEDULER_EVENT_RAW
00033 }
00034 globus_scheduler_event_type_t;
00035 
00036 typedef struct
00037 {
00038     globus_scheduler_event_type_t       event_type;
00039     char *                              job_id;
00040     time_t                              timestamp;
00041     /* only set if DONE */
00042     int                                 exit_code;
00043     /* only set if FAILED */
00044     int                                 failure_code;
00045     /* only set if RAW */
00046     char *                              raw_event;
00047 }
00048 globus_scheduler_event_t;
00049 
00050 typedef globus_result_t (*globus_scheduler_event_generator_event_handler_t)(
00051     void *                              user_arg,
00052     const globus_scheduler_event_t *    event);
00053 
00054 /* API used by executable which drives the SEG */
00055 globus_result_t
00056 globus_scheduler_event_generator_set_timestamp(
00057     time_t                              timestamp);
00058 
00059 globus_result_t
00060 globus_scheduler_event_generator_load_module(
00061     const char *                        module_name);
00062 
00063 typedef void (*globus_scheduler_event_generator_fault_handler_t)(
00064     void *                              user_arg,
00065     globus_result_t                     result);
00066 
00067 globus_result_t
00068 globus_scheduler_event_generator_set_fault_handler(
00069     globus_scheduler_event_generator_fault_handler_t
00070                                         fault_handler,
00071     void *                              user_arg);
00072 
00073 globus_result_t
00074 globus_scheduler_event_generator_set_event_handler(
00075     globus_scheduler_event_generator_event_handler_t
00076                                         event_handler,
00077     void *                              user_arg);
00078 
00079 void
00080 globus_scheduler_event_generator_fault(
00081     globus_result_t                     result);
00082 
00083 globus_result_t
00084 globus_scheduler_event_copy(
00085     globus_scheduler_event_t **         copy,
00086     const globus_scheduler_event_t *    event);
00087 
00088 void
00089 globus_scheduler_event_destroy(
00090     globus_scheduler_event_t *          event);
00091 
00092 
00093 #ifdef __cplusplus
00094 }
00095 #endif
00096 
00097 #endif /* GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H */

Generated on 5 Sep 2016 for globus_scheduler_event_generator by  doxygen 1.4.7