16 #ifndef ACSDKNOTIFICATIONS_NOTIFICATIONSCAPABILITYAGENT_H_ 17 #define ACSDKNOTIFICATIONS_NOTIFICATIONSCAPABILITYAGENT_H_ 20 #include <unordered_set> 46 namespace acsdkNotifications {
65 ,
public std::enable_shared_from_this<NotificationsCapabilityAgent> {
84 const std::shared_ptr<acsdkNotificationsInterfaces::NotificationsStorageInterface>& notificationsStorage,
85 const std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererInterface>& renderer,
86 const std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface>& contextManager,
87 const std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface>& exceptionSender,
88 const std::shared_ptr<avsCommon::sdkInterfaces::audio::AudioFactoryInterface>& audioFactory,
89 const std::shared_ptr<registrationManager::CustomerDataManagerInterface>& dataManager,
90 const std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownNotifierInterface>& shutdownNotifier,
94 const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>&
metricRecorder);
110 static std::shared_ptr<NotificationsCapabilityAgent>
create(
111 std::shared_ptr<acsdkNotificationsInterfaces::NotificationsStorageInterface> notificationsStorage,
112 std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererInterface> renderer,
113 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
114 std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionSender,
115 std::shared_ptr<avsCommon::sdkInterfaces::audio::NotificationsAudioFactoryInterface> notificationsAudioFactory,
116 std::shared_ptr<registrationManager::CustomerDataManagerInterface> dataManager,
117 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> metricRecorder =
nullptr);
186 std::shared_ptr<acsdkNotificationsInterfaces::NotificationsStorageInterface> notificationsStorage,
187 std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererInterface> renderer,
188 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
189 std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionSender,
190 std::shared_ptr<avsCommon::sdkInterfaces::audio::NotificationsAudioFactoryInterface> notificationsAudioFactory,
191 std::shared_ptr<registrationManager::CustomerDataManagerInterface> dataManager,
192 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> metricRecorder);
210 bool parseDirectivePayload(std::shared_ptr<DirectiveInfo> info, rapidjson::Document* document);
217 void handleSetIndicatorDirective(std::shared_ptr<DirectiveInfo> info);
224 void handleClearIndicatorDirective(std::shared_ptr<DirectiveInfo> info);
228 void doShutdown()
override;
236 void setHandlingCompleted(std::shared_ptr<DirectiveInfo> info);
290 void executeProvideState(
bool sendToken =
false,
unsigned int stateRequestToken = 0);
302 void notifyObserversOfNotificationReceived();
315 void executeOnPlayFinished();
331 void executeStartQueueNotEmpty();
339 void executeSetIndicator(
341 std::shared_ptr<DirectiveInfo> info);
347 void executeClearIndicator(std::shared_ptr<DirectiveInfo> info);
353 void executePlayFinishedZeroQueued();
362 void executePlayFinishedOneQueued();
368 void executePlayFinishedMultipleQueued();
373 void executeShutdown();
379 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
383 std::shared_ptr<acsdkNotificationsInterfaces::NotificationsStorageInterface> m_notificationsStorage;
386 std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> m_contextManager;
389 std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererInterface> m_renderer;
392 std::shared_ptr<avsCommon::sdkInterfaces::audio::NotificationsAudioFactoryInterface> m_notificationsAudioFactory;
404 std::shared_ptr<acsdkNotificationsInterfaces::NotificationsNotifierInterface> m_notifier;
411 std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> m_capabilityConfigurations;
424 std::condition_variable m_shutdownTrigger;
427 std::mutex m_shutdownMutex;
433 #endif // ACSDKNOTIFICATIONS_NOTIFICATIONSCAPABILITYAGENT_H_
Definition: NotificationRendererObserverInterface.h:25
Definition: CapabilityAgent.h:47
void preHandleDirective(std::shared_ptr< DirectiveInfo > info) override
Definition: CapabilityConfigurationInterface.h:32
Definition: NamespaceAndName.h:32
std::shared_ptr< acsdkNotificationsInterfaces::NotificationsNotifierInterface > getNotificationsNotifierInterface()
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
Definition: EndpointCapabilitiesRegistrarInterface.h:35
Definition: RequiresShutdown.h:32
Definition: NotificationsCapabilityAgent.h:59
void cancelDirective(std::shared_ptr< DirectiveInfo > info) override
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
void provideState(const avsCommon::avs::NamespaceAndName &stateProviderName, unsigned int stateRequestToken) override
static std::shared_ptr< NotificationsCapabilityAgent > createNotificationsCapabilityAgent(const std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > ¬ificationsStorage, const std::shared_ptr< acsdkNotificationsInterfaces::NotificationRendererInterface > &renderer, const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &contextManager, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionSender, const std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > &audioFactory, const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &dataManager, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > endpointCapabilitiesRegistrar, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder)
Definition: DefaultEndpointAnnotation.h:26
void onNotificationRenderingFinished() override
Definition: Annotated.h:35
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
static std::shared_ptr< NotificationsCapabilityAgent > create(std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > notificationsStorage, std::shared_ptr< acsdkNotificationsInterfaces::NotificationRendererInterface > renderer, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< avsCommon::sdkInterfaces::audio::NotificationsAudioFactoryInterface > notificationsAudioFactory, std::shared_ptr< registrationManager::CustomerDataManagerInterface > dataManager, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations() override
void clearData() override
IndicatorState
Definition: IndicatorState.h:30
~NotificationsCapabilityAgent() override
NotificationsCapabilityAgentState
Definition: NotificationsCapabilityAgentState.h:25
Definition: NotificationIndicator.h:29
Definition: CustomerDataHandler.h:34
void handleDirective(std::shared_ptr< DirectiveInfo > info) override
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override