1//
2//                            Package   : omniORB3
3// Naming.idl
4//
5//
6//
7// Description:
8//	IDL interfaces for COSS Extended Naming Service
9//
10
11#ifndef __NAMING_IDL__
12#define __NAMING_IDL__
13
14#pragma prefix "omg.org"
15
16module CosNaming {
17
18  typedef string Istring;
19
20  struct NameComponent {
21    Istring id;
22    Istring kind;
23  };
24
25  typedef sequence<NameComponent> Name;
26
27  enum BindingType {nobject, ncontext};
28
29  struct Binding {
30    Name        binding_name;
31    BindingType binding_type;
32  };
33  // Note: In struct Binding, binding_name is incorrectly defined
34  // as a Name instead of a NameComponent. This definition is
35  // unchanged for compatibility reasons.
36
37  typedef sequence <Binding> BindingList;
38
39  interface BindingIterator;
40
41  interface NamingContext {
42
43    enum NotFoundReason {missing_node, not_context, not_object};
44
45    exception NotFound {
46      NotFoundReason why;
47      Name           rest_of_name;
48    };
49
50    exception CannotProceed {
51      NamingContext cxt;
52      Name          rest_of_name;
53    };
54
55    exception InvalidName {};
56    exception AlreadyBound {};
57    exception NotEmpty {};
58
59    void bind (in Name n, in Object obj)
60      raises (NotFound, CannotProceed, InvalidName, AlreadyBound);
61
62    void rebind (in Name n, in Object obj)
63      raises (NotFound, CannotProceed, InvalidName);
64
65    void bind_context (in Name n, in NamingContext nc)
66      raises (NotFound, CannotProceed,  InvalidName, AlreadyBound);
67
68    void rebind_context (in Name n, in NamingContext nc)
69      raises (NotFound, CannotProceed, InvalidName);
70
71    Object resolve (in Name n)
72      raises (NotFound, CannotProceed, InvalidName);
73
74    void unbind (in Name n)
75      raises (NotFound, CannotProceed, InvalidName);
76
77    NamingContext new_context ();
78
79    NamingContext bind_new_context (in Name n)
80      raises (NotFound, CannotProceed, InvalidName, AlreadyBound);
81
82    void destroy () raises (NotEmpty);
83
84    void list (in unsigned long how_many,
85	       out BindingList bl, out BindingIterator bi);
86  };
87
88
89  interface BindingIterator {
90    boolean next_one (out Binding b);
91    boolean next_n   (in unsigned long how_many, out BindingList bl);
92    void    destroy  ();
93  };
94
95  interface NamingContextExt : NamingContext {
96    typedef string StringName;
97    typedef string Address;
98    typedef string URLString;
99
100    StringName  to_string(in Name n)      raises(InvalidName);
101    Name        to_name(in StringName sn) raises(InvalidName);
102
103    exception InvalidAddress {};
104
105    URLString   to_url(in Address addr, in StringName sn)
106      raises(InvalidAddress, InvalidName);
107
108    Object      resolve_str(in StringName n)
109      raises(NotFound, CannotProceed, InvalidName, AlreadyBound);
110  };
111};
112
113// Bug workaround for omniidl2
114#pragma prefix ""
115
116#endif // __NAMING_IDL__
117