Hazelcast C++ Client
InitialMembershipListener.h
1 /*
2  * Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 //
17 // Created by sancar koyunlu on 22/01/14.
18 //
19 
20 
21 #ifndef HAZELCAST_InitialMembershipListener
22 #define HAZELCAST_InitialMembershipListener
23 
24 #include "hazelcast/util/HazelcastDll.h"
25 #include "hazelcast/client/MembershipListener.h"
26 
27 namespace hazelcast {
28  namespace client {
29  class InitialMembershipEvent;
30 
31  class MembershipEvent;
32 
33  class MemberAttributeEvent;
34 
35  namespace spi {
36  namespace impl {
37  class ClientClusterServiceImpl;
38  }
39  }
40 
57  class HAZELCAST_API InitialMembershipListener : public MembershipListener {
58  friend class spi::impl::ClientClusterServiceImpl;
60  public:
61  virtual ~InitialMembershipListener();
62 
68  virtual void init(const InitialMembershipEvent &event) = 0;
69 
70  private:
71  virtual bool shouldRequestInitialMembers() const;
72  };
73 
75  public:
77 
78  virtual void init(const InitialMembershipEvent &event);
79 
80  virtual void memberRemoved(const MembershipEvent &membershipEvent);
81 
82  virtual void memberAdded(const MembershipEvent &membershipEvent);
83 
84  virtual void memberAttributeChanged(const MemberAttributeEvent &memberAttributeEvent);
85 
86  private:
87  virtual bool shouldRequestInitialMembers() const;
88 
89  virtual const std::string &getRegistrationId() const;
90 
91  virtual void setRegistrationId(const std::string &registrationId);
92 
93  InitialMembershipListener *listener;
94  };
95  }
96 }
97 
98 
99 #endif //HAZELCAST_InitialMembershipListener
100 
Definition: MemberAttributeEvent.h:41
Membership event fired when a new member is added to the cluster and/or when a member leaves the clus...
Definition: MembershipEvent.h:42
virtual void memberAdded(const MembershipEvent &membershipEvent)
Invoked when a new member is added to the cluster.
Definition: InitialMembershipListener.cpp:37
virtual void memberRemoved(const MembershipEvent &membershipEvent)
Invoked when an existing member leaves the cluster.
Definition: InitialMembershipListener.cpp:32
Cluster membership listener.
Definition: MembershipListener.h:64
Definition: InitialMembershipListener.h:74
The InitializingMembershipListener is a MembershipListener that will first receives a InitialMembersh...
Definition: InitialMembershipListener.h:57
A event that is send when a InitialMembershipListener} registers itself on a Cluster.
Definition: InitialMembershipEvent.h:47
virtual void memberAttributeChanged(const MemberAttributeEvent &memberAttributeEvent)
Invoked when an attribute of a member was changed.
Definition: InitialMembershipListener.cpp:42
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
virtual void init(const InitialMembershipEvent &event)
Is called when this listener is registered.
Definition: InitialMembershipListener.cpp:27