globus_scheduler_event_generator 6.5
Loading...
Searching...
No Matches
globus_scheduler_event_generator_app.h
1/*
2 * Copyright 1999-2014 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#ifndef GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H
17#define GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H 1
18
19#include "globus_common.h"
20#include "globus_gram_protocol.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26typedef enum
27{
28 GLOBUS_SCHEDULER_EVENT_PENDING = GLOBUS_GRAM_PROTOCOL_JOB_STATE_PENDING,
29 GLOBUS_SCHEDULER_EVENT_ACTIVE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_ACTIVE,
30 GLOBUS_SCHEDULER_EVENT_FAILED = GLOBUS_GRAM_PROTOCOL_JOB_STATE_FAILED,
31 GLOBUS_SCHEDULER_EVENT_DONE = GLOBUS_GRAM_PROTOCOL_JOB_STATE_DONE,
32 GLOBUS_SCHEDULER_EVENT_RAW
33}
34globus_scheduler_event_type_t;
35
36typedef struct
37{
38 globus_scheduler_event_type_t event_type;
39 char * job_id;
40 time_t timestamp;
41 /* only set if DONE */
42 int exit_code;
43 /* only set if FAILED */
44 int failure_code;
45 /* only set if RAW */
46 char * raw_event;
47}
48globus_scheduler_event_t;
49
50typedef globus_result_t (*globus_scheduler_event_generator_event_handler_t)(
51 void * user_arg,
52 const globus_scheduler_event_t * event);
53
54/* API used by executable which drives the SEG */
55globus_result_t
56globus_scheduler_event_generator_set_timestamp(
57 time_t timestamp);
58
59globus_result_t
60globus_scheduler_event_generator_load_module(
61 const char * module_name);
62
63typedef void (*globus_scheduler_event_generator_fault_handler_t)(
64 void * user_arg,
65 globus_result_t result);
66
67globus_result_t
68globus_scheduler_event_generator_set_fault_handler(
69 globus_scheduler_event_generator_fault_handler_t
70 fault_handler,
71 void * user_arg);
72
73globus_result_t
74globus_scheduler_event_generator_set_event_handler(
75 globus_scheduler_event_generator_event_handler_t
76 event_handler,
77 void * user_arg);
78
79void
80globus_scheduler_event_generator_fault(
81 globus_result_t result);
82
83globus_result_t
84globus_scheduler_event_copy(
85 globus_scheduler_event_t ** copy,
86 const globus_scheduler_event_t * event);
87
88void
89globus_scheduler_event_destroy(
90 globus_scheduler_event_t * event);
91
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* GLOBUS_SCHEDULER_EVENT_GENERATOR_APP_H */