summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/CosPropertyService.idl
blob: 6365b1a69daf5c2cbab145fc8165d23e3552c084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
// -*-c++-*-

// $Id$

// ================================================================
//
// = LIBRARY
//     cos
//
// = FILENAME
//     CosPropertyService.idl
//
// = DESCRITION
//     The property service, downloaded from
//     ftp://ftp.omg.org/pub/docs/1995/95-06-01.ps 
//
// = AUTHOR
//     Alexander Babu Arulanthu <alex@cs.wustl.edu>
//
// ================================================================

#pragma prefix "omg.org"

module CosPropertyService
{
  // = TITLE
  //     CosPropertyService : To support properties (that are typed
  //     named values dynamically associated with an object, outside
  //     of the type system.
  //
  // = DESCRIPTION
  //     The data types and interfaces to deal with property names,
  //     property values, property modes etc.

  // = Data Types.

  typedef string PropertyName;

  struct Property
  {
    PropertyName property_name;
    any property_value;
  };

  enum PropertyModeType
  {
    normal,
    read_only,
    fixed_normal,
    fixed_readonly,
    undefined
  };

  struct PropertyDef
  {
    PropertyName property_name;
    any property_value;
    PropertyModeType property_mode;
  };

  struct PropertyMode
  {
    PropertyName property_name;
    PropertyModeType property_mode;
  };

  typedef sequence<PropertyName> PropertyNames;
  typedef sequence<Property> Properties;
  typedef sequence<PropertyDef> PropertyDefs;
  typedef sequence<PropertyMode> PropertyModes;
  typedef sequence<TypeCode> PropertyTypes;

  interface PropertyNamesIterator;
  interface PropertiesIterator;
  interface PropertySetFactory;
  interface PropertySetDef;
  interface PropertySet;

  // = Exceptions

  exception ConstraintNotSupported {};
  exception InvalidPropertyName {};
  exception ConflictingProperty {};
  exception PropertyNotFound {};
  exception UnsupportedTypeCode {};
  exception UnsupportedProperty {};
  exception UnsupportedMode {};
  exception FixedProperty {};
  exception ReadOnlyProperty {};

  enum ExceptionReason
  {
    invalid_property_name,
    conflicting_property,
    property_not_found,
    unsupported_type_code,
    unsupported_property,
    unsupported_mode,
    fixed_property,
    read_only_property
  };

  exception PropertyException
    {
      ExceptionReason reason;
      PropertyName failing_property_name;
    };
  
  typedef sequence<PropertyException> PropertyExceptions;

  exception MultipleExceptions
    {
      PropertyExceptions exceptions;
    };

  // = Interface Definitions.

  interface PropertySetFactory
    {
      // = TITLE
      //     Factory class for PropertySet interface.
      // = DESCRIPTION
      //     Support for creating PropertySets with initial
      //     constraints and properties.

      PropertySet create_propertyset ();
      // The create_propertyset operation returns a new
      // PropertySet. It is considered an implementation issue as to
      // whether the PropertySet contains any initial properties or
      // has constraints.

      PropertySet create_constrained_propertyset (in PropertyTypes allowed_property_types,
                                                 in Properties allowed_properties)
        raises (ConstraintNotSupported);
      // The create_constrained_propertyset operation allows a client
      // to create a new PropertySet with specific constraints.

      PropertySet create_initial_propertyset (in Properties initial_properties)
        raises (MultipleExceptions);
      // The create_initial_propertyset operation allows a client to
      // create a new PropertySet with specific initial properties.
    };

  interface PropertySetDefFactory
    {
      // = TITLE
      //     Factory class for PropertySetDef interface.
      // = DESCRIPTION
      //     Support for creating Propsetdefs with initial constraints
      //     and properties.

      PropertySetDef create_propertysetdef ();
      //  The create_propertysetdef operation returns a new
      //  PropertySetDef.

      PropertySetDef create_constrained_propertysetdef (in PropertyTypes allowed_property_types,
                                                        in PropertyDefs  allowed_property_defs)
        raises (ConstraintNotSupported);
      // The create_constrained_propertysetdef operation allows a
      // client to create a new PropertySetDef with specific
      // constraints, including property modes.

