client-cpp  0.10.0
KaaClientStateListener.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
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 #ifndef KAACLIENTSTATELISTENER_HPP_
18 #define KAACLIENTSTATELISTENER_HPP_
19 
20 #include <memory>
21 
23 
24 namespace kaa {
25 
26 class KaaException;
27 
35 public:
36 
41  virtual void onStarted() {}
42 
48  virtual void onStartFailure(const KaaException& exception) {}
49 
54  virtual void onPaused() {}
55 
61  virtual void onPauseFailure(const KaaException& exception) {}
62 
67  virtual void onResumed() {}
68 
74  virtual void onResumeFailure(const KaaException& exception) {}
75 
80  virtual void onStopped() {}
81 
87  virtual void onStopFailure(const KaaException& exception) {}
88 
96  virtual void onConnectionEstablished(const EndpointConnectionInfo& connection) {}
97 
98  virtual ~KaaClientStateListener() = default;
99 };
100 
101 using KaaClientStateListenerPtr = std::shared_ptr<KaaClientStateListener>;
102 
103 } /* namespace kaa */
104 
105 #endif /* KAACLIENTSTATELISTENER_HPP_ */
virtual void onResumed()
On successful resume of Kaa client. Kaa client is successfully connected to Kaa cluster and is ready ...
virtual void onPauseFailure(const KaaException &exception)
On failure during Kaa client pause. Typically related to failure to free some resources.
virtual void onStopFailure(const KaaException &exception)
On failure during Kaa client stop. Typically related to failure to free some resources.
std::shared_ptr< KaaClientStateListener > KaaClientStateListenerPtr
virtual void onStopped()
On successful stop of Kaa client. Kaa client is successfully stopped and does not consume any resourc...
virtual void onPaused()
On successful pause of Kaa client. Kaa client is successfully paused and does not consume any resourc...
virtual void onStartFailure(const KaaException &exception)
On failure during Kaa client startup. Typically failure is related to network issues.
virtual ~KaaClientStateListener()=default
Notifies about Kaa client state changes and errors.
virtual void onConnectionEstablished(const EndpointConnectionInfo &connection)
virtual void onResumeFailure(const KaaException &exception)
On failure during Kaa client resume. Typically failure is related to network issues.
virtual void onStarted()
On successful start of Kaa client. Kaa client is successfully connected to Kaa cluster and is ready f...