home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / xnaming.idl < prev    next >
Text File  |  1996-12-24  |  18KB  |  550 lines

  1. //
  2. //   COMPONENT_NAME: somnm
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13. //#  @(#) 1.18 src/somnm/naming/xnaming.idl, somnm, som3.0 5/30/96 13:36:39 [12/24/96 08:00:05]
  14.  
  15. #ifndef xnaming_idl
  16. #define xnaming_idl
  17.  
  18. #include <naming.idl>
  19.  
  20.  
  21.  
  22. module ExtendedNaming {
  23.  
  24.     //# forward declarations
  25.     interface PropertyBindingIterator;
  26.     interface PropertyIterator;
  27.     interface IndexIterator;
  28.  
  29.  
  30.     typedef sequence<CosNaming::Istring> IList;
  31.     typedef struct PropertyBinding_struct {
  32.         CosNaming::Istring property_name;
  33.         boolean sharable;
  34.     } PropertyBinding;
  35.     typedef sequence<PropertyBinding> PropertyBindingList;
  36.  
  37.     typedef struct Property_struct {
  38.         PropertyBinding binding ;
  39.         any value;
  40.     } Property;
  41.     typedef sequence<Property> PropertyList;
  42.  
  43.     typedef struct IndexDescriptor_struct {
  44.         CosNaming::Istring property_name;
  45.         TypeCode property_type;
  46.         unsigned long distance;
  47.     } IndexDescriptor;
  48.     typedef sequence<IndexDescriptor> IndexDescriptorList;
  49.  
  50.         //# support for iterators
  51.  
  52.     interface PropertyBindingIterator : SOMObject {
  53.         boolean next_one (out PropertyBinding pb);
  54.         // returns the next binding. If there are no more bindings
  55.         // 'false' is returned
  56.  
  57.         
  58.         boolean next_n (in unsigned long howMany, 
  59.                 out PropertyBindingList il);
  60.         // returns at most the requested number of bindings
  61.  
  62.         void destroy();
  63.         // destroys the iterator
  64.  
  65.         #ifdef __SOMIDL__
  66.             implementation {
  67.                 releaseorder: next_one, next_n,
  68.                 destroy;
  69.                 
  70.                 next_n: caller_owns_parameters = "il";
  71.                 functionprefix = PB_;
  72.                 dllname = "somnmf.dll";
  73.                 majorversion = 3;
  74.                 minorversion = 0;
  75.             };
  76.         #endif //# __SOMIDL__ 
  77.  
  78.     }; 
  79.  
  80.  
  81.     interface PropertyIterator : SOMObject {
  82.         boolean next_one (out Property p);
  83.         // returns the next binding. If there are no more bindings
  84.         // 'false' is returned
  85.  
  86.         boolean next_n (in unsigned long howMany, 
  87.                 out PropertyList pl);
  88.         // returns at most the requested number of bindings
  89.  
  90.         void destroy();
  91.         // destroys the iterator
  92.  
  93.         #ifdef __SOMIDL__
  94.             implementation {
  95.                 releaseorder: next_one, next_n,
  96.                 destroy;
  97.                 somInit: override;
  98.                 functionprefix = P_;
  99.                 dllname = "somnmf.dll";
  100.                 majorversion = 3;
  101.                 minorversion = 0;
  102.             };
  103.         #endif //# __SOMIDL__ 
  104.  
  105.     };  
  106.  
  107.     interface IndexIterator : SOMObject {
  108.         boolean next_one (out IndexDescriptor p);
  109.         // returns the next binding. If there are no more bindings
  110.         // 'false' is returned
  111.  
  112.         boolean next_n (in unsigned long howMany, 
  113.                 out IndexDescriptorList il);
  114.         // returns at most the requested number of bindings
  115.  
  116.         void destroy();
  117.         // destroys the iterator
  118.  
  119.         #ifdef __SOMIDL__
  120.             implementation {
  121.                 releaseorder: next_one, next_n,
  122.                 destroy;
  123.                 functionprefix = In_;
  124.                 dllname = "somnmf.dll";
  125.                 majorversion = 3;
  126.                 minorversion = 0;
  127.             };
  128.  
  129.         #endif //# __SOMIDL__ 
  130.     };  
  131.  
  132.  
  133.     interface ExtendedNamingContext : CosNaming::NamingContext {
  134.  
  135.         typedef string Constraint;
  136.         typedef char * Strings;
  137.  
  138.         exception InvalidPropertyName {};
  139.         exception NotSupported {};
  140.         exception ConflictingPropertyName {};
  141.         exception PropertyNotFound {
  142.             sequence <CosNaming::Istring> property_name;
  143.         };
  144.         exception NonSharableProperties {};
  145.         exception PropertiesNotShared{};
  146.         exception IllegalConstraintExpression{};
  147.         exception BindingNotFound{};
  148.  
  149.         readonly attribute sequence<TypeCode> allowed_object_types;
  150.         // A list of types of objects that can be bound
  151.         // into this ENC. Empty implies no restrictions
  152.  
  153.  
  154.         readonly attribute sequence<TypeCode> allowed_property_types;
  155.         // a list of the types of the properties that can be
  156.         // added to the entries in this ENC. Empty indicates
  157.         // no restrictions
  158.  
  159.         readonly attribute sequence<CosNaming::Istring> allowed_property_names;
  160.         // a list of names of properties that can be added 
  161.         // to the entries in this ENC. Empty implies no
  162.         // restrictions
  163.  
  164.         readonly attribute sequence<TypeCode> shared_property_types;
  165.         // a list of types of properties that can be shared 
  166.         // Empty implies no restrictions
  167.  
  168.         readonly attribute sequence<CosNaming::Istring> shared_property_names;
  169.         // a list of names of properties that can be shared 
  170.         // Empty implies no restrictions
  171.  
  172.         unsigned short get_features_supported();
  173.         // Gets a bit vector that this ENC implementation supports
  174.         // 0 properties
  175.         // 1 shared properties
  176.         // 2 searching
  177.         // 3 indexing
  178.         // 4 restrictions on object types
  179.         // 5 restrictions on property types
  180.         // 6 restrictions on property names
  181.         // 7 - 15 not used
  182.  
  183.         void add_property(in CosNaming::Name n, 
  184.                 in ExtendedNaming::Property prop) 
  185.             raises (CosNaming::NamingContext::InvalidName,
  186.                 CosNaming::NamingContext::NotFound,
  187.                 CosNaming::NamingContext::CannotProceed,
  188.                 InvalidPropertyName,
  189.                 NotSupported,
  190.                 ConflictingPropertyName);
  191.         // adds/sets property prop with name n in target enc.
  192.         // Name n need not be previously bound. If n has no 
  193.         // binding, then it is bound to a null object. If 
  194.         // property already exists, replaces old value
  195.  
  196.         void add_properties (in CosNaming::Name n, 
  197.                 in ExtendedNaming::PropertyList props)
  198.             raises (CosNaming::NamingContext::InvalidName, 
  199.                 CosNaming::NamingContext::NotFound,
  200.                 CosNaming::NamingContext::CannotProceed,
  201.                 InvalidPropertyName,
  202.                 NotSupported,
  203.                 ConflictingPropertyName);
  204.         // variation of add property. adds/sets more than
  205.         // one property
  206.  
  207.  
  208.         void bind_with_properties (in CosNaming::Name n, 
  209.                 in SOMObject obj, 
  210.                 in ExtendedNaming::PropertyList prop)
  211.             raises (CosNaming::NamingContext::InvalidName,
  212.                 CosNaming::NamingContext::AlreadyBound,
  213.                 CosNaming::NamingContext::NotFound,
  214.                 CosNaming::NamingContext::CannotProceed,
  215.                 InvalidPropertyName,
  216.                 NotSupported,
  217.                 ConflictingPropertyName);
  218.         // combination of add_properties and bind
  219.         // adds/sets property prop with name n in target enc.
  220.         // Name n need not be previously bound. If n has no 
  221.         // binding, then it is bound to a null object. If 
  222.         // property already exists, replaces old value
  223.  
  224.         void bind_context_with_properties (in CosNaming::Name n, 
  225.                 in ExtendedNamingContext obj,
  226.                 in ExtendedNaming::PropertyList props)
  227.             raises (CosNaming::NamingContext::InvalidName,
  228.                 CosNaming::NamingContext::CannotProceed,
  229.                 CosNaming::NamingContext::AlreadyBound,
  230.                 CosNaming::NamingContext::NotFound,
  231.                 InvalidPropertyName,
  232.                 NotSupported,
  233.                 ConflictingPropertyName);
  234.          // Names an object that is a naming context. Also 
  235.          // associates properties with the name object binding.
  236.          // Naming contexts bound using this operation participate
  237.          // in name resolution when compound names are resolved.
  238.          // Cannot bind a nil naming context.
  239.  
  240.         void rebind_with_properties (in CosNaming::Name n, 
  241.                 in SOMObject obj,
  242.                 in ExtendedNaming::PropertyList prop)
  243.             raises (CosNaming::NamingContext::InvalidName,
  244.                 CosNaming::NamingContext::NotFound,
  245.                 InvalidPropertyName,
  246.                 NotSupported,
  247.                 ConflictingPropertyName);
  248.         // combination of rebind and add_properties
  249.         
  250.         void rebind_context_with_properties (in CosNaming::Name n, 
  251.                 in ExtendedNamingContext obj,
  252.                 in ExtendedNaming::PropertyList props)
  253.             raises (CosNaming::NamingContext::InvalidName,
  254.                 CosNaming::NamingContext::NotFound,
  255.                 InvalidPropertyName,
  256.                 NotSupported,
  257.                 ConflictingPropertyName);
  258.     
  259.         void share_property (in CosNaming::Name target_n, 
  260.                 in ExtendedNamingContext source_enc,
  261.                 in CosNaming::Name source_n, 
  262.                 in CosNaming::Istring pname)
  263.             raises (CosNaming::NamingContext::NotFound,
  264.                 CosNaming::NamingContext::CannotProceed,
  265.                 CosNaming::NamingContext::InvalidName,
  266.                 InvalidPropertyName,
  267.                 PropertyNotFound,
  268.                 ConflictingPropertyName,
  269.                 NotSupported);
  270.         // Adds property to the binding indicated by target_n
  271.         // of the target naming context that are shared 
  272.         // with the binding indicated 
  273.         // by source_n in source_enc. Logically, all enc's that share
  274.         // properties are at the same level. 
  275.         // If the property name is already defined as a local property, 
  276.         // then ConflictingPropertyName is raised. If the property 
  277.         // name is already defined as a shared property, then the 
  278.         // property's source_n and source_enc are updated.
  279.  
  280.  
  281.         void share_properties (in CosNaming::Name target_n, 
  282.                 in ExtendedNamingContext source_enc,
  283.                 in CosNaming::Name source_n, 
  284.                 in ExtendedNaming::IList pnames)
  285.             raises (CosNaming::NamingContext::NotFound,
  286.                 CosNaming::NamingContext::CannotProceed,
  287.                 CosNaming::NamingContext::InvalidName,
  288.                 PropertyNotFound,
  289.                 InvalidPropertyName,
  290.                 ConflictingPropertyName,
  291.                 NotSupported);
  292.  
  293.  
  294.         void unshare_property (in CosNaming::Name n, 
  295.                 in CosNaming::Istring property_name)
  296.             raises (CosNaming::NamingContext::NotFound,
  297.                 CosNaming::NamingContext::CannotProceed,
  298.                 CosNaming::NamingContext::InvalidName,
  299.                 PropertyNotFound,
  300.                 InvalidPropertyName,
  301.                 PropertiesNotShared,
  302.                 NotSupported,
  303.                 ConflictingPropertyName);
  304.  
  305.         void unshare_properties (in CosNaming::Name n, 
  306.                 in ExtendedNaming::IList pnames)
  307.             raises (CosNaming::NamingContext::NotFound,
  308.                 CosNaming::NamingContext::CannotProceed,
  309.                 CosNaming::NamingContext::InvalidName,
  310.                 PropertyNotFound,
  311.                 InvalidPropertyName,
  312.                 PropertiesNotShared,
  313.                 NotSupported,
  314.                 ConflictingPropertyName);
  315.  
  316.         void list_properties (in CosNaming::Name n, 
  317.                 in unsigned long howMany,
  318.                 out PropertyBindingList pbl,
  319.                 out ExtendedNaming::PropertyBindingIterator rest)
  320.             raises (CosNaming::NamingContext::NotFound,
  321.                 CosNaming::NamingContext::InvalidName,
  322.                 CosNaming::NamingContext::CannotProceed);
  323.         // resolves name n in target enc and returns atmost
  324.         // howMany property bindings. If more exist, an iterator
  325.         // is returned that holds the remaining names
  326.  
  327.         void get_property (in CosNaming::Name n, 
  328.                 in CosNaming::Istring pn, 
  329.                    out ExtendedNaming::Property prop)
  330.             raises (CosNaming::NamingContext::NotFound,
  331.                 CosNaming::NamingContext::InvalidName,
  332.                 PropertyNotFound,
  333.                 InvalidPropertyName,
  334.                 CosNaming::NamingContext::CannotProceed);
  335.         // resolves the name n in target enc and returns the value 
  336.         // associated with property pn
  337.  
  338.  
  339.         void get_properties (in CosNaming::Name n,
  340.                 in unsigned long howMany,
  341.                 in ExtendedNaming::IList inames,
  342.                 out ExtendedNaming::PropertyList props,
  343.                 out ExtendedNaming::PropertyIterator rest)
  344.             raises (CosNaming::NamingContext::NotFound,
  345.                 CosNaming::NamingContext::InvalidName,
  346.                 InvalidPropertyName,
  347.                 PropertyNotFound,
  348.                 CosNaming::NamingContext::CannotProceed);
  349.  
  350.         void get_all_properties (in CosNaming::Name n, 
  351.                 in unsigned long howMany,
  352.                 out ExtendedNaming::PropertyList props,
  353.                 out ExtendedNaming::PropertyIterator rest)
  354.             raises (CosNaming::NamingContext::NotFound,
  355.                 CosNaming::NamingContext::InvalidName,
  356.                 PropertyNotFound,
  357.                 CosNaming::NamingContext::CannotProceed);
  358.  
  359.         SOMObject resolve_with_property(
  360.                 in CosNaming::Name n, 
  361.                 in CosNaming::Istring prop,
  362.                 out any v)
  363.             raises  (CosNaming::NamingContext::NotFound,
  364.                 CosNaming::NamingContext::InvalidName,
  365.                 InvalidPropertyName,
  366.                 CosNaming::NamingContext::CannotProceed,
  367.                 PropertyNotFound);
  368.         // combination of resolve and get_property
  369.  
  370.  
  371.         SOMObject resolve_with_properties (in CosNaming::Name n, 
  372.                 in unsigned long howMany, 
  373.                 in ExtendedNaming::IList inames,
  374.                 out ExtendedNaming::PropertyList props,
  375.                 out ExtendedNaming::PropertyIterator rest)
  376.             raises (CosNaming::NamingContext::NotFound,
  377.                 CosNaming::NamingContext::InvalidName,
  378.                 PropertyNotFound,
  379.                 CosNaming::NamingContext::CannotProceed,
  380.                 InvalidPropertyName);
  381.  
  382.         SOMObject resolve_with_all_properties (in CosNaming::Name n, 
  383.                 in unsigned long howMany, 
  384.                 out ExtendedNaming::PropertyList props,
  385.                 out ExtendedNaming::PropertyIterator rest)
  386.             raises (CosNaming::NamingContext::NotFound,
  387.                 CosNaming::NamingContext::InvalidName,
  388.                 CosNaming::NamingContext::CannotProceed
  389.                 );
  390.  
  391.         void remove_property (in CosNaming::Name n, 
  392.                 in CosNaming::Istring prop)
  393.             raises (CosNaming::NamingContext::NotFound,
  394.                 CosNaming::NamingContext::InvalidName,
  395.                 PropertyNotFound,
  396.                 InvalidPropertyName,
  397.                 CosNaming::NamingContext::CannotProceed,
  398.                 NotSupported);
  399.         // resolves name n in target and removes property prop
  400.         // If the property is a shared property, then the sharing
  401.         // relationship between the physical enc and the property 
  402.         // in severed. If the target enc happens to be the physical
  403.         // owner of the property (if it is a shared property), 
  404.         // then the property is moved to someother enc 
  405.         // (logical owner) and the sharing relationship 
  406.         // between the property and the physical enc is severed.
  407.  
  408.  
  409.         void remove_properties (in CosNaming::Name n, 
  410.                 in ExtendedNaming::IList plist)
  411.             raises (CosNaming::NamingContext::NotFound,
  412.                 CosNaming::NamingContext::InvalidName,
  413.                 PropertyNotFound,
  414.                 InvalidPropertyName,
  415.                 CosNaming::NamingContext::CannotProceed,
  416.                 NotSupported);
  417.         // resolves name n in target and removes properties plist.
  418.         // If a property is a shared property, then the sharing 
  419.         // relationship between the physical enc and the property 
  420.         // in severed. If the target enc happens to be the physical
  421.         // owner of a shared property, then the property is moved to
  422.         // someother enc (logical owner) and the 
  423.         // sharing relationship  between the property 
  424.         // and the physical enc is severed.
  425.  
  426.  
  427.         void remove_all_properties (in CosNaming::Name n)
  428.             raises (CosNaming::NamingContext::NotFound,
  429.                 CosNaming::NamingContext::InvalidName,
  430.                 CosNaming::NamingContext::CannotProceed,
  431.                 NotSupported);
  432.         // resolves name n in target and removes all properties.
  433.         // If a property is a shared property, then the sharing 
  434.         // relationship between the physical enc and the property 
  435.         // in severed. If the target enc happens to be the physical
  436.         // owner of a shared property, then the property is moved to
  437.         // someother enc (logical owner) and the sharing relationshi
  438.         // between the property and the physical enc is severed.
  439.  
  440.         SOMObject find_any (in Constraint c, 
  441.                 in unsigned long distance)
  442.             raises (IllegalConstraintExpression,
  443.                 CosNaming::NamingContext::CannotProceed,
  444.                 BindingNotFound,
  445.                 NotSupported);
  446.  
  447.         void find_all (in Constraint c,
  448.                    in unsigned long distance ,
  449.                    in unsigned long howMany,
  450.                    out CosNaming::BindingList bl,
  451.                    out CosNaming::BindingIterator bi)
  452.             raises (IllegalConstraintExpression,
  453.                 CosNaming::NamingContext::CannotProceed,
  454.                 BindingNotFound,
  455.                 NotSupported);
  456.         // Returns all binding names whose
  457.         // properties satisfy Constraint "c".
  458.         // It will search up to a depth of "distance"
  459.         // for all bindings that satisfy the
  460.         // given constraint. if distance is set to 0
  461.                 // this operation will only search the
  462.                 // targeted context. Up to how_many
  463.                 // name-object-bindings will be put into
  464.                 // the BindingList "bl". If more than how_many
  465.                 // objects are found to satifsy the
  466.                 // constraint, then the remaining
  467.                 // name-object-bindings are put into the
  468.                 // BindingIterator, "bi".
  469.  
  470.         void find_any_name_binding(in Constraint c,
  471.                 in unsigned long distance,
  472.                 out CosNaming::Binding bi)
  473.             raises (NotSupported,
  474.                 CosNaming::NamingContext::CannotProceed,
  475.                 BindingNotFound,
  476.                 IllegalConstraintExpression);
  477.  
  478.         void add_index (in ExtendedNaming::IndexDescriptor i)
  479.             raises (NotSupported);
  480.         
  481.         void list_indexes(in unsigned long howMany, 
  482.                 out ExtendedNaming::IndexDescriptorList il,
  483.                 out ExtendedNaming::IndexIterator rest)
  484.             raises (NotSupported);
  485.  
  486.         void remove_index(in ExtendedNaming::IndexDescriptor i)
  487.           raises (CosNaming::NamingContext::NotFound,
  488.             CosNaming::NamingContext::CannotProceed,
  489.              InvalidPropertyName,
  490.              ConflictingPropertyName);
  491.  
  492.  
  493.     #ifdef __SOMIDL__
  494.         implementation {
  495.            releaseorder: get_features_supported, 
  496.             add_property, add_properties,
  497.             bind_with_properties, bind_context_with_properties,
  498.             rebind_with_properties, 
  499.             rebind_context_with_properties,
  500.             share_property, share_properties, unshare_property,
  501.             unshare_properties, list_properties, get_property,
  502.             get_properties, get_all_properties, 
  503.             resolve_with_property, resolve_with_properties,
  504.             resolve_with_all_properties, remove_property,
  505.             remove_properties, remove_all_properties,
  506.             find_any, find_all, add_index, list_indexes,
  507.             remove_index, _get_allowed_object_types, 
  508.             find_any_name_binding,
  509.             _set_allowed_object_types, 
  510.             _get_allowed_property_types,
  511.             _set_allowed_property_types, 
  512.             _get_allowed_property_names, 
  513.             _set_allowed_property_names,
  514.             _get_shared_property_names,
  515.             _set_shared_property_names,
  516.             _get_shared_property_types,
  517.             _set_shared_property_types
  518.             ;
  519.  
  520.         functionprefix = ENC_;
  521.         allowed_object_types: nodata;
  522.         allowed_property_types: nodata;
  523.         allowed_property_names: nodata;
  524.         shared_property_names: nodata;
  525.         shared_property_types: nodata;
  526.  
  527.         somDestruct :override;
  528.         somDefaultInit: override, init;
  529.  
  530.         dllname = "somnmf.dll";
  531.         majorversion = 3;
  532.         minorversion = 0;
  533.  
  534.         };
  535.  
  536.     #endif //# __SOMIDL__ 
  537.  
  538.     }; 
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547. };  
  548.  
  549. #endif 
  550.