      PropertySetDef create_initial_propertysetdef (in PropertyDefs initial_property_defs)
        raises (MultipleExceptions);
      // The create_initial_propertysetdef operation allows a client
      // to create a new PropertySetDef with specific initial
      // properties, including property modes.
    };

  interface PropertySet
    {
      // = TITLE
      //     The PropertySet interface provides operations to define
      //     and modify properties, list and get properties, and
      //     delete properties.
      //
      // = DESCRIPTION
      //     Provides support for defining and modifying properties,
      //     getting properties and their names and deleting properties.

      // = Support for defining and modifying properties.

      void define_property (in PropertyName property_name,
                            in any property_value)
        raises (InvalidPropertyName,
                ConflictingProperty,
                UnsupportedTypeCode,
                UnsupportedProperty,
                ReadOnlyProperty);
      // Will modify or add a property to the PropertySet. If the
      // property already exists, then the property type is checked
      // before the value is overwritten. If the property does not
      // exist, then the property is added to the PropertySet.

      void define_properties (in Properties nproperties)
        raises (MultipleExceptions);
      // Will modify or add each of the properties in Properties
      // parameter to the PropertySet. For each property in the list,
      // if the property already exists, then the property type is
      // checked before overwriting the value. If the property does
      // not exist, then the property is added to the PropertySet.

      // = Support for Getting Properties and their Names.

      unsigned long get_number_of_properties ();
      // Returns the current number of properties associated with this
      // PropertySet.

      void get_all_property_names (in unsigned long how_many,
                                   out PropertyNames property_names,
                                   out PropertyNamesIterator rest);
      // Returns all of the property names currently defined in the
      // PropertySet. If the PropertySet contains more than how_many
      // property names, then the remaining property names are put
      // into the PropertyNamesIterator.

      any  get_property_value (in  PropertyName property_name)
        raises (PropertyNotFound,
                InvalidPropertyName);
      // Returns the value of a property in the PropertySet.

      boolean get_properties (in PropertyNames property_names,
                              out Properties nproperties);
      // Returns the values of the properties listed in
      // property_names.

      void get_all_properties (in unsigned long how_many,
                               out Properties nproperties,
                               out PropertiesIterator rest);
      // Returns all of the property names currently defined in the
      // PropertySet. If the PropertySet contains more than how_many
      // property names, then the remaining property names are put
      // into the PropertyNamesIterator.

      // = Support for Deleting Properties.

      void delete_property (in PropertyName property_name)
        raises (PropertyNotFound,
                InvalidPropertyName,
                FixedProperty);
      // Deletes the specified property if it exists from a
      // PropertySet.


      void delete_properties (in PropertyNames property_names)
        raises (MultipleExceptions);
      // Deletes the properties defined in the property_names
      // parameter. This is a batch operation that returns the
      // MultipleExceptions exception if any delete failed.

      boolean delete_all_properties ();
      // Variation of delete_properties. Applies to all properties.

      // = Support for Existence Check.

      boolean is_property_defined (in PropertyName property_name)
        raises (InvalidPropertyName);
      // The is_property_defined operation returns true if the
      // property is defined in the PropertySet, and returns false
      // otherwise.
    };

  interface PropertySetDef:PropertySet
    {
      // = TITLE
      //     Interface to deal with the Property Modes.
      //
      // = DESCRIPTION
      //     The PropertySetDef interface is a specialization
      //     (subclass) of the PropertySet interface. The
      //     PropertySetDef interface provides operations to retrieve
      //     PropertySet constraints, define and modify properties
      //     with modes, and to get or set property modes.

      void get_allowed_property_types (out PropertyTypes property_types);
      // Indicates which types of properties are supported by this
      // PropertySet. If the output sequence is empty, then there is
      // no restrictions on the any TypeCode portion of the
      // property_value field of a Property in this PropertySet,
      // unless the get_allowed_properties output sequence is not empty.

