OpFlex Framework  1.2.0
PeerStatusListener.h
Go to the documentation of this file.
1 /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
6 /*
7  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
8  *
9  * This program and the accompanying materials are made available under the
10  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
11  * and is available at http://www.eclipse.org/legal/epl-v10.html
12  */
13 
14 #pragma once
15 #ifndef OPFLEX_CORE_PEERSTATUSLISTENER_H
16 #define OPFLEX_CORE_PEERSTATUSLISTENER_H
17 
18 namespace opflex {
19 namespace ofcore {
20 
31 public:
36  enum PeerStatus {
48  CONNECTED = 2,
52  READY = 3,
56  CLOSING = 4
57  };
58 
67  virtual void peerStatusUpdated(const std::string& peerHostname,
68  int peerPort,
69  PeerStatus peerStatus) {}
70 
74  enum Health {
78  DOWN = 0,
82  DEGRADED = 1,
86  HEALTHY = 2
87  };
88 
95  virtual void healthUpdated(Health health) {}
96 };
97 
100 } /* namespace ofcore */
101 } /* namespace opflex */
102 
103 #endif /* OPFLEX_CORE_PEERSTATUSLISTENER_H */
The peer connection is closing.
Definition: PeerStatusListener.h:56
Health
Represents the overall health of the opflex connection pool.
Definition: PeerStatusListener.h:74
virtual void peerStatusUpdated(const std::string &peerHostname, int peerPort, PeerStatus peerStatus)
Called when the connection state changes for a given Opflex peer.
Definition: PeerStatusListener.h:67
The peer is connected and ready.
Definition: PeerStatusListener.h:52
At least one opflex peer is in a state other than READY.
Definition: PeerStatusListener.h:82
All opflex peers are connected and ready.
Definition: PeerStatusListener.h:86
There is no ready Opflex peer connection.
Definition: PeerStatusListener.h:78
PeerStatus
The status of a particular peer, which will be sent in the peer status update callback.
Definition: PeerStatusListener.h:36
The peer is connected but not yet ready.
Definition: PeerStatusListener.h:48
The peer is connecting.
Definition: PeerStatusListener.h:44
An interface for a listener that will get status update events for peer connection state...
Definition: PeerStatusListener.h:30
The peer is disconnected and not trying to connect.
Definition: PeerStatusListener.h:40
virtual void healthUpdated(Health health)
Called when the overall health of the opflex connection pool changes.
Definition: PeerStatusListener.h:95