SecureConnectProxyService.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Digital Barriers
4 
18 #pragma once
19 
20 
21 #include <memory>
22 #include "Service.h"
23 #include "Stream.h"
24 #include "OpResult.h"
28 
29 namespace EdgeVisDecoderSDK
30 {
31  class SecureConnectProxyServiceImpl;
32  class Encoder;
33  class EncoderImpl;
34 
35  class SecureConnectProxyService : public Stream, public Service
36  {
37  private:
38  friend class SecureConnectProxyServiceImpl;
39 
40  public:
42  SecureConnectProxyService(std::weak_ptr<EncoderImpl> encoder, const std::wstring& prefix, const std::wstring& name = L"", int32_t idleTimeoutMs = -1);
43  SecureConnectProxyService(std::weak_ptr<SecureConnectProxyServiceImpl> pimpl);
44  SecureConnectProxyService(const Stream& other);
45  DB_EDGEVIS_SDK virtual ~SecureConnectProxyService();
46 
47  public:
48 
53  void UpdateMaxTransmitRate();
54 
84  DB_EDGEVIS_SDK OpResult AddProxyEntry(const std::wstring &remoteHost, int32_t remotePort, ESecureConnectSessionDirection direction,
85  const std::wstring &localHost, int32_t localPort, int32_t &serviceId);
86 
102  DB_EDGEVIS_SDK OpResult RemoveProxyEntry(int32_t serviceId);
103 
117  DB_EDGEVIS_SDK OpResult RemoveAllProxyEntries();
118 
125  DB_EDGEVIS_SDK bool IsConnected();
126 
133  DB_EDGEVIS_SDK bool RegisterListener(ISecureConnectProxyServiceListener *listener);
134 
141  DB_EDGEVIS_SDK bool UnregisterListener(ISecureConnectProxyServiceListener *listener);
142 
150  DB_EDGEVIS_SDK SecureConnectProxyStatus GetProxyStatus(int32_t serviceId);
151 
152  public:
153  // Service members
154 
168  DB_EDGEVIS_SDK virtual OpResult Start();
169 
173  DB_EDGEVIS_SDK virtual OpResult Stop();
174 
175  protected:
176  std::wstring m_name;
177  };
178 }
Definition of the Service abstract class.
Definition: Service.h:48
virtual DB_EDGEVIS_SDK OpResult Start()
Start the SecureConnect service.
DB_EDGEVIS_SDK OpResult RemoveProxyEntry(int32_t serviceId)
Remove a SecureConnect service.
DB_EDGEVIS_SDK SecureConnectProxyStatus GetProxyStatus(int32_t serviceId)
Get the status of a SecureConnect proxy entry.
virtual DB_EDGEVIS_SDK OpResult Stop()
Stop the SecureConnect service.
The interface for the secure connect service.
Definition: ISecureConnectProxyServiceListener.h:35
DB_EDGEVIS_SDK bool UnregisterListener(ISecureConnectProxyServiceListener *listener)
Unregistered a listener with the SecureConnectProxyService.
The Stream interface represent a service that is available on an Encoder.
Definition: Stream.h:50
void UpdateMaxTransmitRate()
Update the maximum bandwidth that SecureConnect may use for sending data to the encoder.
DB_EDGEVIS_SDK OpResult RemoveAllProxyEntries()
Remove all existing SecureConnect services.
Contains status information of the SecureConnect connection.
Definition: SecureConnectProxyStatus.h:22
DB_EDGEVIS_SDK bool RegisterListener(ISecureConnectProxyServiceListener *listener)
Register a listener with the SecureConnectProxyService.
ESecureConnectSessionDirection
Determines the direction of the secure connect port.
Definition: ESecureConnectSessionDirection.h:21
DB_EDGEVIS_SDK OpResult AddProxyEntry(const std::wstring &remoteHost, int32_t remotePort, ESecureConnectSessionDirection direction, const std::wstring &localHost, int32_t localPort, int32_t &serviceId)
Add a SecureConnect service.
The EdgeVis Decoder SDK namespace.
DB_EDGEVIS_SDK bool IsConnected()
Determine if the SecureConnect channel is connected.
Creates a secure connect service to the remote encoder.
Definition: SecureConnectProxyService.h:35
OpResult
Result of an operation.
Definition: OpResult.h:25