CosTrading.idl

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 // ========================================================================
00004 // $Id: CosTrading.idl 75581 2006-11-26 06:51:33Z johnnyw $
00005 //
00006 // = FILENAME
00007 //   CosTrading.idl
00008 //
00009 // = DESCRIPTION
00010 //   Trader  Service v1.0 described in CORBAservices: Common Object
00011 //   Services Specification, chapter 16 OMG IDL for Trading Function
00012 //   Module, p 16-74
00013 //
00014 // ========================================================================
00015 
00016 #ifndef TAO_TRADING_IDL
00017 #define TAO_TRADING_IDL
00018 
00019 #include "tao/StringSeq.pidl"
00020 
00021 #pragma prefix "omg.org"
00022 
00023 module CosTrading
00024 {
00025   // forward references to our interfaces
00026 
00027   interface Lookup;
00028   interface Register;
00029   interface Link;
00030   interface Proxy;
00031   interface Admin;
00032   interface OfferIterator;
00033   interface OfferIdIterator;
00034 
00035   // type definitions used in more than one interface
00036   typedef string Istring;
00037   typedef Object TypeRepository;
00038 
00039   typedef Istring PropertyName;
00040   typedef sequence<PropertyName> PropertyNameSeq;
00041   typedef any PropertyValue;
00042 
00043   struct Property
00044   {
00045     PropertyName name;
00046     PropertyValue value;
00047   };
00048   typedef sequence<Property> PropertySeq;
00049 
00050   struct Offer
00051   {
00052     Object reference;
00053     PropertySeq properties;
00054   };
00055   typedef sequence<Offer> OfferSeq;
00056 
00057   typedef string OfferId;
00058   typedef sequence<OfferId> OfferIdSeq;
00059 
00060   typedef Istring ServiceTypeName;  // similar structure to IR::Identifier
00061 
00062   typedef Istring Constraint;
00063 
00064   enum FollowOption
00065   {
00066     local_only,
00067     if_no_local,
00068     always
00069   };
00070 
00071   typedef Istring LinkName;
00072   typedef sequence<LinkName> LinkNameSeq;
00073   typedef LinkNameSeq TraderName;
00074 
00075   typedef string PolicyName;  // policy names restricted to Latin1
00076   typedef sequence<PolicyName> PolicyNameSeq;
00077   typedef any PolicyValue;
00078 
00079   struct Policy
00080   {
00081     PolicyName name;
00082     PolicyValue value;
00083   };
00084   typedef sequence<Policy> PolicySeq;
00085 
00086   // exceptions used in more than one interface
00087 
00088   exception UnknownMaxLeft {};
00089 
00090   exception NotImplemented {};
00091 
00092   exception IllegalServiceType
00093     {
00094       ServiceTypeName type;
00095     };
00096 
00097   exception UnknownServiceType
00098     {
00099       ServiceTypeName type;
00100     };
00101 
00102    exception IllegalPropertyName
00103      {
00104        PropertyName name;
00105      };
00106 
00107    exception DuplicatePropertyName
00108      {
00109        PropertyName name;
00110      };
00111 
00112    exception PropertyTypeMismatch
00113      {
00114        ServiceTypeName type;
00115        Property prop;
00116      };
00117 
00118    exception MissingMandatoryProperty
00119      {
00120        ServiceTypeName type;
00121        PropertyName name;
00122      };
00123 
00124    exception ReadonlyDynamicProperty
00125      {
00126        ServiceTypeName type;
00127        PropertyName name;
00128      };
00129 
00130    exception IllegalConstraint
00131      {
00132        Constraint constr;
00133      };
00134 
00135    exception InvalidLookupRef
00136      {
00137        Lookup target;
00138      };
00139 
00140    exception IllegalOfferId
00141      {
00142        OfferId id;
00143      };
00144 
00145    exception UnknownOfferId
00146      {
00147        OfferId id;
00148      };
00149 
00150    exception DuplicatePolicyName
00151      {
00152        PolicyName name;
00153      };
00154 
00155      // the interfaces
00156 
00157    interface TraderComponents
00158      {
00159        readonly attribute Lookup lookup_if;
00160        readonly attribute Register register_if;
00161        readonly attribute Link link_if;
00162        readonly attribute Proxy proxy_if;
00163        readonly attribute Admin admin_if;
00164      };
00165 
00166    interface SupportAttributes
00167      {
00168        readonly attribute boolean supports_modifiable_properties;
00169        readonly attribute boolean supports_dynamic_properties;
00170        readonly attribute boolean supports_proxy_offers;
00171        readonly attribute TypeRepository type_repos;
00172      };
00173 
00174    interface ImportAttributes
00175      {
00176        readonly attribute unsigned long def_search_card;
00177        readonly attribute unsigned long max_search_card;
00178        readonly attribute unsigned long def_match_card;
00179        readonly attribute unsigned long max_match_card;
00180        readonly attribute unsigned long def_return_card;
00181        readonly attribute unsigned long max_return_card;
00182        readonly attribute unsigned long max_list;
00183        readonly attribute unsigned long def_hop_count;
00184        readonly attribute unsigned long max_hop_count;
00185        readonly attribute FollowOption def_follow_policy;
00186        readonly attribute FollowOption max_follow_policy;
00187      };
00188 
00189    interface LinkAttributes
00190      {
00191        readonly attribute FollowOption max_link_follow_policy;
00192      };
00193 
00194    interface Lookup:TraderComponents,SupportAttributes,ImportAttributes
00195      {
00196        typedef Istring Preference;
00197 
00198        enum HowManyProps { none, some, all };
00199 
00200        union SpecifiedProps switch ( HowManyProps )
00201          {
00202          case some: PropertyNameSeq prop_names;
00203          };
00204        
00205        exception IllegalPreference {
00206          Preference pref;
00207        };
00208        
00209        exception IllegalPolicyName {
00210          PolicyName name;
00211        };
00212        
00213        exception PolicyTypeMismatch {
00214          Policy the_policy;
00215        };
00216        
00217        exception InvalidPolicyValue {
00218          Policy the_policy;
00219        };
00220        
00221        void query (in ServiceTypeName type,
00222                    in Constraint constr,
00223                    in Preference pref,
00224                    in PolicySeq policies,
00225                    in SpecifiedProps desired_props,
00226                    in unsigned long how_many,
00227                    out OfferSeq offers,
00228                    out OfferIterator offer_itr,
00229                    out PolicyNameSeq limits_applied)
00230          raises (IllegalServiceType,
00231                  UnknownServiceType,
00232                  IllegalConstraint,
00233                  IllegalPreference,
00234                  IllegalPolicyName,
00235                  PolicyTypeMismatch,
00236                  InvalidPolicyValue,
00237                  IllegalPropertyName,
00238                  DuplicatePropertyName,
00239                  DuplicatePolicyName);
00240      };
00241      
00242      interface Register : TraderComponents, SupportAttributes
00243        {                
00244          struct OfferInfo
00245          {
00246            Object reference;
00247            ServiceTypeName type;
00248            PropertySeq properties;
00249          };
00250 
00251          exception InvalidObjectRef {
00252            Object ref;
00253          };
00254          
00255          exception UnknownPropertyName {
00256            PropertyName name;
00257          };
00258          
00259          exception InterfaceTypeMismatch {
00260            ServiceTypeName type;
00261            Object reference;
00262          };
00263          
00264          exception ProxyOfferId {
00265            OfferId id;
00266          };
00267          
00268          exception MandatoryProperty {
00269            ServiceTypeName type;
00270            PropertyName name;
00271          };
00272          
00273          exception ReadonlyProperty {
00274            ServiceTypeName type;
00275            PropertyName name;
00276          };
00277          
00278          exception NoMatchingOffers {
00279            Constraint constr;
00280          };
00281          
00282          exception IllegalTraderName {
00283            TraderName name;
00284          };
00285          
00286          exception UnknownTraderName {
00287            TraderName name;
00288          };
00289          
00290          exception RegisterNotSupported {
00291            TraderName name;
00292          };
00293 
00294          OfferId export (in Object reference,
00295                          in ServiceTypeName type,
00296                          in PropertySeq properties)
00297            raises (InvalidObjectRef,
00298                    IllegalServiceType,
00299                    UnknownServiceType,
00300                    InterfaceTypeMismatch,
00301                    IllegalPropertyName, // e.g. prop_name = "<foo-bar"
00302                    PropertyTypeMismatch,
00303                    ReadonlyDynamicProperty,
00304                    MissingMandatoryProperty,
00305                    DuplicatePropertyName);
00306 
00307          void withdraw (in OfferId id)
00308            raises (IllegalOfferId,
00309                    UnknownOfferId,
00310                    ProxyOfferId);
00311          
00312          OfferInfo describe (in OfferId id)
00313            raises (IllegalOfferId,
00314                    UnknownOfferId,
00315                    ProxyOfferId);
00316 
00317          void modify (in OfferId id,
00318                       in PropertyNameSeq del_list,
00319                       in PropertySeq modify_list)
00320            raises (NotImplemented,
00321                    IllegalOfferId,
00322                    UnknownOfferId,
00323                    ProxyOfferId,
00324                    IllegalPropertyName,
00325                    UnknownPropertyName,
00326                    PropertyTypeMismatch,
00327                    ReadonlyDynamicProperty,
00328                    MandatoryProperty,
00329                    ReadonlyProperty,
00330                    DuplicatePropertyName);
00331 
00332          void withdraw_using_constraint (in ServiceTypeName type,
00333                                          in Constraint constr)
00334            raises (IllegalServiceType,
00335                    UnknownServiceType,
00336                    IllegalConstraint,
00337                    NoMatchingOffers);
00338 
00339          Register resolve (in TraderName name)
00340            raises (IllegalTraderName,
00341                    UnknownTraderName,
00342                    RegisterNotSupported);
00343        };
00344 
00345     interface Link : TraderComponents, SupportAttributes, LinkAttributes
00346           {
00347         struct LinkInfo
00348                 {
00349                   Lookup target;
00350                   Register target_reg;
00351                   FollowOption def_pass_on_follow_rule;
00352                   FollowOption limiting_follow_rule;
00353         };
00354 
00355         exception IllegalLinkName {
00356                   LinkName name;
00357         };
00358                 
00359         exception UnknownLinkName {
00360                   LinkName name;
00361         };
00362                 
00363         exception DuplicateLinkName {
00364                   LinkName name;
00365         };
00366                 
00367         exception DefaultFollowTooPermissive {
00368                   FollowOption def_pass_on_follow_rule;
00369                   FollowOption limiting_follow_rule;
00370         };
00371                 
00372         exception LimitingFollowTooPermissive {
00373                   FollowOption limiting_follow_rule;
00374                   FollowOption max_link_follow_policy;
00375         };
00376                 
00377         void add_link (in LinkName name,
00378                                in Lookup target,
00379                                in FollowOption def_pass_on_follow_rule,
00380                                in FollowOption limiting_follow_rule)
00381                   raises (IllegalLinkName,
00382                           DuplicateLinkName,
00383                           InvalidLookupRef, // e.g. nil
00384                           DefaultFollowTooPermissive,
00385                           LimitingFollowTooPermissive);
00386 
00387         void remove_link (in LinkName name)
00388                   raises (IllegalLinkName,
00389                           UnknownLinkName);
00390 
00391         LinkInfo describe_link (in LinkName name)
00392                   raises (IllegalLinkName,
00393                           UnknownLinkName);
00394 
00395         LinkNameSeq list_links ( );
00396 
00397         void modify_link (in LinkName name,
00398                                   in FollowOption def_pass_on_follow_rule,
00399                                   in FollowOption limiting_follow_rule)
00400                   raises (IllegalLinkName,
00401                           UnknownLinkName,
00402                           DefaultFollowTooPermissive,
00403                           LimitingFollowTooPermissive);
00404     };
00405 
00406     interface Proxy : TraderComponents, SupportAttributes
00407           {
00408             typedef Istring ConstraintRecipe;
00409             
00410             struct ProxyInfo
00411             {
00412               ServiceTypeName type;
00413               Lookup target;
00414               PropertySeq properties;
00415               boolean if_match_all;
00416               ConstraintRecipe recipe;
00417               PolicySeq policies_to_pass_on;
00418             };
00419 
00420             exception IllegalRecipe {
00421               ConstraintRecipe recipe;
00422             };
00423             
00424             exception NotProxyOfferId {
00425               OfferId id;
00426             };
00427             
00428             OfferId export_proxy (in Lookup target,
00429                                   in ServiceTypeName type,
00430                                   in PropertySeq properties,
00431                                   in boolean if_match_all,
00432                                   in ConstraintRecipe recipe,
00433                                   in PolicySeq policies_to_pass_on)
00434               raises (IllegalServiceType,
00435                       UnknownServiceType,
00436                       InvalidLookupRef, // e.g. nil
00437                       IllegalPropertyName,
00438                       PropertyTypeMismatch,
00439                       ReadonlyDynamicProperty,
00440                       MissingMandatoryProperty,
00441                       IllegalRecipe,
00442                       DuplicatePropertyName,
00443                       DuplicatePolicyName);
00444 
00445             void withdraw_proxy (in OfferId id)
00446               raises (IllegalOfferId,
00447                       UnknownOfferId,
00448                       NotProxyOfferId);
00449             
00450             ProxyInfo describe_proxy (in OfferId id)
00451               raises (IllegalOfferId,
00452                       UnknownOfferId,
00453                       NotProxyOfferId);
00454           };
00455           
00456           interface Admin : TraderComponents, SupportAttributes, ImportAttributes, LinkAttributes
00457             {              
00458               typedef sequence<octet> OctetSeq;
00459               
00460               readonly attribute OctetSeq request_id_stem;
00461               
00462               unsigned long set_def_search_card (in unsigned long value);
00463               unsigned long set_max_search_card (in unsigned long value);
00464               
00465               unsigned long set_def_match_card (in unsigned long value);
00466               unsigned long set_max_match_card (in unsigned long value);
00467               
00468               unsigned long set_def_return_card (in unsigned long value);
00469               unsigned long set_max_return_card (in unsigned long value);
00470               
00471               unsigned long set_max_list (in unsigned long value);
00472               
00473               boolean set_supports_modifiable_properties (in boolean value);
00474               boolean set_supports_dynamic_properties (in boolean value);
00475               boolean set_supports_proxy_offers (in boolean value);
00476               
00477               unsigned long set_def_hop_count (in unsigned long value);
00478               unsigned long set_max_hop_count (in unsigned long value);
00479               
00480               FollowOption set_def_follow_policy (in FollowOption policy);
00481               FollowOption set_max_follow_policy (in FollowOption policy);
00482               
00483               FollowOption set_max_link_follow_policy (in FollowOption policy);
00484               
00485               TypeRepository set_type_repos (in TypeRepository repository);
00486               
00487               OctetSeq set_request_id_stem (in OctetSeq stem);
00488               
00489               void list_offers (in unsigned long how_many,
00490                                 out OfferIdSeq ids,
00491                                 out OfferIdIterator id_itr)
00492                 raises (NotImplemented);
00493 
00494               void list_proxies (in unsigned long how_many,
00495                                  out OfferIdSeq ids,
00496                                  out OfferIdIterator id_itr)
00497                 raises (NotImplemented);
00498     };
00499 
00500     interface OfferIterator
00501           {
00502         unsigned long max_left ()
00503                   raises (UnknownMaxLeft);
00504 
00505         boolean next_n (in unsigned long n,
00506                                 out OfferSeq offers);
00507 
00508         void destroy ();
00509     };
00510 
00511     interface OfferIdIterator
00512           {
00513             unsigned long max_left ()
00514               raises (UnknownMaxLeft);
00515             
00516             boolean next_n (in unsigned long n,
00517                             out OfferIdSeq ids);
00518 
00519             void destroy ();
00520           };
00521           
00522 }; /* end module CosTrading */
00523 
00524 #endif /* TAO_TRADING_IDL */

Generated on Tue Feb 2 17:49:26 2010 for TAO_CosTrader by  doxygen 1.4.7