nx_cloud_storage_sdk  1.0
Cloud Storage SDK
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
nx::sdk::cloud_storage::IEngine Class Referenceabstract

#include <i_engine.h>

Inheritance diagram for nx::sdk::cloud_storage::IEngine:
nx::sdk::Interface< IEngine > nx::sdk::IRefCountable nx::sdk::RefCountable< nx::sdk::cloud_storage::IEngine > nx::vms_server_plugins::cloud_storage::sample::Engine nx::vms_server_plugins::cloud_storage::stub::Engine

Public Member Functions

virtual Result< IDeviceAgent * > obtainDeviceAgent (const IDeviceInfo *deviceInfo)
 
Result< IString * > queryBookmarks (const char *filter)
 
virtual ErrorCode deleteBookmark (const char *bookmarkId)=0
 
Result< IString * > queryMotionTimePeriods (const char *filter)
 
Result< IString * > queryAnalytics (const char *filter)
 
Result< IString * > queryAnalyticsTimePeriods (const char *filter)
 
virtual ErrorCode saveMetadata (const char *deviceId, int64_t timestampUs, MetadataType type, const char *data)=0
 
virtual ErrorCode saveBestShotImage (const char *data)=0
 
Result< IString * > fetchBestShotImage (const char *objectTrackId) const
 
virtual void startNotifications ()=0
 
virtual void stopNotifications ()=0
 
virtual bool isOnline () const =0
 
virtual ErrorCode storageSpace (StorageSpace *storageSpace) const =0
 
- Public Member Functions inherited from nx::sdk::Interface< IEngine >
virtual IRefCountablequeryInterface (const InterfaceId *id)
 
Ptr< RefCountablequeryInterface ()
 
Ptr< const RefCountablequeryInterface () const
 
- Public Member Functions inherited from nx::sdk::IRefCountable
virtual ~IRefCountable ()=default
 
template<class RefCountable >
Ptr< RefCountablequeryInterface ()
 
template<class RefCountable >
Ptr< const RefCountablequeryInterface () const
 
virtual int addRef () const =0
 
virtual int releaseRef () const =0
 
int refCountThreadUnsafe () const
 

Static Public Member Functions

static auto interfaceId ()
 
- Static Public Member Functions inherited from nx::sdk::IRefCountable
static auto interfaceId ()
 

Protected Member Functions

virtual void doObtainDeviceAgent (Result< IDeviceAgent *> *outResult, const IDeviceInfo *deviceInfo)=0
 
virtual void doQueryBookmarks (const char *filter, Result< IString *> *outResult)=0
 
virtual void doQueryMotionTimePeriods (const char *filter, Result< IString *> *outResult)=0
 
virtual void doQueryAnalytics (const char *filter, Result< IString *> *outResult)=0
 
virtual void doQueryAnalyticsTimePeriods (const char *filter, Result< IString *> *outResult)=0
 
virtual void doFetchBestShotImage (const char *objectTrackId, Result< IString *> *outResult) const =0
 
- Protected Member Functions inherited from nx::sdk::Interface< IEngine >
virtual IRefCountablequeryInterface (const IRefCountable::InterfaceId *id) override
 
IRefCountablequeryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)
 

Additional Inherited Members

- Static Protected Member Functions inherited from nx::sdk::IRefCountable
template<int len>
static constexpr const InterfaceIdmakeId (const char(&charArray)[len])
 
template<class TemplateInstance , class TemplateArg , int len>
static const InterfaceIdmakeIdForTemplate (const char(&baseIdCharArray)[len])
 
- Static Protected Attributes inherited from nx::sdk::IRefCountable
template<typename RefCountable >
static constexpr bool hasAlternativeInterfaceId = HasAlternativeInterfaceId<RefCountable>::value
 

Detailed Description

Engine is an abstraction of a backend communication entity. It's something that knows how to interact with the particular backend endpoint. Currently, Server won't ask plugin for multiple instances of the Engine. But in future it may be implemented. So that each plugin can handle multiple cloud storages each defined by its url. The instance of this class is used, on one hand, by the Server to add new devices and subscribe to archive change notifications. On the other hand, the plugin may track and process all external changes to the archive and/or devices here and report them to the Server.

