summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FtRtecEventChannelAdmin.idl
blob: 234f59d2480eb8151330c0fafd0159452ecdab3f (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
// -*- IDL -*-

//=============================================================================
/**
 *  @file    FtRtecEventChannelAdmin.idl
 *
 *  $Id$
 *
 *  @author Huang-Ming Huang
 */
//=============================================================================

#ifndef TAO_FTRTEC_EVENTCHANNELADMIN_IDL
#define TAO_FTRTEC_EVENTCHANNELADMIN_IDL

#include "orbsvcs/orbsvcs/RtecEventChannelAdmin.idl"
#include "FTRT.idl"
#include "FTRT_GroupManager.idl"
#include "FtRtecEventComm.idl"

module FtRtecEventChannelAdmin
{
  typedef FtRtecEventComm::ObjectId ObjectId;

  struct ProxyPushConsumerConnectionInfo
  {
    RtecEventComm::PushSupplier push_supplier;
    RtecEventChannelAdmin::SupplierQOS qos;
  };

  union ProxyPushConsumerConnectionParamter switch (boolean)
  {
  case FALSE:
  case TRUE:
    ProxyPushConsumerConnectionInfo info;
  };

  struct ProxyPushConsumerStat
  {
    ObjectId object_id;
    ProxyPushConsumerConnectionParamter parameter;
  };


  struct ProxyPushSupplierConnectionInfo
  {
    RtecEventComm::PushConsumer push_consumer;
    RtecEventChannelAdmin::ConsumerQOS qos;
  };

  union ProxyPushSupplierConnectionParamter switch (boolean)
  {
  case FALSE:
  case TRUE:
    ProxyPushSupplierConnectionInfo info;
  };

  struct ProxyPushSupplierStat
  {
    ObjectId object_id;
    boolean suspended;
    ProxyPushSupplierConnectionParamter parameter;
  };

  typedef sequence<ProxyPushConsumerStat> ProxyConsumerStates;
  typedef sequence<ProxyPushSupplierStat> ProxySupplierStates;

  struct ConsumerAdminState
  {
    ProxySupplierStates proxies;
  };

  struct SupplierAdminState
  {
    ProxyConsumerStates proxies;
  };

  struct CachedResult
  {
    long  retention_id;
    any   result;
  };


  struct CacheEntry
  {
    string client_id;
    CachedResult cached_result;
  };

  typedef sequence<CacheEntry> CachedOptionResults;

  struct EventChannelState
  {
    CachedOptionResults cached_operation_results;
    SupplierAdminState supplier_admin_state;
    ConsumerAdminState consumer_admin_state;
  };

  struct Connect_push_consumer_param
  {
    RtecEventComm::PushConsumer push_consumer;
    RtecEventChannelAdmin::ConsumerQOS qos;
  };

  struct Connect_push_supplier_param
  {
    RtecEventComm::PushSupplier push_supplier;
    RtecEventChannelAdmin::SupplierQOS qos;
  };

  enum OperationType {
    OBTAIN_PUSH_SUPPLIER,
    OBTAIN_PUSH_CONSUMER,
    DISCONNECT_PUSH_SUPPLIER,
    DISCONNECT_PUSH_CONSUMER,
    SUSPEND_CONNECTION,
    RESUME_CONNECTION,
    CONNECT_PUSH_SUPPLIER,
    CONNECT_PUSH_CONSUMER
  };

  union OperationParam switch(OperationType) {
  case CONNECT_PUSH_SUPPLIER:
    Connect_push_supplier_param connect_supplier_param;
  case CONNECT_PUSH_CONSUMER:
    Connect_push_consumer_param connect_consumer_param;
  };


  struct Operation {
     ObjectId object_id;
    OperationParam param;
  };

  interface EventChannelFacade : FtRtecEventComm::PushConsumer {
    /**
     *  Directly connect to push consumer. This method is
     *  equivalent to the effect of executing the following
     *  3 methods.
     *
     *  consumer_admin = ec->for_consumers();
     *  proxy_supplier = consumer_admin->obtain_push_supplier();
     *  proxy_supplier->connect_push_consumer(push_consumer,
     *                                         qos);
     *
     * @returns the ObjectId of proxy_push_supplier
     */
    ObjectId connect_push_consumer(
      in RtecEventComm::PushConsumer push_consumer,
      in RtecEventChannelAdmin::ConsumerQOS qos)
        raises(RtecEventChannelAdmin::TypeError);

    /**
     *  Directly connect to push supplier. This method is
     *  equivalent to the effect of executing the following
     *  3 methods.
     *
     *  supplier_admin = ec->for_suppliers();
     *  push_consumer = supplier_admin->obtain_push_supplier();
     *  push_consumer->connect_push_consumer(proxy_supplier,
     *                                         qos);
     *
     * @returns the ObjectId of proxy_push_consumer
     */
    ObjectId connect_push_supplier(
      in RtecEventComm::PushSupplier push_supplier,
      in RtecEventChannelAdmin::SupplierQOS qos);

    void disconnect_push_supplier(in ObjectId oid)
      raises(FtRtecEventComm::InvalidObjectID);
    void disconnect_push_consumer(in ObjectId oid)
      raises(FtRtecEventComm::InvalidObjectID);
    void suspend_push_supplier(in ObjectId oid)
      raises(FtRtecEventComm::InvalidObjectID);
    void resume_push_supplier(in ObjectId oid)
      raises(FtRtecEventComm::InvalidObjectID);
  };

  exception InvalidState{};

  interface EventChannel : RtecEventChannelAdmin::EventChannel
    , EventChannelFacade
    , FTRT::Updateable
    , FTRT::ObjectGroupManager
  {
  };

  typedef sequence<EventChannel> EventChannelList;

};

#endif