summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.h
blob: b5ea3c2f21539a6c6ec6f41ea5b4a8b75ba7a8b5 (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
/* -*- C++ -*- */
// $Id$
// ==========================================================================
//
// = LIBRARY
//   orbsvcs
//
// = FILENAME
//   Notify_StructuredPushConsumer.h
//
// = DESCRIPTION
//   This class is to be used by clients of the Notification Service.
//
// = AUTHOR
//    Pradeep Gore <pradeep@cs.wustl.edu>
//
// ==========================================================================

#ifndef NOTIFY_STRUCTUREDPUSHCONSUMER_H
#define NOTIFY_STRUCTUREDPUSHCONSUMER_H

#include "orbsvcs/orbsvcs/CosNotifyChannelAdminS.h"

class TAO_Notify_StructuredPushConsumer : public POA_CosNotifyComm::StructuredPushConsumer
{
  // = TITLE
  //   Notify_StructuredPushConsumer
  // = DESCRIPTION
  //
  //
 public:
  // = Initialization and Termination code
  TAO_Notify_StructuredPushConsumer (void);
  // Constructor.

  ~TAO_Notify_StructuredPushConsumer (void);
  // Destructor

  CosNotifyComm::StructuredPushConsumer_ptr get_ref (void);
  // Convert to obj ref.

  virtual void open (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
             CORBA::Environment& ACE_TRY_ENV);
  // This method connects the consumer to the EC.

  virtual void close (CORBA::Environment &ACE_TRY_ENV);
  // Disconnect from the EC.

  virtual void connect (CORBA::Environment &ACE_TRY_ENV);
  // Connect the CosECConsumer to the EventChannel.
  // Creates a new proxy supplier and connects to it.

  virtual void disconnect (CORBA::Environment &ACE_TRY_ENV);
  // Disconnect from the supplier.

  // = NotifyPublish method
    virtual void offer_change (
        const CosNotification::EventTypeSeq & added,
        const CosNotification::EventTypeSeq & removed,
        CORBA::Environment &ACE_TRY_ENV
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        CosNotifyComm::InvalidEventType
      ));

  // = StructuredPushSupplier methods
  virtual void push_structured_event (
        const CosNotification::StructuredEvent & notification,
        CORBA::Environment &ACE_TRY_ENV
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException,
        CosEventComm::Disconnected
       )) = 0;

  virtual void disconnect_structured_push_consumer (
        CORBA::Environment &ACE_TRY_ENV
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException
      ));
 protected:
  CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
  // The consumeradmin that we get our proxy supplier from.

  CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id_;
  // The proxy's id.

  CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy_;
  // The proxy that we are connected to.
};
#endif /* NOTIFY_STRUCTUREDPUSHCONSUMER_H */