Member Function Documentation

◆ fetchBestShotImage()

Result<IString*> nx::sdk::cloud_storage::IEngine::fetchBestShotImage ( const char *  objectTrackId) const
inline

Fetch a best shot image associated with the given objectTrackId. Result string should contain the JSON representation of the nx::sdk::cloud_storage::Image struct.

◆ isOnline()

virtual bool nx::sdk::cloud_storage::IEngine::isOnline ( ) const
pure virtual

Check if plugin backend is operational. This function will be periodically called by Server.

Implemented in nx::vms_server_plugins::cloud_storage::stub::Engine, and nx::vms_server_plugins::cloud_storage::sample::Engine.

◆ obtainDeviceAgent()

virtual Result<IDeviceAgent*> nx::sdk::cloud_storage::IEngine::obtainDeviceAgent ( const IDeviceInfo deviceInfo)
inlinevirtual

Add a new device agent described by deviceInfo. If the device agent already has been created, it should be returned without reinstantiation.

◆ queryAnalytics()

Result<IString*> nx::sdk::cloud_storage::IEngine::queryAnalytics ( const char *  filter)
inline

Query object tracks accordingly to the given filter. filter is the JSON representation of the AnalyticsFilter. result should be the JSON representation of the AnalyticsLookupResult.

◆ queryAnalyticsTimePeriods()

Result<IString*> nx::sdk::cloud_storage::IEngine::queryAnalyticsTimePeriods ( const char *  filter)
inline

Query analytics time periods (extracted from object tracks) accordingly to the given filter. filter is the JSON representation of the AnalyticsFilter. result should be the JSON representation of the TimePeriodList.

◆ queryBookmarks()

Result<IString*> nx::sdk::cloud_storage::IEngine::queryBookmarks ( const char *  filter)
inline

Query bookmarks accordingly to the given filter. filter is the JSON representation of the BookmarkFilter. The result should contain a JSON representation of a list of the Bookmark.

◆ queryMotionTimePeriods()

Result<IString*> nx::sdk::cloud_storage::IEngine::queryMotionTimePeriods ( const char *  filter)
inline

Query motion time periods accordingly to the given filter. filter is the JSON representation of the MotionFilter result should be the JSON representation of the TimePeriodList.

◆ saveBestShotImage()

virtual ErrorCode nx::sdk::cloud_storage::IEngine::saveBestShotImage ( const char *  data)
pure virtual

Add a best shot image to the ObjectTrack. data is the JSON representation of the nx::sdk::cloud_storage::Image struct.

Implemented in nx::vms_server_plugins::cloud_storage::stub::Engine, and nx::vms_server_plugins::cloud_storage::sample::Engine.

◆ saveMetadata()

virtual ErrorCode nx::sdk::cloud_storage::IEngine::saveMetadata ( const char *  deviceId,
int64_t  timestampUs,
MetadataType  type,
const char *  data 
)
pure virtual
Parameters
dataA null-terminated string containing the JSON of the corresponding metadata object. Refer to Bookmark, ObjectTrack and Motion objects in the sdk/cloud_storage/helpers/data.h for details.

Implemented in nx::vms_server_plugins::cloud_storage::stub::Engine, and nx::vms_server_plugins::cloud_storage::sample::Engine.

◆ startNotifications()

virtual void nx::sdk::cloud_storage::IEngine::startNotifications ( )
pure virtual

No IArchiveUpdateHandler::onArchiveUpdated() should be called by the plugin before this function has been called.

Implemented in nx::vms_server_plugins::cloud_storage::stub::Engine, and nx::vms_server_plugins::cloud_storage::sample::Engine.

◆ stopNotifications()

virtual void nx::sdk::cloud_storage::IEngine::stopNotifications ( )
pure virtual

◆ storageSpace()

virtual ErrorCode nx::sdk::cloud_storage::IEngine::storageSpace ( StorageSpace storageSpace) const
pure virtual

The documentation for this class was generated from the following file: