summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.h
blob: 89ba2e562828bd772c0e255d54d88facaea08bab (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file   NotifyLogFactory_i.h
 *
 *  $Id$
 *
 *  Implements the Factory for NotifyLog Objects.
 *
 *
 *  @author David A. Hanvey <d.hanvey@qub.ac.uk>
 */
//=============================================================================

#ifndef TAO_TLS_NOTIFYLOGFACTORY_I_H
#define TAO_TLS_NOTIFYLOGFACTORY_I_H

#include /**/ "ace/pre.h"

#include "orbsvcs/DsNotifyLogAdminS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/DsLogAdminS.h"
#include "orbsvcs/Log/LogMgr_i.h"
#include "orbsvcs/Log/NotifyLog_i.h"

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#endif /* _MSC_VER */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_NotifyLog_i;
class TAO_NotifyLogNotification;

/**
 * @class TAO_NotifyLogFactory_i
 *
 * @brief The NotifyLogFactory is a factory that is used to create NotifyLogs which are event-aware.
 */
class TAO_NotifyLog_Serv_Export TAO_NotifyLogFactory_i :
  public POA_DsNotifyLogAdmin::NotifyLogFactory,
  public TAO_LogMgr_i
{
public:
  //= Initialization and termination code.

  /// Constructor - default.
  TAO_NotifyLogFactory_i (void);

  /// Constructor.
  TAO_NotifyLogFactory_i (CosNotifyChannelAdmin::EventChannelFactory_ptr ecf);

  /// Destructor.
  ~TAO_NotifyLogFactory_i ();

  /// Activate this servant with the ORB and POA passed in.
  DsNotifyLogAdmin::NotifyLogFactory_ptr
    activate (CORBA::ORB_ptr orb,
              PortableServer::POA_ptr poa);

  /// Used to create an NotifyLog.
  DsNotifyLogAdmin::NotifyLog_ptr create (
        DsLogAdmin::LogFullActionType full_action,
        CORBA::ULongLong max_size,
        const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
        const CosNotification::QoSProperties & initial_qos,
        const CosNotification::AdminProperties & initial_admin,
        DsLogAdmin::LogId_out id
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        DsLogAdmin::InvalidLogFullAction,
        DsLogAdmin::InvalidThreshold,
        CosNotification::UnsupportedQoS,
        CosNotification::UnsupportedAdmin
      ));

  /// Same as create (), but allows clients to specify the id.
  DsNotifyLogAdmin::NotifyLog_ptr create_with_id (
        DsLogAdmin::LogId id,
        DsLogAdmin::LogFullActionType full_action,
        CORBA::ULongLong max_size,
        const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
        const CosNotification::QoSProperties & initial_qos,
        const CosNotification::AdminProperties & initial_admin
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        DsLogAdmin::LogIdAlreadyExists,
        DsLogAdmin::InvalidLogFullAction,
        DsLogAdmin::InvalidThreshold,
        CosNotification::UnsupportedQoS,
        CosNotification::UnsupportedAdmin
      ));


  // = Methods from CosNotifyChannelAdmin::ConsumerAdmin.
  CosNotifyChannelAdmin::AdminID MyID (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::EventChannel_ptr MyChannel (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::InterFilterGroupOperator MyOperator (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyFilter::MappingFilter_ptr priority_filter (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));
  void priority_filter (CosNotifyFilter::MappingFilter_ptr)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyFilter::MappingFilter_ptr lifetime_filter (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));
  void lifetime_filter (CosNotifyFilter::MappingFilter_ptr)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::ProxyIDSeq* pull_suppliers (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));
  CosNotifyChannelAdmin::ProxyIDSeq* push_suppliers (void)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::ProxySupplier_ptr get_proxy_supplier (
    CosNotifyChannelAdmin::ProxyID proxy_id)
    ACE_THROW_SPEC ((
      CosNotifyChannelAdmin::ProxyNotFound,
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_pull_supplier (
    CosNotifyChannelAdmin::ClientType ctype,
    CosNotifyChannelAdmin::ProxyID& proxy_id)
    ACE_THROW_SPEC ((
      CosNotifyChannelAdmin::AdminLimitExceeded,
      CORBA::SystemException
    ));

  CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_push_supplier (
    CosNotifyChannelAdmin::ClientType ctype,
    CosNotifyChannelAdmin::ProxyID& id)
    ACE_THROW_SPEC ((
      CosNotifyChannelAdmin::AdminLimitExceeded,
      CORBA::SystemException
    ));

  CosEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (
        )
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));

  CosEventChannelAdmin::ProxyPullSupplier_ptr obtain_pull_supplier (
        )
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));

  void destroy (void)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));

  /// CosNotifyComm::NotifySubscribe.
  void subscription_change (const CosNotification::EventTypeSeq& added,
                            const CosNotification::EventTypeSeq& removed)
    ACE_THROW_SPEC ((
      CosNotifyComm::InvalidEventType,
      CORBA::SystemException
    ));

  /// CosNotification::QoSAdmin.
  CosNotification::QoSProperties* get_qos (void)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));
  void set_qos (const CosNotification::QoSProperties&)
    ACE_THROW_SPEC ((
      CosNotification::UnsupportedQoS,
      CORBA::SystemException
    ));
  void validate_qos (const CosNotification::QoSProperties&,
                     CosNotification::NamedPropertyRangeSeq_out)
    ACE_THROW_SPEC ((
      CosNotification::UnsupportedQoS,
      CORBA::SystemException
    ));

  /// CosNotifyFilter::FilterAdmin.
  CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));
  void remove_filter (CosNotifyFilter::FilterID)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));
  CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID)
    ACE_THROW_SPEC ((
      CosNotifyFilter::FilterNotFound,
      CORBA::SystemException
    ));
  CosNotifyFilter::FilterIDSeq* get_all_filters (void)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));
  void remove_all_filters (void)
        ACE_THROW_SPEC ((
          CORBA::SystemException
        ));

protected:
  virtual CORBA::RepositoryId
    create_repositoryid ();

  virtual PortableServer::ServantBase*
    create_log_servant (DsLogAdmin::LogId id);

  /// Our object ref. after <active>ation.
  DsLogAdmin::LogMgr_var log_mgr_;

  /// The Channel ID.
  CosNotifyChannelAdmin::ChannelID channel_id_;

  /// The EventChannel the factory uses to enable the
  /// NotifyLogNotification object to connect to and send
  /// log-generated events.
  CosNotifyChannelAdmin::EventChannel_var event_channel_;

  /// The ConsumerAdmin that the NotifyLogFactory supports.
  CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;

  //CosEventChannelAdmin::EventChannel_var es_event_channel_;

  //CosEventChannelAdmin::ConsumerAdmin_var es_consumer_admin_;

  /// Used for log-generated events.
  TAO_NotifyLogNotification* notifier_;

  /// The EventChannelFactory used to create an EventChannel.
  CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined(_MSC_VER)
#pragma warning(pop)
#endif /* _MSC_VER */

#include /**/ "ace/post.h"
#endif /* TAO_TLS_NOTIFYLOGFACTORY_I_H */