#ifndef _NEWSSUBSCRIBER_H
#define _NEWSSUBSCRIBER_H

#include <CosNotifyCommS.h>
#include <CosNotifyChannelAdminS.h>
#include <CosNotificationS.h>

#include "Notification/news/ChannelUtil.h"

class NewsSubscriber : public POA_CosNotifyComm::StructuredPushConsumer
{
public:

  NewsSubscriber (CORBA::ORB_ptr orb);

  void connectToChannel (void);

  virtual void select (const char *bureau) = 0;

  void setFilter (const char *domainName, const char *typeName, const char *constraint);

  virtual void disconnect_structured_push_consumer (void);

  virtual void offer_change (const CosNotification::EventTypeSeq &/*added*/,
                             const CosNotification::EventTypeSeq &/*removed*/);

  virtual void push_structured_event (const CosNotification::StructuredEvent &event);

protected:

  CORBA::ORB_var orbVar_;

  ChannelUtil util_;

  CosNotifyChannelAdmin::EventChannel_var channelVar_;

  CosNotifyComm::StructuredPushConsumer_var consumerVar_;

  CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxyVar_;
};

#endif  // _NEWSSUBSCRIBER_H
