#ifndef CORE_INTERNAL_BANDWIDTH_UPGRADE_HANDLER_H_ #define CORE_INTERNAL_BANDWIDTH_UPGRADE_HANDLER_H_ #include "core/internal/client_proxy.h" #include "proto/connections/offline_wire_formats.pb.h" #include "platform/api/count_down_latch.h" #include "platform/api/platform.h" #include "platform/port/string.h" #include "proto/connections_enums.pb.h" namespace location { namespace nearby { namespace connections { // Defines the set of methods that need to be implemented to handle the // per-Medium-specific operations needed to upgrade an EndpointChannel. class BandwidthUpgradeHandler { public: using Platform = platform::ImplementationPlatform; virtual ~BandwidthUpgradeHandler() {} // Reverts any changes made to the device in the process of upgrading // endpoints. virtual void revert() = 0; // Cleans up in-progress upgrades after endpoint disconnection. virtual void processEndpointDisconnection( Ptr > client_proxy, const std::string& endpoint_id, Ptr process_disconnection_barrier) = 0; // Initiates the upgrade for the endpoint and starts listening for upgraded // incoming connections on the initiator side of the bandwidth upgrade. virtual void initiateBandwidthUpgradeForEndpoint( Ptr > client_proxy, const std::string& endpoint_id) = 0; // Processes the BandwidthUpgradeNegotiationFrames that come over the // EndpointChannel on the non-initiator side of the bandwidth upgrade. // TODO(ahlee): Rename parameters in the java code. virtual void processBandwidthUpgradeNegotiationFrame( ConstPtr bandwidth_upgrade_negotiation, Ptr > to_client_proxy, const std::string& from_endpoint_id, proto::connections::Medium current_medium) = 0; }; } // namespace connections } // namespace nearby } // namespace location #endif // CORE_INTERNAL_BANDWIDTH_UPGRADE_HANDLER_H_