TopicManagerI.h
Go to the documentation of this file.
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
9 
10 #ifndef TOPIC_MANAGER_I_H
11 #define TOPIC_MANAGER_I_H
12 
13 #include <IceStorm/IceStorm.h>
14 
15 #include <IceStorm/Replica.h>
16 #include <IceStorm/Election.h>
18 #include <IceStorm/Util.h>
19 
20 #include <IceUtil/RecMutex.h>
21 
22 namespace IceStorm
23 {
24 
25  //
26  // Forward declarations.
27  //
28  class PersistentInstance;
30 
31  class TopicImpl;
33 
34  //
35  // TopicManager implementation.
36  //
39  public IceUtil::RecMutex
40  {
41  public:
42 
44 
45  // TopicManager methods.
46  TopicPrx create(const std::string&);
47  TopicPrx retrieve(const std::string&) const;
48  TopicDict retrieveAll() const;
49 
50  // Observer methods.
52  void observerCreateTopic(const IceStormElection::LogUpdate&, const std::string&);
53  void observerDestroyTopic(const IceStormElection::LogUpdate&, const std::string&);
54  void observerAddSubscriber(const IceStormElection::LogUpdate&, const std::string&,
56  void observerRemoveSubscriber(const IceStormElection::LogUpdate&, const std::string&, const Ice::IdentitySeq&);
57 
58  // Sync methods.
60 
61  // Replica methods.
63  virtual void sync(const Ice::ObjectPrx&);
64  virtual void initMaster(const std::set<IceStormElection::GroupNodeInfo>&, const IceStormElection::LogUpdate&);
65  virtual Ice::ObjectPrx getObserver() const;
66  virtual Ice::ObjectPrx getSync() const;
67 
68  void reap();
69 
70  void shutdown();
71 
72  Ice::ObjectPtr getServant() const;
73 
74  private:
75 
76  void updateTopicObservers();
77  void updateSubscriberObservers();
78 
79  TopicPrx installTopic(const std::string&, const Ice::Identity&, bool,
81 
82  const PersistentInstancePtr _instance;
83 
84  std::map<std::string, TopicImplPtr> _topics;
85 
86  Ice::ObjectPtr _managerImpl;
87  Ice::ObjectPtr _observerImpl;
88  Ice::ObjectPrx _observer;
89  Ice::ObjectPtr _syncImpl;
90  Ice::ObjectPrx _sync;
91 
92  LLUMap _lluMap;
93  SubscriberMap _subscriberMap;
94  };
96 
97 } // End namespace IceStorm
98 
99 #endif
Instrumentation.h
IceStormElection::Replica
Definition: Replica.h:37
IceStorm::SubscriberRecordSeq
::std::vector< ::IceStorm::SubscriberRecord > SubscriberRecordSeq
Definition: SubscriberRecord.h:225
IceStorm
Definition: DBTypes.ice:22
IceStorm::TopicManagerImpl::reap
void reap()
Definition: TopicManagerI.cpp:711
IceStorm::TopicManagerImpl::shutdown
void shutdown()
Definition: TopicManagerI.cpp:730
IceStorm::TopicManagerImplPtr
IceUtil::Handle< TopicManagerImpl > TopicManagerImplPtr
Definition: TopicManagerI.h:95
IceStorm::Instrumentation::ObserverUpdater
The ObserverUpdater interface is implemented by IceStorm and an instance of this interface is provide...
Definition: Instrumentation.h:270
Replica.h
IceStorm::TopicManagerImpl::getServant
Ice::ObjectPtr getServant() const
Definition: TopicManagerI.cpp:746
IceStormElection::LogUpdate
A struct used for marking the last log update.
Definition: LLURecord.h:100
IceStorm::TopicManagerImpl::getSync
virtual Ice::ObjectPrx getSync() const
Definition: TopicManagerI.cpp:705
IceStorm::TopicImplPtr
IceUtil::Handle< TopicImpl > TopicImplPtr
Definition: TopicI.h:108
IceStorm::TopicManagerImpl::getContent
void getContent(IceStormElection::LogUpdate &, IceStormElection::TopicContentSeq &)
Definition: TopicManagerI.cpp:596
IceStorm::TopicManagerImpl::initMaster
virtual void initMaster(const std::set< IceStormElection::GroupNodeInfo > &, const IceStormElection::LogUpdate &)
Definition: TopicManagerI.cpp:653
Util.h
IceStorm::SubscriberRecord
Used to store persistent information for persistent subscribers.
Definition: SubscriberRecord.h:214
IceStormElection::TopicContentSeq
::std::vector< ::IceStormElection::TopicContent > TopicContentSeq
A sequence of topic content.
Definition: Election.h:819
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
IceStorm::TopicManagerImpl::sync
virtual void sync(const Ice::ObjectPrx &)
Definition: TopicManagerI.cpp:641
IceStorm::TopicManagerImpl::observerInit
void observerInit(const IceStormElection::LogUpdate &, const IceStormElection::TopicContentSeq &)
Definition: TopicManagerI.cpp:392
IceStorm::TopicManagerImpl::observerAddSubscriber
void observerAddSubscriber(const IceStormElection::LogUpdate &, const std::string &, const IceStorm::SubscriberRecord &)
Definition: TopicManagerI.cpp:560
IceStorm::TopicManagerImpl::getObserver
virtual Ice::ObjectPrx getObserver() const
Definition: TopicManagerI.cpp:699
IceDB::Dbi< std::string, IceStormElection::LogUpdate, IceDB::IceContext, Ice::OutputStream >
IceStorm::TopicManagerImpl
Definition: TopicManagerI.h:37
IceStorm::TopicManagerImpl::observerDestroyTopic
void observerDestroyTopic(const IceStormElection::LogUpdate &, const std::string &)
Definition: TopicManagerI.cpp:545
IceStorm::TopicManagerImpl::TopicManagerImpl
TopicManagerImpl(const PersistentInstancePtr &)
Definition: TopicManagerI.cpp:235
IceStorm::TopicManagerImpl::retrieve
TopicPrx retrieve(const std::string &) const
Definition: TopicManagerI.cpp:356
Election.h
IceUtil::Handle
Definition: forward_declarations.h:29
IceStorm::TopicManagerImpl::observerCreateTopic
void observerCreateTopic(const IceStormElection::LogUpdate &, const std::string &)
Definition: TopicManagerI.cpp:510
IceInternal::ProxyHandle< ::IceProxy::IceStorm::Topic >
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
IceStorm::TopicManagerImpl::observerRemoveSubscriber
void observerRemoveSubscriber(const IceStormElection::LogUpdate &, const std::string &, const Ice::IdentitySeq &)
Definition: TopicManagerI.cpp:578
IceStorm::TopicManagerImpl::retrieveAll
TopicDict retrieveAll() const
Definition: TopicManagerI.cpp:375
IceStorm::TopicManagerImpl::create
TopicPrx create(const std::string &)
Definition: TopicManagerI.cpp:313
IceStorm::PersistentInstancePtr
IceUtil::Handle< PersistentInstance > PersistentInstancePtr
Definition: Instance.h:161
IceStorm::TopicManagerImpl::getLastLogUpdate
virtual IceStormElection::LogUpdate getLastLogUpdate() const
Definition: TopicManagerI.cpp:623