OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / coss / CosTrading.idl
1 #ifndef __trading_idl__
2 #define __trading_idl__
3
4 #pragma prefix "omg.org"
5
6 module CosTrading {
7
8         // forward references to our interfaces
9
10         interface Lookup;
11         interface Register;
12         interface Link;
13         interface Proxy;
14         interface Admin;
15         interface OfferIterator;
16         interface OfferIdIterator;
17
18         // type definitions used in more than one interface
19
20         typedef string Istring;
21         typedef Object TypeRepository;
22
23         typedef Istring PropertyName;
24         typedef sequence<PropertyName> PropertyNameSeq;
25         typedef any PropertyValue;
26         struct Property {
27                 PropertyName name;
28                 PropertyValue value;
29         };
30         typedef sequence<Property> PropertySeq;
31
32         struct Offer {
33                 Object reference;
34                 PropertySeq properties;
35         };
36         typedef sequence<Offer> OfferSeq;
37
38         typedef string OfferId;
39         typedef sequence<OfferId> OfferIdSeq;
40
41         typedef Istring ServiceTypeName;  // similar structure to IR::Identifier
42
43         typedef Istring Constraint;
44
45         enum FollowOption {
46                 local_only, 
47                 if_no_local, 
48                 always
49         };
50
51         typedef Istring LinkName;
52         typedef sequence<LinkName> LinkNameSeq;
53         typedef LinkNameSeq TraderName;
54
55         typedef string PolicyName;  // policy names restricted to Latin1
56         typedef sequence<PolicyName> PolicyNameSeq;
57         typedef any PolicyValue;
58         struct Policy {
59                 PolicyName name;
60                 PolicyValue value;
61         };
62         typedef sequence<Policy> PolicySeq;
63
64         // exceptions used in more than one interface
65
66         exception UnknownMaxLeft {};
67
68         exception NotImplemented {};
69
70         exception IllegalServiceType {
71                 ServiceTypeName type;
72         };
73
74         exception UnknownServiceType {
75                 ServiceTypeName type;
76         };
77
78         exception IllegalPropertyName {
79                 PropertyName name;
80         };
81
82         exception DuplicatePropertyName {
83                 PropertyName name;
84         };
85         exception PropertyTypeMismatch {
86                 ServiceTypeName type;
87                 Property prop;
88         };
89
90         exception MissingMandatoryProperty {
91                 ServiceTypeName type;
92                 PropertyName name;
93         };
94
95         exception ReadonlyDynamicProperty {
96                 ServiceTypeName type;
97                 PropertyName name;
98         };
99
100         exception IllegalConstraint {
101                 Constraint constr;
102         };
103
104         exception InvalidLookupRef {
105                 Lookup target;
106         };
107           
108         exception IllegalOfferId {
109                 OfferId id;
110         };
111
112         exception UnknownOfferId {
113                 OfferId id;
114         };
115
116         exception DuplicatePolicyName {
117                 PolicyName name;
118         };
119
120         // the interfaces
121
122         interface TraderComponents {
123
124                 readonly attribute Lookup lookup_if;
125                 readonly attribute Register register_if;
126                 readonly attribute Link link_if;
127                 readonly attribute Proxy proxy_if;
128                 readonly attribute Admin admin_if;
129         };
130
131         interface SupportAttributes {
132
133                 readonly attribute boolean supports_modifiable_properties;
134                 readonly attribute boolean supports_dynamic_properties;
135                 readonly attribute boolean supports_proxy_offers;
136                 readonly attribute TypeRepository type_repos;
137         };
138
139         interface ImportAttributes {
140
141                 readonly attribute unsigned long def_search_card;
142                 readonly attribute unsigned long max_search_card;
143                 readonly attribute unsigned long def_match_card;
144                 readonly attribute unsigned long max_match_card;
145                 readonly attribute unsigned long def_return_card;
146                 readonly attribute unsigned long max_return_card;
147                 readonly attribute unsigned long max_list;
148                 readonly attribute unsigned long def_hop_count;
149                 readonly attribute unsigned long max_hop_count;
150                 readonly attribute FollowOption def_follow_policy;
151                 readonly attribute FollowOption max_follow_policy;
152         };
153
154         interface LinkAttributes {
155
156                 readonly attribute FollowOption max_link_follow_policy;
157         };
158
159         interface Lookup:TraderComponents,SupportAttributes,ImportAttributes {
160
161                 typedef Istring Preference;
162
163                 enum HowManyProps { none, some, all };
164
165                 union SpecifiedProps switch ( HowManyProps ) {
166                         case some: PropertyNameSeq prop_names;
167                 };
168
169                 exception IllegalPreference {
170                         Preference pref;
171                 };
172
173                 exception IllegalPolicyName {
174                         PolicyName name;
175                 };
176
177                 exception PolicyTypeMismatch {
178                         Policy the_policy;
179                 };
180
181                 exception InvalidPolicyValue {
182                         Policy the_policy;
183                 };
184
185                 void query ( 
186                         in ServiceTypeName type,
187                         in Constraint constr,
188                         in Preference pref,
189                         in PolicySeq policies,
190                         in SpecifiedProps desired_props,
191                         in unsigned long how_many,
192                         out OfferSeq offers,
193                         out OfferIterator offer_itr,
194                         out PolicyNameSeq limits_applied
195                 ) raises (
196                         IllegalServiceType,
197                         UnknownServiceType,
198                         IllegalConstraint,
199                         IllegalPreference,
200                         IllegalPolicyName,
201                         PolicyTypeMismatch,
202                         InvalidPolicyValue,
203                         IllegalPropertyName,
204                         DuplicatePropertyName,
205                         DuplicatePolicyName
206                 );
207         };
208
209         interface Register : TraderComponents, SupportAttributes {
210
211                 struct OfferInfo {
212                         Object reference;
213                         ServiceTypeName type;
214                         PropertySeq properties;
215                 };
216
217                 exception InvalidObjectRef {
218                         Object ref;
219                 };
220
221                 exception UnknownPropertyName {
222                         PropertyName name;
223                 };
224
225                 exception InterfaceTypeMismatch {
226                         ServiceTypeName type;
227                         Object reference;
228                 };
229
230                 exception ProxyOfferId {
231                         OfferId id;
232                 };
233
234                 exception MandatoryProperty {
235                         ServiceTypeName type;
236                         PropertyName name;
237                 };
238
239                 exception ReadonlyProperty {
240                         ServiceTypeName type;
241                         PropertyName name;
242                 };
243
244                 exception NoMatchingOffers {
245                         Constraint constr;
246                 };
247
248                 exception IllegalTraderName {
249                         TraderName name;
250                 };
251
252                 exception UnknownTraderName {
253                         TraderName name;
254                 };
255
256                 exception RegisterNotSupported {
257                         TraderName name;
258                 };
259
260                 OfferId export (
261                         in Object reference,
262                         in ServiceTypeName type,
263                         in PropertySeq properties
264                 ) raises ( 
265                         InvalidObjectRef,
266                         IllegalServiceType,
267                         UnknownServiceType,
268                         InterfaceTypeMismatch, 
269                         IllegalPropertyName, // e.g. prop_name = "<foo-bar"
270                         PropertyTypeMismatch,
271                         ReadonlyDynamicProperty,
272                         MissingMandatoryProperty,
273                         DuplicatePropertyName
274                 );
275
276                 void withdraw (
277                         in OfferId id
278                 ) raises (
279                         IllegalOfferId,
280                         UnknownOfferId,
281                         ProxyOfferId
282                 );
283
284                 OfferInfo describe (
285                         in OfferId id
286                 ) raises (
287                         IllegalOfferId,
288                         UnknownOfferId,
289                         ProxyOfferId
290                 );
291
292                 void modify (
293                         in OfferId id,
294                         in PropertyNameSeq del_list,
295                         in PropertySeq modify_list
296                 ) raises ( 
297                         NotImplemented,
298                         IllegalOfferId, 
299                         UnknownOfferId,
300                         ProxyOfferId,
301                         IllegalPropertyName,
302                         UnknownPropertyName,
303                         PropertyTypeMismatch,
304                         ReadonlyDynamicProperty,
305                         MandatoryProperty,
306                         ReadonlyProperty,
307                         DuplicatePropertyName
308                 );
309
310                 void withdraw_using_constraint (
311                         in ServiceTypeName type,
312                         in Constraint constr
313                 ) raises (
314                         IllegalServiceType,
315                         UnknownServiceType,
316                         IllegalConstraint,
317                         NoMatchingOffers
318                 );
319
320                 Register resolve (
321                         in TraderName name
322                 ) raises (
323                         IllegalTraderName,
324                         UnknownTraderName,
325                         RegisterNotSupported
326                 );
327         };
328
329         interface Link : TraderComponents, SupportAttributes, LinkAttributes {
330
331                 struct LinkInfo {
332                         Lookup target;
333                         Register target_reg;
334                         FollowOption def_pass_on_follow_rule;
335                         FollowOption limiting_follow_rule;
336                 };
337
338                 exception IllegalLinkName {
339                         LinkName name;
340                 };
341
342                 exception UnknownLinkName {
343                         LinkName name;
344                 };
345
346                 exception DuplicateLinkName {
347                         LinkName name;
348                 };
349                 exception DefaultFollowTooPermissive {
350                         FollowOption def_pass_on_follow_rule;
351                         FollowOption limiting_follow_rule;
352                 };
353
354                 exception LimitingFollowTooPermissive {
355                         FollowOption limiting_follow_rule;
356                         FollowOption max_link_follow_policy;
357                 };
358
359                 void add_link ( 
360                         in LinkName name,
361                         in Lookup target,
362                         in FollowOption def_pass_on_follow_rule,
363                         in FollowOption limiting_follow_rule
364                 ) raises ( 
365                         IllegalLinkName,
366                         DuplicateLinkName,
367                         InvalidLookupRef, // e.g. nil
368                         DefaultFollowTooPermissive,
369                         LimitingFollowTooPermissive
370                 );
371
372                 void remove_link (
373                         in LinkName name
374                 ) raises (
375                         IllegalLinkName,
376                         UnknownLinkName
377                 );
378
379                 LinkInfo describe_link (
380                         in LinkName name
381                 ) raises (
382                         IllegalLinkName,
383                         UnknownLinkName
384                 );
385
386                 LinkNameSeq list_links ( );
387
388                 void modify_link ( 
389                         in LinkName name,
390                         in FollowOption def_pass_on_follow_rule,
391                         in FollowOption limiting_follow_rule
392                 ) raises ( 
393                         IllegalLinkName,
394                         UnknownLinkName,
395                         DefaultFollowTooPermissive,
396                         LimitingFollowTooPermissive
397                 );
398         };
399
400         interface Proxy : TraderComponents, SupportAttributes {
401
402                 typedef Istring ConstraintRecipe;
403
404                 struct ProxyInfo { 
405                         ServiceTypeName type;
406                         Lookup target;
407                         PropertySeq properties;
408                         boolean if_match_all;
409                         ConstraintRecipe recipe;
410                         PolicySeq policies_to_pass_on;
411                 };
412
413                 exception IllegalRecipe {
414                         ConstraintRecipe recipe;
415                 };
416
417                 exception NotProxyOfferId {
418                         OfferId id;
419                 };
420
421                 OfferId export_proxy (
422                         in Lookup target,
423                         in ServiceTypeName type,
424                         in PropertySeq properties,
425                         in boolean if_match_all,
426                         in ConstraintRecipe recipe,
427                         in PolicySeq policies_to_pass_on
428                 ) raises (
429                         IllegalServiceType,
430                         UnknownServiceType,
431                         InvalidLookupRef, // e.g. nil
432                         IllegalPropertyName,
433                         PropertyTypeMismatch,
434                         ReadonlyDynamicProperty,
435                         MissingMandatoryProperty,
436                         IllegalRecipe,
437                         DuplicatePropertyName,
438                         DuplicatePolicyName
439                 );
440
441                 void withdraw_proxy (
442                         in OfferId id
443                 ) raises (
444                         IllegalOfferId,
445                         UnknownOfferId,
446                         NotProxyOfferId
447                 );
448
449                 ProxyInfo describe_proxy (
450                         in OfferId id
451                 ) raises (
452                         IllegalOfferId,
453                         UnknownOfferId,
454                         NotProxyOfferId
455                 );
456         };
457
458         interface Admin : TraderComponents, SupportAttributes, ImportAttributes,
459                                                 LinkAttributes {
460
461         typedef sequence<octet> OctetSeq;
462
463         readonly attribute OctetSeq request_id_stem;
464
465         unsigned long set_def_search_card (in unsigned long value);
466         unsigned long set_max_search_card (in unsigned long value);
467
468         unsigned long set_def_match_card (in unsigned long value);
469         unsigned long set_max_match_card (in unsigned long value);
470
471         unsigned long set_def_return_card (in unsigned long value);
472         unsigned long set_max_return_card (in unsigned long value);
473
474         unsigned long set_max_list (in unsigned long value);
475
476         boolean set_supports_modifiable_properties (in boolean value);
477         boolean set_supports_dynamic_properties (in boolean value);
478         boolean set_supports_proxy_offers (in boolean value);
479
480         unsigned long set_def_hop_count (in unsigned long value);
481         unsigned long set_max_hop_count (in unsigned long value);
482
483         FollowOption set_def_follow_policy (in FollowOption policy);
484         FollowOption set_max_follow_policy (in FollowOption policy);
485
486         FollowOption set_max_link_follow_policy (in FollowOption policy);
487
488         TypeRepository set_type_repos (in TypeRepository repository);
489
490         OctetSeq set_request_id_stem (in OctetSeq stem);
491
492                 void list_offers (
493                         in unsigned long how_many,
494                         out OfferIdSeq ids,
495                         out OfferIdIterator id_itr
496                 ) raises (
497                         NotImplemented
498                 );
499
500                 void list_proxies (
501                         in unsigned long how_many,
502                         out OfferIdSeq ids,
503                         out OfferIdIterator id_itr
504                 ) raises (
505                         NotImplemented
506                 );
507         };
508
509         interface OfferIterator {
510
511                 unsigned long max_left (
512                 ) raises (
513                         UnknownMaxLeft
514                 );
515
516                 boolean next_n (
517                         in unsigned long n,
518                         out OfferSeq offers
519                 );
520
521                 void destroy ();
522         };
523
524         interface OfferIdIterator {
525                 unsigned long max_left (
526                 ) raises (
527                         UnknownMaxLeft
528                 );
529
530                 boolean next_n (
531                         in unsigned long n,
532                         out OfferIdSeq ids
533                 );
534
535                 void destroy ();
536         };
537
538         typedef sequence<string> StringList;
539         typedef sequence<long> LongList;
540         typedef sequence<float> FloatList;
541
542 }; /* end module CosTrading */
543
544 #endif