1 /*
2  * Portions of this file Copyright 1999-2005 University of Chicago
3  * Portions of this file Copyright 1999-2005 The University of Southern California.
4  *
5  * This file or a portion of this file is licensed under the
6  * terms of the Globus Toolkit Public License, found at
7  * http://www.globus.org/toolkit/download/license.html.
8  * If you redistribute this file, with or without
9  * modifications, you must include this notice in the file.
10  */
11
12 #ifndef WSRL_I_FAULT_TYPES_H
13 #define WSRL_I_FAULT_TYPES_H 1
14
15 #if WSRL_IMMEDIATE_RESOURCE_TERMINATION
16 #   ifndef NEED_RESOURCE_UNKNOWN_FAULT
17 #       define NEED_RESOURCE_UNKNOWN_FAULT 1
18 #   endif
19 #   ifndef NEED_RESOURCE_NOT_DESTROYED_FAULT
20 #       define NEED_RESOURCE_NOT_DESTROYED_FAULT 1
21 #   endif
22 #endif
23
24 #if WSRL_SCHEDULED_RESOURCE_TERMINATION
25 #   ifndef NEED_RESOURCE_UNKNOWN_FAULT
26 #       define NEED_RESOURCE_UNKNOWN_FAULT 1
27 #   endif
28 #   ifndef NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT
29 #       define NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT 1
30 #   endif
31 #   ifndef NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT
32 #       define NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT 1
33 #   endif
34 #endif
35
36 #if NEED_RESOURCE_UNKNOWN_FAULT
37 #include "wsrl_ResourceUnknownFaultType.h"
38
39 static
40 globus_result_t
41 wsrl_l_ResourceUnknownFaultType_create(
42     char **                             fault_name,
43     wsrl_ResourceUnknownFaultType **    fault)
44 0 {
45 0     globus_result_t                     result;
46 0     time_t                              timestamp = time(NULL);
47 0     struct tm *                         tp;
48
49 0     result = wsrl_ResourceUnknownFaultType_init(fault);
50
51 0     if (result != GLOBUS_SUCCESS)
52     {
53 0         return result;
54     }
55
56 0     tp = globus_libc_gmtime_r(&timestamp, &(*fault)->Timestamp);
57 0     globus_assert(tp != NULL);
58
59 0     *fault_name = "ResourceUnknownFault";
60
61 0     return result;
62 }
63 /* wsrl_l_ResourceUnknownFaultType_create() */
64 #endif /* NEED_RESOURCE_UNKNOWN_FAULT */
65
66 #if NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT
67 #include "wsrl_UnableToSetTerminationTimeFaultType.h"
68
69 static
70 globus_result_t
71 wsrl_l_UnableToSetTerminationTimeFaultType_create(
72     char **                             fault_name,
73     wsrl_UnableToSetTerminationTimeFaultType **
74                                         fault)
75 {
76     globus_result_t                     result;
77     time_t                              timestamp = time(NULL);
78     struct tm *                         tp;
79
80     result = wsrl_UnableToSetTerminationTimeFaultType_init(fault);
81
82     if (result != GLOBUS_SUCCESS)
83     {
84         return result;
85     }
86
87     tp = globus_libc_gmtime_r(
88             &timestamp,
89             &(*fault)->Timestamp);
90
91     globus_assert(tp != NULL);
92
93     *fault_name = "UnableToSetTerminationTimeFault";
94
95     return result;
96 }
97 /* wsrl_l_UnableToSetTerminationTimeFaultType_create() */
98 #endif /* NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT */
99
100 #if NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT
101 #include "wsrl_TerminationTimeChangeRejectedFaultType.h"
102
103 static
104 globus_result_t
105 wsrl_l_TerminationTimeChangeRejectedFaultType_create(
106     char **                             fault_name,
107     wsrl_TerminationTimeChangeRejectedFaultType **
108                                         fault)
109 {
110     globus_result_t                     result;
111     time_t                              timestamp = time(NULL);
112     struct tm *                         tp;
113
114     result = wsrl_TerminationTimeChangeRejectedFaultType_init(fault);
115
116     if (result != GLOBUS_SUCCESS)
117     {
118         return result;
119     }
120
121     tp = globus_libc_gmtime_r(
122             &timestamp,
123             &(*fault)->Timestamp);
124
125     globus_assert(tp != NULL);
126
127     *fault_name = "TerminationChangeRejectedFault";
128
129     return result;
130 }
131 /* wsrl_l_TerminationTimeChangeRejectedFault_create() */
132 #endif /* NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT */
133
134 #if NEED_RESOURCE_NOT_DESTROYED_FAULT
135 #include "wsrl_ResourceNotDestroyedFaultType.h"
136
137 static
138 globus_result_t
139 wsrl_l_ResourceNotDestroyedFaultType_create(
140     char **                             fault_name,
141     wsrl_ResourceNotDestroyedFaultType **
142                                         fault)
143 0 {
144 0     globus_result_t                     result;
145 0     time_t                              timestamp = time(NULL);
146 0     struct tm *                         tp;
147
148 0     result = wsrl_ResourceNotDestroyedFaultType_init(fault);
149
150 0     if (result != GLOBUS_SUCCESS)
151     {
152 0         return result;
153     }
154
155 0     tp = globus_libc_gmtime_r(
156             &timestamp,
157             &(*fault)->Timestamp);
158
159 0     globus_assert(tp != NULL);
160
161 0     *fault_name = "ResourceNotDestroyedFault";
162
163 0     return result;
164 }
165 /* wsrl_l_resource_not_destroyed_fault() */
166 #endif /* NEED_RESOURCE_NOT_DESTROYED_FAULT */
167