class SubscriptionEngine

Defined at line 71 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionEngine.h

This is a singleton hosting all WDM Next subscriptions, both client and publisher sides.

Public Methods

SubscriptionEngine * GetInstance ()

Retrieve the singleton Subscription Engine. Note this function should be implemented by the

adoption layer.

Returns

A pointer to the shared Subscription Engine

void SetEventCallback (void *const aAppState, const EventCallback aEventCallback)

Set the event back function and pointer to associated state object for SubscriptionEngine specific call backs

Parameters

aAppState [in] A pointer to application layer supplied state object
aEventCallback [in] A function pointer for event call back
void DefaultEventHandler (EventID aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)

This is the default event handler to be called by application layer for any ignored or unrecognized event

Parameters

aEvent [in] A function pointer for event call back
aInParam [in] A const reference to the input parameter for this event
aOutParam [out] A reference to the output parameter for this event
WEAVE_ERROR GetMinEventLogPosition (size_t & outLogPosition)

Retrieve the minimum relative position of the event offload point from all active subscription handlers.

Retrieves the minimum relative (to the boottime) position of

the event offload point from all active subscription handlers.

Parameters

outLogPosition [in] Minimum log offload point for all active subscription handlers. If no subscription handlers are active, the value remains unchanged. The log position is set to 0 upon initializing the subscription handler.
WEAVE_ERROR NewClient (SubscriptionClient **const appClient, Binding *const apBinding, void *const apAppState, const SubscriptionClient::EventCallback aEventCallback, const TraitCatalogBase<TraitDataSink> *const apCatalog, const uint32_t aInactivityTimeoutDuringSubscribingMsec)

This is the default event handler to be called by application layer for any ignored or unrecognized event

Parameters

appClient [in] A pointer to pointer for the new subscription client object
apBinding [in] A pointer to Binding to be used for this subscription client
apAppState [in] A pointer to application layer supplied state object
aEventCallback [in] A function pointer for event call back
apCatalog [in] A pointer to data sink catalog object
aTimeoutMsecBeforeSubscribeResponse [in] Max number of milliseconds before subscribe response must be received after subscribe request is sent
WEAVE_ERROR NewClient (SubscriptionClient **const appClient, Binding *const apBinding, void *const apAppState, const SubscriptionClient::EventCallback aEventCallback, const TraitCatalogBase<TraitDataSink> *const apCatalog, const uint32_t aInactivityTimeoutDuringSubscribingMsec, IWeaveWDMMutex * aUpdateMutex)

This is the default event handler to be called by application layer for any ignored or unrecognized event

Parameters

appClient [in] A pointer to pointer for the new subscription client object
apBinding [in] A pointer to Binding to be used for this subscription client
apAppState [in] A pointer to application layer supplied state object
aEventCallback [in] A function pointer for event call back
apCatalog [in] A pointer to data sink catalog object
aTimeoutMsecBeforeSubscribeResponse [in] Max number of milliseconds before subscribe response must be received after subscribe request is sent
aUpdateMutex [in] A mutex to protect the internal data structures used in WDM updates; NULL by default, it must be provided if the application will call WDM Update methods from multiple threads.
WEAVE_ERROR NewSubscriptionHandler (SubscriptionHandler **const subHandler)
uint16_t GetClientId (const SubscriptionClient *const apClient)
SubscriptionClient * FindClient (const uint64_t aPeerNodeId, const uint64_t aSubscriptionId)
bool UpdateClientLiveness (const uint64_t aPeerNodeId, const uint64_t aSubscriptionId, const bool aKill)
WEAVE_ERROR EnablePublisher (IWeavePublisherLock * aLock, TraitCatalogBase<TraitDataSource> *const aPublisherCatalog)
NotificationEngine * GetNotificationEngine ()

Defined at line 353 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionEngine.h

WEAVE_ERROR Lock ()

The lock methods here guard access to a couple of data structures:

- mPublisherCatalog

- mHandlers

- mNotificationEngine

- mTraintInfoPool

- mNumTraitInfosPool

The implementation is not complete in ensuring all of the above structures are guarded.

WEAVE_ERROR Unlock ()
void DisablePublisher ()

After this call returns, it's free to tear down the current publisher catalog

SubscriptionHandler * FindHandler (const uint64_t aPeerNodeId, const uint64_t aSubscriptionId)
bool UpdateHandlerLiveness (const uint64_t aPeerNodeId, const uint64_t aSubscriptionId, const bool aKill)
uint16_t GetHandlerId (const SubscriptionHandler *const apHandler)
uint16_t GetCommandObjId (const Command *const apHandle)
nl::Weave::WeaveExchangeManager * GetExchangeManager ()

Defined at line 377 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionEngine.h

void SubscriptionEngine ()
WEAVE_ERROR Init (nl::Weave::WeaveExchangeManager *const apExchangeMgr, void *const aAppState, const EventCallback aEventCallback)
WEAVE_ERROR RegisterForSubscriptionlessNotifications (const TraitCatalogBase<TraitDataSink> *const apCatalog)

Enumerations

enum EventID
Name Value
kEvent_OnIncomingSubscribeRequest 0
kEvent_OnIncomingSubscriptionlessNotification 1
kEvent_DataElementAccessControlCheck 2
kEvent_SubscriptionlessNotificationProcessingComplete 3
kEvent_OnIncomingUpdateRequest 4
kEvent_UpdateRequestDataElementAccessControlCheck 5
kEvent_UpdateRequestProcessingComplete 6

Events generated directly from this component

Defined at line 87 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionEngine.h

enum 
Name Value
kMaxNumSubscriptionClients (WDM_MAX_NUM_SUBSCRIPTION_CLIENTS)

Defined at line 263 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionEngine.h

Records

Friends

class WdmUpdateServerTest
class TestWdm
class TestTdm
class NotificationEngine
class SubscriptionClient
class SubscriptionHandler