|
| 1 | +#include <aws/ipc/GreengrassCoreIpcModel.h> |
| 2 | + |
| 3 | +namespace Aws |
| 4 | +{ |
| 5 | + namespace Eventstreamrpc |
| 6 | + { |
| 7 | + namespace GreengrassCoreIpc |
| 8 | + { |
| 9 | + class ConnectionConfig |
| 10 | + { |
| 11 | + public: |
| 12 | + ConnectionConfig() noexcept {} |
| 13 | + Crt::Optional<Crt::String> GetHostName() const noexcept { return m_hostName; } |
| 14 | + Crt::Optional<uint16_t> GetPort() const noexcept { return m_port; } |
| 15 | + Crt::Optional<Crt::Io::SocketDomain> GetSocketDomain() const noexcept { return m_socketDomain; } |
| 16 | + Crt::Optional<Crt::Io::SocketType> GetSocketType() const noexcept { return m_socketType; } |
| 17 | + Crt::Optional<MessageAmendment> GetConnectAmendment() const noexcept { return m_connectAmendment; } |
| 18 | + |
| 19 | + void SetHostName(Crt::String hostName) noexcept { m_hostName = hostName; } |
| 20 | + void SetPort(uint16_t port) noexcept { m_port = port; } |
| 21 | + void SetSocketDomain(Crt::Io::SocketDomain socketDomain) noexcept { m_socketDomain = socketDomain; } |
| 22 | + void SetSocketType(Crt::Io::SocketType socketType) noexcept { m_socketType = socketType; } |
| 23 | + void SetConnectAmendment(MessageAmendment connectAmendment) noexcept |
| 24 | + { |
| 25 | + m_connectAmendment = connectAmendment; |
| 26 | + } |
| 27 | + |
| 28 | + protected: |
| 29 | + Crt::Optional<Crt::String> m_hostName; |
| 30 | + Crt::Optional<uint16_t> m_port; |
| 31 | + Crt::Optional<Crt::Io::SocketDomain> m_socketDomain; |
| 32 | + Crt::Optional<Crt::Io::SocketType> m_socketType; |
| 33 | + Crt::Optional<MessageAmendment> m_connectAmendment; |
| 34 | + }; |
| 35 | + |
| 36 | + class DefaultConnectionConfig : public ConnectionConfig |
| 37 | + { |
| 38 | + public: |
| 39 | + DefaultConnectionConfig() noexcept; |
| 40 | + }; |
| 41 | + |
| 42 | + class GreengrassCoreIpcClient |
| 43 | + { |
| 44 | + public: |
| 45 | + GreengrassCoreIpcClient( |
| 46 | + Crt::Io::ClientBootstrap &clientBootstrap, |
| 47 | + Crt::Allocator *allocator = Crt::g_allocator) noexcept; |
| 48 | + std::future<RpcError> Connect( |
| 49 | + ConnectionLifecycleHandler &lifecycleHandler, |
| 50 | + const ConnectionConfig &connectionConfig = DefaultConnectionConfig()) noexcept; |
| 51 | + void Close() noexcept; |
| 52 | + SubscribeToIoTCoreOperation NewSubscribeToIoTCore(SubscribeToIoTCoreStreamHandler &) noexcept; |
| 53 | + PublishToIoTCoreOperation NewPublishToIoTCore() noexcept; |
| 54 | + SubscribeToConfigurationUpdateOperation NewSubscribeToConfigurationUpdate( |
| 55 | + SubscribeToConfigurationUpdateStreamHandler &) noexcept; |
| 56 | + DeleteThingShadowOperation NewDeleteThingShadow() noexcept; |
| 57 | + DeferComponentUpdateOperation NewDeferComponentUpdate() noexcept; |
| 58 | + SubscribeToValidateConfigurationUpdatesOperation NewSubscribeToValidateConfigurationUpdates( |
| 59 | + SubscribeToValidateConfigurationUpdatesStreamHandler &) noexcept; |
| 60 | + GetConfigurationOperation NewGetConfiguration() noexcept; |
| 61 | + SubscribeToTopicOperation NewSubscribeToTopic(SubscribeToTopicStreamHandler &) noexcept; |
| 62 | + GetComponentDetailsOperation NewGetComponentDetails() noexcept; |
| 63 | + PublishToTopicOperation NewPublishToTopic() noexcept; |
| 64 | + ListComponentsOperation NewListComponents() noexcept; |
| 65 | + CreateDebugPasswordOperation NewCreateDebugPassword() noexcept; |
| 66 | + GetThingShadowOperation NewGetThingShadow() noexcept; |
| 67 | + SendConfigurationValidityReportOperation NewSendConfigurationValidityReport() noexcept; |
| 68 | + UpdateThingShadowOperation NewUpdateThingShadow() noexcept; |
| 69 | + UpdateConfigurationOperation NewUpdateConfiguration() noexcept; |
| 70 | + ValidateAuthorizationTokenOperation NewValidateAuthorizationToken() noexcept; |
| 71 | + RestartComponentOperation NewRestartComponent() noexcept; |
| 72 | + GetLocalDeploymentStatusOperation NewGetLocalDeploymentStatus() noexcept; |
| 73 | + GetSecretValueOperation NewGetSecretValue() noexcept; |
| 74 | + UpdateStateOperation NewUpdateState() noexcept; |
| 75 | + ListNamedShadowsForThingOperation NewListNamedShadowsForThing() noexcept; |
| 76 | + SubscribeToComponentUpdatesOperation NewSubscribeToComponentUpdates( |
| 77 | + SubscribeToComponentUpdatesStreamHandler &) noexcept; |
| 78 | + ListLocalDeploymentsOperation NewListLocalDeployments() noexcept; |
| 79 | + StopComponentOperation NewStopComponent() noexcept; |
| 80 | + CreateLocalDeploymentOperation NewCreateLocalDeployment() noexcept; |
| 81 | + ~GreengrassCoreIpcClient() noexcept; |
| 82 | + |
| 83 | + private: |
| 84 | + GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; |
| 85 | + ClientConnection m_connection; |
| 86 | + Crt::Io::ClientBootstrap &m_clientBootstrap; |
| 87 | + Crt::Allocator *m_allocator; |
| 88 | + MessageAmendment m_connectAmendment; |
| 89 | + }; |
| 90 | + } // namespace GreengrassCoreIpc |
| 91 | + } // namespace Eventstreamrpc |
| 92 | +} // namespace Aws |
0 commit comments