summaryrefslogtreecommitdiff
path: root/TAO/tests/Bug_3154_Regression/orbsvcs/CosNotification.idl
blob: 17ace4b9f2b04d2fe0ea50e6aaf23268704e4fde (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
/**
 * @file CosNotification.idl
 *
 * @brief Define the CosNotification module
 *
 * CosNotification.idl,v 1.3 2002/07/01 14:13:59 parsons Exp
 *
 * @author Pradeep Gore <pradeep@cs.wustl.edu>
 */

#ifndef _COS_NOTIFICATION_IDL_
#define _COS_NOTIFICATION_IDL_

#pragma prefix "omg.org"

/**
 * @namespace CosNotification
 *
 * @brief Define basic data structures used by the Notification
 *        Service
 */
module CosNotification
{
  /// Dummy typedef for strings, if the intent was to support I18N
  /// strings the spec should have used wstring
  typedef string Istring;

  /// Properties are named using a string
  typedef Istring PropertyName;

  /// Property values are stored using anys
  typedef any PropertyValue;

  /**
   * @struct Property
   *
   * @brief Define a name/value pair.
   *
   * Events are described using named/value sequences, this structure
   * defines the name/value pair.
   */
  struct Property {
    /// The name
    PropertyName name;
    /// The value
    PropertyValue value;
  };

  /// Define a sequence of properties.
  typedef sequence<Property> PropertySeq;

  //@{
  /**
   * @name Different kinds of property sequences
   *
   * @brief The following are all sequences of Property, but
   * serve different purposes.
   */
  /// Property sequence used for optional header fields
  typedef PropertySeq OptionalHeaderFields;

  /// Property sequence used for the event body that can be used
  /// in filtering
  typedef PropertySeq FilterableEventBody;

  /// Specify quality of service properties
  typedef PropertySeq QoSProperties;

  /// Specify administrative properties
  typedef PropertySeq AdminProperties;
  //@}

  /**
   * @struct _EventType
   *
   * @brief Define event type names.
   *
   * Different vertical industries (domains) can define well-known
   * events (event_types).  This structure is used for that purpose
   */
  struct _EventType {
    /// The name of the vertical industry defining the event type.
    string domain_name;
    /// The type of event.
    string type_name;
  };
  /// A sequence of event types
  typedef sequence<_EventType> EventTypeSeq;

  /**
   * @struct PropertyRange
   *
   * @brief A structure to define property ranges.
   *
   */
  struct PropertyRange {
    /// Lower end of the range
    PropertyValue low_val;
    /// High end of the range
    PropertyValue high_val;
  };

  /**
   * @struct NamedPropertyRange
   *
   * @brief A named property range
   */
  struct NamedPropertyRange {
    /// The name
    PropertyName name;
    /// The range
    PropertyRange range;
  };
  /// A sequence of named property ranges
  typedef sequence<NamedPropertyRange> NamedPropertyRangeSeq;

  /**
   * @enum QoSError_code
   *
   * @brief Describe QoS errors.
   */
  enum QoSError_code {
    /// The application has requested an unsupported QoS property
    UNSUPPORTED_PROPERTY,
    /// The application has requested a QoS property that, though
    /// supported, cannot be set in the requested scope.
    UNAVAILABLE_PROPERTY,
    /// The application has requested a QoS property with an
    /// unsupported value.
    UNSUPPORTED_VALUE,
    /// The application has requested a QoS property with a supported
    /// value, but unavailable at the requested scope.
    UNAVAILABLE_VALUE,
    /// The property name is unknown or not recognized.
    BAD_PROPERTY,
    /// The value type for the requested property is invalid
    BAD_TYPE,
    /// The value for the requested property is illegal
    BAD_VALUE
  };

  /**
   * @struct PropertyError
   *
   * @brief Describe the problems detected with an application
   * requested QoS.
   *
   * If there are any problems with an application request for QoS the
   * problems are raised using an exception that contains all the
   * problems, and a description of the valid values (if they apply).
   */
  struct PropertyError {
    /// Property error description
    QoSError_code code;
    /// Property name with a problem
    PropertyName name;
    /// Valid range for that property in the Notification Service
    /// implementation
    PropertyRange available_range;
  };
  /// List of property errors.
  typedef sequence<PropertyError> PropertyErrorSeq;

  /**
   * @exception UnsupportedQoS
   *
   * @brief Exception used to describe problems with one or more QoS
   * requests
   *
   */
  exception UnsupportedQoS {
    /// Complete description of the properties in error
    PropertyErrorSeq qos_err;
  };

  /**
   * @exception UnsupportedAdmin
   *
   * @brief Exception used to describe problems with one or more Admin
   * properties
   */
  exception UnsupportedAdmin {
    /// The complete description of the invalid properties.
    PropertyErrorSeq admin_err;
  };

  /**
   * @struct FixedEventHeader
   *
   * @brief Define the 'fixed' part of the event header
   */
  struct FixedEventHeader {
    /// The event type
    _EventType event_type;
    /// A (possibly unique) name for the particular event
    string event_name;
  };

  /**
   * @struct EventHeader
   *
   * @brief Complete event header
   */
  struct EventHeader {
    /// The fixed part of the event header
    FixedEventHeader fixed_header;
    /// The optional part
    OptionalHeaderFields variable_header;
  };

  /**
   * @struct StructuredEvent
   *
   * @brief Define structured events
   */
  struct StructuredEvent {
    /// The header
    EventHeader header;
    /// The part of the body used for filtering
    FilterableEventBody filterable_data;
    /// The part of the body not used for filtering
    any remainder_of_body;
  };
  /// Sequence of events, for batch processing
  typedef sequence<StructuredEvent> EventBatch;

  //@{
  /**
   * @name Constants for QoS Properties
   *
   * The following constant declarations define the standard QoS
   * property names and the associated values each property can take
   * on. The name/value pairs for each standard property are grouped,
   * beginning with a string constant defined for the property name,
   * followed by the values the property can take on.
   */

  const string EventReliability = "EventReliability";
  const short BestEffort = 0;
  const short Persistent = 1;

  /// Can take on the same values as EventReliability
  const string ConnectionReliability = "ConnectionReliability";

  const string Priority = "Priority";
  const short LowestPriority = -32767;
  const short HighestPriority = 32767;
  const short DefaultPriority = 0;

  /// StartTime takes a value of type TimeBase::UtcT.
  const string StartTime = "StartTime";

  /// StopTime takes a value of type TimeBase::UtcT.
  const string StopTime = "StopTime";

  /// Timeout takes on a value of type TimeBase::TimeT
  const string Timeout = "Timeout";

  const string OrderPolicy = "OrderPolicy";
  const short AnyOrder = 0;
  const short FifoOrder = 1;
  const short PriorityOrder = 2;
  const short DeadlineOrder = 3;

  /// DiscardPolicy takes on the same values as OrderPolicy, plus
  const string DiscardPolicy = "DiscardPolicy";
  const short LifoOrder = 4;

  /// MaximumBatchSize takes on a value of type long
  const string MaximumBatchSize = "MaximumBatchSize";

  /// PacingInterval takes on a value of type TimeBase::TimeT
  const string PacingInterval = "PacingInterval";

  /// StartTimeSupported takes on a boolean value
  const string StartTimeSupported = "StartTimeSupported";

  /// StopTimeSupported takes on a boolean value
  const string StopTimeSupported = "StopTimeSupported";

  /// MaxEventsPerConsumer takes on a value of type long
  const string MaxEventsPerConsumer = "MaxEventsPerConsumer";

  //@}

  /**
   * @interface QoSAdmin
   *
   * @brief Interface used to control the QoS properties of an Event
   * Service components (Channel, Proxy, etc.)
   *
   * QoS properties of a channel can be set at different levels,
   * including the proxies, the ConsumerAdmin and the SupplierAdmin
   * objects.  Each one of those components offers this interface to
   * allow control over the properties.
   */
  interface QoSAdmin {
    /// Get the current QoS properties
    /**
     * The operation returns the properties set:
     * - At the level queried
     * - Not set at the level queried but set at a higher-level
     * - Not set at all but having a default value.
     */
    QoSProperties get_qos();

    /// Set the QoS properties
    /**
     * @param qos The requested QoS properties
     * @throws UnsupportedQoS if the requested QoS cannot be
     *   implemented or is invalid.  The exception contents describe
     *   the problem(s) in detail.
     */
    void set_qos ( in QoSProperties qos)
      raises ( UnsupportedQoS );

    /// Validate a set of QoS properties
    /**
     * @param required_qos the list of properties requested by the
     *        application
     * @param available_qos If the properties are supported this
     *        argument returns a list of any other properties that
     *        could also be set.
     * @throws UnsupportedQoS if the requested QoS cannot be
     *   implemented or is invalid.  The exception contents describe
     *   the problem(s) in detail.
     */
    void validate_qos (in QoSProperties required_qos,
                       out NamedPropertyRangeSeq available_qos )
      raises ( UnsupportedQoS );
  };

  //@{
  /**
   * @name Constants for Admin Properties
   *
   * Admin properties are defined in similar manner as QoS
   * properties. The only difference is that these properties are
   * related to channel administration policies, as opposed message
   * quality of service
   */
  /// MaxQueueLength takes on a value of type long
  const string MaxQueueLength = "MaxQueueLength";

  /// MaxConsumers takes on a value of type long
  const string MaxConsumers = "MaxConsumers";

  /// MaxSuppliers takes on a value of type long
  const string MaxSuppliers = "MaxSuppliers";

  /// RejectNewEvents takes on a value of type Boolean
  const string RejectNewEvents = "RejectNewEvents";
  //@}

  /**
   * @interface AdminPropertiesAdmin
   *
   * @brief Define the interface to manipulate the Admin properties of
   *   a Notification Service components
   *
   * Several Notification Service components have Admin properties,
   * including the Event Channel, its ConsumerAdmin and SupplierAdmin
   * objects as well as the proxies.  This interface is used to
   * control the Admin properties of each one of those components.
   */
  interface AdminPropertiesAdmin {
    /// Get the Admin properties
    /**
     * The operation returns the properties set:
     * - At the level queried
     * - Not set at the level queried but set at a higher-level
     * - Not set at all but having a default value.
     */
    AdminProperties get_admin();

    /// Set the Admin properities
    /**
     * @param admin The list of Admin properties requested
     * @throws UnsupportedAdmin if the requested admin properties
     *   cannot be implemented or are invalid
     */
    void set_admin (in AdminProperties admin)
      raises ( UnsupportedAdmin);
  };

};

#pragma prefix ""

#endif /* _COS_NOTIFICATION_IDL_ */