summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/CosNotifyComm.idl
blob: ae841bf61064f567a52536beead5b6be1a240495 (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
/**
 * @file CosNotifyComm.idl
 *
 * @brief Define the CosNotifyComm module
 *
 * $Id$
 *
 * This module is taken from the standard CORBA Notification Service
 * 1.0, as described in:
 *
 * http://www.omg.org/technology/documents/formal/notification_service.htm
 *
 * In particular the following two documents were used:
 * formal/2000-06-20
 * formal/01-03-03
 *
 * @author Pradeep Gore <pradeep@cs.wustl.edu>
 */

#ifndef _COS_NOTIFY_COMM_IDL_
#define _COS_NOTIFY_COMM_IDL_

#include "CosNotification.idl"
#include "CosEventComm.idl"

#pragma prefix "omg.org"

/**
 * @namespace CosNotifyComm
 *
 * @brief Define the interfaces implemented by users of the CORBA
 *        Notification Service.
 */
module CosNotifyComm
{
  /**
   * @exception InvalidEventType
   *
   * @brief Exception raised to indicate that an EventType is
   * syntactically or semantically invalid.
   */
  exception InvalidEventType {
    /// Type of invalid event
    CosNotification::_EventType type;
  };

  /**
   * @interface NotifyPublish
   *
   * @brief Defines interface to report changes in the events
   *        published to a consumer.
   *
   * Interfaces that represent consumers (or the consumer aspects of
   * an Notification Service) provide this interface to receive
   * notifications in the list of events they support.
   */
  interface NotifyPublish {
    /// Report a change in the list of publications.
    /**
     * @param added The list of new event types that the consumer can
     *   expect.
     * @param removed The list of event types that the consumer should
     *   no longer expect.
     * @throws InvalidEventType if the one or more event types
     *   provided is invalid
     */
    void offer_change (in CosNotification::EventTypeSeq added,
                       in CosNotification::EventTypeSeq removed )
      raises ( InvalidEventType );
  };

  /**
   * @interface NotifySubscribe
   *
   * @brief Defines interface to report changes in the events required
   *        from a supplier.
   *
   * Interfaces that represent suppliers (or the supplier aspects of
   * the Notification Service) provide this interface to receive
   * changes
   */
  interface NotifySubscribe {
    /// Report a change in the list of subscriptions
    /**
     * @param added The list of new event types that are interesting
     *   for the supplier's peer.
     * @param removed The list of event types that are no longer
     *   interesting for the supplier's peer.
     * @throws InvalidEventType if the one or more event types
     *   provided is invalid
     */
    void subscription_change(in CosNotification::EventTypeSeq added,
                             in CosNotification::EventTypeSeq removed )
      raises ( InvalidEventType );
  };

  /**
   * @interface PushConsumer
   *
   * @brief Defines the interface used by push-style consumers
   *
   * Push-style consumers passively accept events as anys.
   */
  interface PushConsumer :
    NotifyPublish,
    CosEventComm::PushConsumer {
  };

  /**
   * @interface PullConsumer
   *
   * @brief Defines the interface used by pull-style consumers
   *
   * Pull-style consumer actively query the Notification Service to
   * receive events.
   */
  interface PullConsumer :
    NotifyPublish,
    CosEventComm::PullConsumer {
  };

  /**
   * @interface PullSupplier
   *
   * @brief Defines the interface used by pull-style suppliers
   *
   * Pull-style suppliers passively provide events to the Notification
   * Service.
   */
  interface PullSupplier :
    NotifySubscribe,
    CosEventComm::PullSupplier {
  };

  /**
   * @interface PushSupplier
   *
   * @brief Defines the interface used by push-style suppliers
   *
   * Push-style suppliers actively provide events to the Notifcation
   * Service.
   */
  interface PushSupplier :
    NotifySubscribe,
    CosEventComm::PushSupplier {
  };

  /**
   * @interface StructuredPushConsumer
   *
   * @brief Defines the interface used by push-style consumers of
   * structured events
   *
   * Push-style consumers passively receive events from the
   * Notification Service.  The events are provided using the
   * CosNotification::StructuredEvent structure.
   */
  interface StructuredPushConsumer : NotifyPublish {
    /// Receive one structured event
    /**
     * This operation is invoked to provide one event to the
     * consumer.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    void push_structured_event(
              in CosNotification::StructuredEvent notification)
      raises(CosEventComm::Disconnected);

    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_structured_push_consumer();
  };

  /**
   * @interface StructuredPullConsumer
   *
   * @brief Defines the interface used by pull-style consumers of
   * structured events
   *
   * Pull-style consumers actively retrieve events from the
   * Notification Service.  The events use the
   * CosNotification::StructuredEvent format.
   */
  interface StructuredPullConsumer : NotifyPublish {
    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_structured_pull_consumer();
  };

  /**
   * @interface StructuredPullSupplier
   *
   * @brief Defines the interface used by pull-style suppliers of
   * structured events
   *
   * Pull-style suppliers passively generate events for the
   * Notification Service.  The events use the
   * CosNotification::StructuredEvent format.
   */
  interface StructuredPullSupplier : NotifySubscribe {
    /// Pull (blocking) one event from the supplier.
    /**
     * This operation should block until the next event becomes
     * available.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    CosNotification::StructuredEvent pull_structured_event()
      raises(CosEventComm::Disconnected);

    /// Pull (non-blocking) one event from the supplier.
    /**
     * The try_pull operation does not block: if the event data is
     * available, it returns the event data and sets the has_event
     * parameter to true; if the event is not available, it sets the
     * has_event parameter to false and the event data is returned
     * as long with an undefined value.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    CosNotification::StructuredEvent try_pull_structured_event(
                                out boolean has_event)
      raises(CosEventComm::Disconnected);

    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_structured_pull_supplier();
  };

  /**
   * @interface StructuredPushSupplier
   *
   * @brief Defines the interface used by push-style suppliers that
   *   provide structure events.
   *
   * Push-style suppliers actively provide events, in this case using
   * the CosEventComm::StructuredEvent format.
   */
  interface StructuredPushSupplier : NotifySubscribe {
    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_structured_push_supplier();
  };

  /**
   * @interface SequencePushConsumer
   *
   * @brief Defines the interface used by push-style consumers that
   *   interested in event batches.
   *
   * Push-style consumer passively accept events, in this case
   * multiple events can be delivered simulatneously.
   */
  interface SequencePushConsumer : NotifyPublish {
    /// Receive an event batch
    /**
     * This operation is invoked to provide an event batch to the
     * consumer.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    void push_structured_events(
              in CosNotification::EventBatch notifications)
      raises(CosEventComm::Disconnected);

    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_sequence_push_consumer();
  };

  /**
   * @interface SequencePullConsumer
   *
   * @brief Defines the interface used by pull-style consumers that
   * deal with event batches.
   *
   * Pull-style consumer actively query the Notification Service for
   * events, this particular interface can obtain multiple events
   * simultaneously.
   */
  interface SequencePullConsumer : NotifyPublish {
    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_sequence_pull_consumer();
  };

  /**
   * @interface SequencePullSupplier
   *
   * @brief Defines the interface used by pull-style suppliers that
   * provide event batches.
   *
   * Pull-style suppliers passively provide events to the Notification
   * Service. This particular interface can provide multiple events
   * simultaneously.
   */
  interface SequencePullSupplier : NotifySubscribe {
    /// Pull (blocking) an event batch from the supplier
    /**
     * @param max_number Maximum number of events expected by the
     *        caller.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    CosNotification::EventBatch pull_structured_events(
                                in long max_number )
      raises(CosEventComm::Disconnected);

    /// Pull (non-blocking) an event batch from the supplier
    /**
     * @param max_number Maximum number of events expected by the
     *        caller.
     * @param has_event Return FALSE if there are no events available,
     *        TRUE otherwise.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    CosNotification::EventBatch try_pull_structured_events(
                                in long max_number,
                                out boolean has_event)
      raises(CosEventComm::Disconnected);

    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_sequence_pull_supplier();
  };

  /**
   * @interface SequencePushSupplier
   *
   * @brief Defines the interface used by push-style suppliers that
   * provide event batches.
   *
   * Push-style suppliers actively generate events for the
   * Notification Service. This particular interface can provide
   * multiple events simultaneously.
   */
  interface SequencePushSupplier : NotifySubscribe {
    /// The peer has disconnected
    /**
     * This operation is invoked by the consumer peer when it wishes
     * to disconnect.  The consumer can safely assume that no more
     * events will follow this request.
     */
    void disconnect_sequence_push_supplier();
  };
};

#pragma prefix ""

#endif /* _COS_NOTIFY_COMM_IDL_ */