      void get_allowed_properties (out PropertyDefs property_defs);
      // Indicates which properties are supported by this
      // PropertySet. If the output sequence is empty, then there is
      // no restrictions on the properties that can be in this
      // PropertySet, unless the get_allowed_property_types output
      // sequence is not empty.

      void define_property_with_mode (in PropertyName property_name,
                                      in any property_value,
                                      in PropertyModeType property_mode)
        raises (InvalidPropertyName,
                ConflictingProperty,
                UnsupportedTypeCode,
                UnsupportedProperty,
                UnsupportedMode,
                ReadOnlyProperty);
      // This operation will modify or add a property to the
      // PropertySet. If the property already exists, then the
      // property type is checked before the value is overwritten. The
      // property mode is also checked to be sure a new value may be
      // written. If the property does not exist, then the property is
      // added to the PropertySet. To change the any TypeCode portion
      // of the property_value of a property, a client must first
      // delete_property, then invoke the define_property_with_mode.

      void define_properties_with_modes (in PropertyDefs property_defs)
        raises (MultipleExceptions);
      // This operation will modify or add each of the properties in
      // the Properties parameter to the PropertySet. For each
      // property in the list, if the property already exists, then
      // the property type is checked before overwriting the
      // value. The property mode is also checked to be sure a new
      // value may be written. If the property does not exist, then
      // the property is added to the PropertySet. This is a batch
      // operation that returns the MultipleExceptions exception if
      // any define operation failed.

      // = Support for Getting and Setting Property Modes.

      PropertyModeType get_property_mode (in  PropertyName property_name)
        raises (PropertyNotFound,
                InvalidPropertyName);
      // Support for Getting and Setting Property Modes.

      boolean get_property_modes (in PropertyNames property_names,
                                 out PropertyModes property_modes);
      // Support for Getting and Setting Property Modes.

      void set_property_mode (in PropertyName property_name,
                             in PropertyModeType property_mode)
        raises (InvalidPropertyName,
                PropertyNotFound,
                UnsupportedMode);
      // Sets the mode of a property in the PropertySet.

      void set_property_modes (in PropertyModes property_modes)
        raises (MultipleExceptions);
      // Sets the mode for each property in the property_modes
      // parameter. This is a batch operation that returns the
      // MultipleExceptions exception if any set failed.

    };

  interface PropertyNamesIterator
    {
      // = TITLE
      //     Interface for iterating thru the Property Names.
      //
      // = DESCRIPTION
      //     The PropertyNamesIterator interface allows a client to
      //     iterate through the names using the next_one or next_n operations.

      void reset ();
      // The reset operation resets the position in an iterator to the
      // first property, if one exists.

      boolean next_one (out PropertyName property_name);
      // The next_one operation returns true if an item exists at the
      // current position in the iterator with an output parameter of
      // a property name. A return of false signifies no more items in
      // the iterator.

      boolean next_n (in unsigned long how_many,
                      out PropertyNames property_names);
      // The next_n operation returns true if an item exists at the
      // current position in the iterator and the how_many parameter
      // was set greater than zero. The output is a PropertyNames
      // sequence with at most the how_many number of names. A return
      // of false signifies no more items in the iterator.

      void destroy ();
      // The destroy operation destroys the iterator.
    };

  interface PropertiesIterator
    {
      // = TITLE
      //     Interface for iterating thru the Properties.
      //
      // = DESCRIPTION
      //     allows a client to through the name-value pairs using the
      //     next_one or next_n operations.

      void reset ();
      // The reset operation resets the position in an iterator to the
      // first property, if one exists.

      boolean next_one (out Property aproperty);
      // The next_one operation returns true if an item exists at the
      // current position in the iterator with an output parameter of
      // a property. A return of false signifies no more items in the
      // iterator.

      boolean next_n (in unsigned long how_many,
                      out Properties nproperties);
      // The next_n operation returns true if an item exists at the
      // current position in the iterator and the how_many parameter
      // was set greater than zero. The output is a properties
      // sequence with at most the how_many number of properties. A
      // return of false signifies no more items in the iterator.

      void destroy ();
      // The destroy operation destroys the iterator.
    };
};