| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Tuxedo::Admin::ExportedResource; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use Class::MethodMaker |
|
4
|
0
|
|
|
|
|
|
new_with_init => 'new', |
|
5
|
|
|
|
|
|
|
get_set => [ qw( |
|
6
|
|
|
|
|
|
|
dmaclname |
|
7
|
|
|
|
|
|
|
dmapi |
|
8
|
|
|
|
|
|
|
dmcodepage |
|
9
|
|
|
|
|
|
|
dmconv |
|
10
|
|
|
|
|
|
|
dminbuftype |
|
11
|
|
|
|
|
|
|
dmlaccesspoint |
|
12
|
|
|
|
|
|
|
dmoutbuftype |
|
13
|
|
|
|
|
|
|
dmremotename |
|
14
|
|
|
|
|
|
|
dmresourcename |
|
15
|
|
|
|
|
|
|
dmresourcetype |
|
16
|
|
|
|
|
|
|
dmte_function |
|
17
|
|
|
|
|
|
|
dmte_product |
|
18
|
|
|
|
|
|
|
dmte_qualifier |
|
19
|
|
|
|
|
|
|
dmte_rtqgroup |
|
20
|
|
|
|
|
|
|
dmte_rtqname |
|
21
|
|
|
|
|
|
|
dmte_target |
|
22
|
|
|
|
|
|
|
state |
|
23
|
1
|
|
|
1
|
|
400
|
) ]; |
|
|
0
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use Carp; |
|
26
|
|
|
|
|
|
|
use strict; |
|
27
|
|
|
|
|
|
|
use Data::Dumper; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub init |
|
30
|
|
|
|
|
|
|
{ |
|
31
|
|
|
|
|
|
|
my $self = shift |
|
32
|
|
|
|
|
|
|
|| croak "init: Invalid parameters: expected self"; |
|
33
|
|
|
|
|
|
|
$self->{admin} = shift |
|
34
|
|
|
|
|
|
|
|| croak "init: Invalid parameters: expected admin"; |
|
35
|
|
|
|
|
|
|
$self->{dmresourcename} = shift |
|
36
|
|
|
|
|
|
|
|| croak "init: Invalid parameters: expected dmresourcename"; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my (%input_buffer, $error, %output_buffer); |
|
39
|
|
|
|
|
|
|
%input_buffer = $self->_fields(); |
|
40
|
|
|
|
|
|
|
$input_buffer{'TA_CLASS'} = [ 'T_DM_EXPORT' ]; |
|
41
|
|
|
|
|
|
|
($error, %output_buffer) = $self->{admin}->_tmib_get(\%input_buffer); |
|
42
|
|
|
|
|
|
|
carp($self->_status()) if ($error < 0); |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$self->exists($output_buffer{'TA_OCCURS'}[0] eq '1'); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
delete $output_buffer{'TA_OCCURS'}; |
|
47
|
|
|
|
|
|
|
delete $output_buffer{'TA_ERROR'}; |
|
48
|
|
|
|
|
|
|
delete $output_buffer{'TA_MORE'}; |
|
49
|
|
|
|
|
|
|
delete $output_buffer{'TA_CLASS'}; |
|
50
|
|
|
|
|
|
|
delete $output_buffer{'TA_STATUS'}; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my ($field, $key); |
|
53
|
|
|
|
|
|
|
foreach $field (keys %output_buffer) |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
|
|
|
|
|
|
$key = $field; |
|
56
|
|
|
|
|
|
|
$key =~ s/^TA_//; |
|
57
|
|
|
|
|
|
|
$key =~ tr/A-Z/a-z/; |
|
58
|
|
|
|
|
|
|
if (defined $output_buffer{$field}[0]) |
|
59
|
|
|
|
|
|
|
{ |
|
60
|
|
|
|
|
|
|
$self->{$key} = $output_buffer{$field}[0]; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
else |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
|
|
|
|
|
|
$self->{$key} = undef; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub exists |
|
70
|
|
|
|
|
|
|
{ |
|
71
|
|
|
|
|
|
|
my $self = shift; |
|
72
|
|
|
|
|
|
|
$self->{exists} = $_[0] if (@_ != 0); |
|
73
|
|
|
|
|
|
|
return $self->{exists}; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub add |
|
77
|
|
|
|
|
|
|
{ |
|
78
|
|
|
|
|
|
|
my $self = shift; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
croak "dmresourcename MUST be set" unless $self->dmresourcename(); |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my (%input_buffer, $error, %output_buffer); |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
%input_buffer = $self->_fields(); |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
$input_buffer{'TA_CLASS'} = [ 'T_DM_EXPORT' ]; |
|
87
|
|
|
|
|
|
|
$input_buffer{'TA_STATE'} = [ 'NEW' ]; |
|
88
|
|
|
|
|
|
|
($error, %output_buffer) = $self->{admin}->_tmib_set(\%input_buffer); |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
if ($error < 0) |
|
91
|
|
|
|
|
|
|
{ |
|
92
|
|
|
|
|
|
|
carp($self->_status()); |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
else |
|
95
|
|
|
|
|
|
|
{ |
|
96
|
|
|
|
|
|
|
$self->exists(1); |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
return $error; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub update |
|
103
|
|
|
|
|
|
|
{ |
|
104
|
|
|
|
|
|
|
my $self = shift; |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
croak "dmresourcename MUST be set" unless $self->dmresourcename(); |
|
107
|
|
|
|
|
|
|
#croak "dmlaccesspoint MUST be set" unless $self->dmlaccesspoint(); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my (%input_buffer, $error, %output_buffer, $tdomain); |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
%input_buffer = $self->_fields(); |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
$input_buffer{'TA_CLASS'} = [ 'T_DM_EXPORT' ]; |
|
114
|
|
|
|
|
|
|
($error, %output_buffer) = $self->{admin}->_tmib_set(\%input_buffer); |
|
115
|
|
|
|
|
|
|
carp($self->_status()) if ($error < 0); |
|
116
|
|
|
|
|
|
|
return $error; |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub remove |
|
120
|
|
|
|
|
|
|
{ |
|
121
|
|
|
|
|
|
|
my $self = shift; |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
croak "dmresourcename MUST be set" unless $self->dmresourcename(); |
|
124
|
|
|
|
|
|
|
#croak "dmlaccesspoint MUST be set" unless $self->dmlaccesspoint(); |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
my (%input_buffer, $error, %output_buffer); |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
$input_buffer{'TA_CLASS'} = [ 'T_DM_EXPORT' ]; |
|
129
|
|
|
|
|
|
|
$input_buffer{'TA_STATE'} = [ 'INVALID' ]; |
|
130
|
|
|
|
|
|
|
$input_buffer{'TA_DMRESOURCENAME'} = [ $self->dmresourcename() ]; |
|
131
|
|
|
|
|
|
|
$input_buffer{'TA_DMLACCESSPOINT'} = [ $self->dmlaccesspoint() ]; |
|
132
|
|
|
|
|
|
|
($error, %output_buffer) = $self->{admin}->_tmib_set(\%input_buffer); |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
if ($error < 0) |
|
135
|
|
|
|
|
|
|
{ |
|
136
|
|
|
|
|
|
|
carp($self->_status()); |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
else |
|
139
|
|
|
|
|
|
|
{ |
|
140
|
|
|
|
|
|
|
$self->exists(0); |
|
141
|
|
|
|
|
|
|
} |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
return $error; |
|
144
|
|
|
|
|
|
|
} |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub _status |
|
147
|
|
|
|
|
|
|
{ |
|
148
|
|
|
|
|
|
|
my $self = shift; |
|
149
|
|
|
|
|
|
|
return $self->{admin}->status(); |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub _fields |
|
153
|
|
|
|
|
|
|
{ |
|
154
|
|
|
|
|
|
|
my $self = shift; |
|
155
|
|
|
|
|
|
|
my ($key, $field, %data, %fields); |
|
156
|
|
|
|
|
|
|
%data = %{ $self }; |
|
157
|
|
|
|
|
|
|
foreach $key (keys %data) |
|
158
|
|
|
|
|
|
|
{ |
|
159
|
|
|
|
|
|
|
next if ($key eq 'admin'); |
|
160
|
|
|
|
|
|
|
next if ($key eq 'exists'); |
|
161
|
|
|
|
|
|
|
$field = "TA_$key"; |
|
162
|
|
|
|
|
|
|
$field =~ tr/a-z/A-Z/; |
|
163
|
|
|
|
|
|
|
$fields{$field} = [ $data{$key} ]; |
|
164
|
|
|
|
|
|
|
} |
|
165
|
|
|
|
|
|
|
return %fields; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub hash |
|
169
|
|
|
|
|
|
|
{ |
|
170
|
|
|
|
|
|
|
my $self = shift; |
|
171
|
|
|
|
|
|
|
my (%data); |
|
172
|
|
|
|
|
|
|
%data = %{ $self }; |
|
173
|
|
|
|
|
|
|
delete $data{admin}; |
|
174
|
|
|
|
|
|
|
return %data; |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=pod |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Tuxedo::Admin::ExportedResource |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
use Tuxedo::Admin; |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
$admin = new Tuxedo::Admin; |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
$exported_resource = $admin->exported_resource('BillingDetails''); |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
$rc = $exported_resource->remove() |
|
190
|
|
|
|
|
|
|
if $exported_resource->exists(); |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
unless ($exported_resource->exists()) |
|
193
|
|
|
|
|
|
|
{ |
|
194
|
|
|
|
|
|
|
$rc = $exported_resource->add(); |
|
195
|
|
|
|
|
|
|
die $admin->status() if ($rc < 0); |
|
196
|
|
|
|
|
|
|
} |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Provides methods to query, add, remove and update an exported resource. |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 INITIALISATION |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Tuxedo::Admin::ExportedResource objects are not instantiated directly. |
|
205
|
|
|
|
|
|
|
Instead they are created via the exported_resource() method of a Tuxedo::Admin |
|
206
|
|
|
|
|
|
|
object. |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Example: |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
$exported_resource = $admin->exported_resource('BillingDetails'); |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
This applies both for existing exported resources and for new exported |
|
213
|
|
|
|
|
|
|
resources that are being created. |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=head1 METHODS |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=head2 exists() |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Used to determine whether or not the exported resource exists in the current |
|
220
|
|
|
|
|
|
|
Tuxedo application. |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
if ($exported_resource->exists()) |
|
223
|
|
|
|
|
|
|
{ |
|
224
|
|
|
|
|
|
|
... |
|
225
|
|
|
|
|
|
|
} |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Returns true if the exported resource exists. |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=head2 add() |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
Adds the exported resource to the current Tuxedo application. |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
$rc = $exported_resource->add(); |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
Croaks if the exported resource already exists or if the required |
|
236
|
|
|
|
|
|
|
dmresourcename parameter is not set. If $rc is negative then an error |
|
237
|
|
|
|
|
|
|
occurred. If successful then the exists() method will return true. |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
Example: |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
$exported_resource = $admin->exported_resource('BillingDetails'); |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
unless ($exported_resource->exists()) |
|
244
|
|
|
|
|
|
|
{ |
|
245
|
|
|
|
|
|
|
$exported_resource->dmlaccesspoint('LOCAL1'); |
|
246
|
|
|
|
|
|
|
$rc = $exported_resource->add(); |
|
247
|
|
|
|
|
|
|
$admin->print_status(); |
|
248
|
|
|
|
|
|
|
} |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=head2 update() |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Updates the exported resource configuration with the values of the current |
|
253
|
|
|
|
|
|
|
object. |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
$rc = $exported_resource->update(); |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Croaks if the exported resource does not exist or if the required |
|
258
|
|
|
|
|
|
|
dmresourcename parameter is not set. If $rc is negative then an error |
|
259
|
|
|
|
|
|
|
occurred. |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Example: |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
$exported_resource = $admin->exported_resource('BillingDetails'); |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
if ($exported_resource->exists()) |
|
266
|
|
|
|
|
|
|
{ |
|
267
|
|
|
|
|
|
|
$exported_resource->dmremotename('BillDetails'); |
|
268
|
|
|
|
|
|
|
$rc = $exported_resource->update(); |
|
269
|
|
|
|
|
|
|
$admin->print_status(); |
|
270
|
|
|
|
|
|
|
} |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head2 remove() |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
Removes the exported resource from the current Tuxedo application. |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
$rc = $exported_resource->remove(); |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
Croaks if the exported resource does not exist or if the required |
|
279
|
|
|
|
|
|
|
dmresourcename parameter is not set. If $rc is negative then an error |
|
280
|
|
|
|
|
|
|
occurred. |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Example: |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
$exported_resource = $admin->exported_resource('BillingDetails'); |
|
285
|
|
|
|
|
|
|
if ($exported_resource->exists()) |
|
286
|
|
|
|
|
|
|
{ |
|
287
|
|
|
|
|
|
|
$exported_resource->remove(); |
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head2 get/set methods |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
The following methods are available to get and set the exported resource |
|
293
|
|
|
|
|
|
|
parameters. If an argument is provided then the parameter value is set to be |
|
294
|
|
|
|
|
|
|
the argument value. The value of the parameter is returned. |
|
295
|
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
Example: |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
# Get the remote name |
|
299
|
|
|
|
|
|
|
print $exported_resource->dmremotename(), "\n"; |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# Set the remote name |
|
302
|
|
|
|
|
|
|
$exported_resource->dmremotename('BillDetails'); |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=over |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=item dmaclname() |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=item dmapi() |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=item dmcodepage() |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=item dmconv() |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item dminbuftype() |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=item dmlaccesspoint() |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
=item dmoutbuftype() |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=item dmremotename() |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=item dmresourcename() |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=item dmresourcetype() |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=item dmte_function() |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=item dmte_product() |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=item dmte_qualifier() |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=item dmte_rtqgroup() |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=item dmte_rtqname() |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=item dmte_target() |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=item state() |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=back |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=cut |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
1; |