1 /*
2  * Copyright 1999-2006 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
17 #ifndef WSRL_I_FAULT_TYPES_H
18 #define WSRL_I_FAULT_TYPES_H 1
19
20 #if WSRL_IMMEDIATE_RESOURCE_TERMINATION
21 #   ifndef NEED_RESOURCE_UNKNOWN_FAULT
22 #       define NEED_RESOURCE_UNKNOWN_FAULT 1
23 #   endif
24 #   ifndef NEED_RESOURCE_NOT_DESTROYED_FAULT
25 #       define NEED_RESOURCE_NOT_DESTROYED_FAULT 1
26 #   endif
27 #endif
28
29 #if WSRL_SCHEDULED_RESOURCE_TERMINATION
30 #   ifndef NEED_RESOURCE_UNKNOWN_FAULT
31 #       define NEED_RESOURCE_UNKNOWN_FAULT 1
32 #   endif
33 #   ifndef NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT
34 #       define NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT 1
35 #   endif
36 #   ifndef NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT
37 #       define NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT 1
38 #   endif
39 #endif
40
41 #if NEED_RESOURCE_UNKNOWN_FAULT
42 #include "wsrl_ResourceUnknownFaultType.h"
43
44 static
45 globus_result_t
46 wsrl_l_ResourceUnknownFaultType_create(
47     char **                             fault_name,
48     wsrl_ResourceUnknownFaultType **    fault)
49 0 {
50 0     globus_result_t                     result;
51 0     time_t                              timestamp = time(NULL);
52 0     struct tm *                         tp;
53
54 0     result = wsrl_ResourceUnknownFaultType_init(fault);
55
56 0     if (result != GLOBUS_SUCCESS)
57     {
58 0         return result;
59     }
60
61 0     tp = globus_libc_gmtime_r(&timestamp, &(*fault)->Timestamp);
62 0     globus_assert(tp != NULL);
63
64 0     *fault_name = "ResourceUnknownFault";
65
66 0     return result;
67 }
68 /* wsrl_l_ResourceUnknownFaultType_create() */
69 #endif /* NEED_RESOURCE_UNKNOWN_FAULT */
70
71 #if NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT
72 #include "wsrl_UnableToSetTerminationTimeFaultType.h"
73
74 static
75 globus_result_t
76 wsrl_l_UnableToSetTerminationTimeFaultType_create(
77     char **                             fault_name,
78     wsrl_UnableToSetTerminationTimeFaultType **
79                                         fault)
80 {
81     globus_result_t                     result;
82     time_t                              timestamp = time(NULL);
83     struct tm *                         tp;
84
85     result = wsrl_UnableToSetTerminationTimeFaultType_init(fault);
86
87     if (result != GLOBUS_SUCCESS)
88     {
89         return result;
90     }
91
92     tp = globus_libc_gmtime_r(
93             &timestamp,
94             &(*fault)->Timestamp);
95
96     globus_assert(tp != NULL);
97
98     *fault_name = "UnableToSetTerminationTimeFault";
99
100     return result;
101 }
102 /* wsrl_l_UnableToSetTerminationTimeFaultType_create() */
103 #endif /* NEED_UNABLE_TO_SET_TERMINATION_TIME_FAULT */
104
105 #if NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT
106 #include "wsrl_TerminationTimeChangeRejectedFaultType.h"
107
108 static
109 globus_result_t
110 wsrl_l_TerminationTimeChangeRejectedFaultType_create(
111     char **                             fault_name,
112     wsrl_TerminationTimeChangeRejectedFaultType **
113                                         fault)
114 {
115     globus_result_t                     result;
116     time_t                              timestamp = time(NULL);
117     struct tm *                         tp;
118
119     result = wsrl_TerminationTimeChangeRejectedFaultType_init(fault);
120
121     if (result != GLOBUS_SUCCESS)
122     {
123         return result;
124     }
125
126     tp = globus_libc_gmtime_r(
127             &timestamp,
128             &(*fault)->Timestamp);
129
130     globus_assert(tp != NULL);
131
132     *fault_name = "TerminationChangeRejectedFault";
133
134     return result;
135 }
136 /* wsrl_l_TerminationTimeChangeRejectedFault_create() */
137 #endif /* NEED_TERMINATION_TIME_CHANGE_REJECTED_FAULT */
138
139 #if NEED_RESOURCE_NOT_DESTROYED_FAULT
140 #include "wsrl_ResourceNotDestroyedFaultType.h"
141
142 static
143 globus_result_t
144 wsrl_l_ResourceNotDestroyedFaultType_create(
145     char **                             fault_name,
146     wsrl_ResourceNotDestroyedFaultType **
147                                         fault)
148 0 {
149 0     globus_result_t                     result;
150 0     time_t                              timestamp = time(NULL);
151 0     struct tm *                         tp;
152
153 0     result = wsrl_ResourceNotDestroyedFaultType_init(fault);
154
155 0     if (result != GLOBUS_SUCCESS)
156     {
157 0         return result;
158     }
159
160 0     tp = globus_libc_gmtime_r(
161             &timestamp,
162             &(*fault)->Timestamp);
163
164 0     globus_assert(tp != NULL);
165
166 0     *fault_name = "ResourceNotDestroyedFault";
167
168 0     return result;
169 }
170 /* wsrl_l_resource_not_destroyed_fault() */
171 #endif /* NEED_RESOURCE_NOT_DESTROYED_FAULT */
172