nx_server_plugin_sdk 1.0 Server Plugin 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:

## 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, MetadataType type, const char *data)=0
virtual void | flushMetadata (MetadataType type)=0
Result< IString * > | fetchTrackImage (const char *objectTrackId, TrackImageType type) const
virtual void | startAsyncTasks (const char *lastSequenceId)=0
virtual void | stopAsyncTasks ()=0
virtual bool | isOnline () const =0
virtual ErrorCode | storageSpace (StorageSpace *storageSpace) const =0
Public Member Functions inherited from nx::sdk::Interface< IEngine >
virtual IRefCountable * | queryInterface (const InterfaceId *id)
Ptr< Interface > | queryInterface ()
Ptr< const Interface > | queryInterface () const
Public Member Functions inherited from nx::sdk::IRefCountable
virtual | ~IRefCountable ()=default
template<class Interface >
Ptr< Interface > | queryInterface ()
template<class Interface >
Ptr< const Interface > | queryInterface () 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 | doFetchTrackImage (const char *objectTrackId, TrackImageType type, Result< IString *> *outResult) const =0
Protected Member Functions inherited from nx::sdk::Interface< IEngine >
virtual IRefCountable * | queryInterface (const IRefCountable::InterfaceId *id) override
IRefCountable * | queryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)

## Additional Inherited Members
Static Protected Member Functions inherited from nx::sdk::IRefCountable
template<int len>
static const InterfaceId * | makeId (const char(&charArray)[len])
template<int len, int alternativeLen>
static std::vector< const InterfaceId * > | makeIdWithAlternative (const char(&charArray)[len], const char(&alternativeCharArray)[alternativeLen])
template<class TemplateInstance , class TemplateArg , int len>
static const InterfaceId * | makeIdForTemplate (const char(&baseIdCharArray)[len])
static std::vector< const InterfaceId * > | alternativeInterfaceIds (const InterfaceId *id)
static std::vector< const InterfaceId * > | alternativeInterfaceIds (std::vector< const InterfaceId *> ids)

## 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

## ◆ fetchTrackImage()

Result<IString*> nx::sdk::cloud_storage::IEngine::fetchTrackImage | ( | const char * | objectTrackId,
|  | TrackImageType | type
| ) |  | 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.

## ◆ flushMetadata()

virtual void nx::sdk::cloud_storage::IEngine::flushMetadata | ( | MetadataType | type | ) |
| pure virtual

Plugin must send all pending buffered data of the given type immediately when this function is called. If there's nothing to send `onSaveOperationCompleted` should be called with the `noError` result.

Implemented in nx::vms_server_plugins::cloud_storage::stub::Engine.

## ◆ 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 | ) |
| inline virtual

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`.

## ◆ saveMetadata()

virtual ErrorCode nx::sdk::cloud_storage::IEngine::saveMetadata | ( | const char * | deviceId,
|  | MetadataType | type,
|  | const char * | data
| ) |  |
| pure virtual

Parameters

  data | A 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.

Note
  If `saveMetadata` returned `inProgress` VMS Server won't call it again until the onSaveOperationCompleted is called by the plugin.

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

## ◆ startAsyncTasks()

virtual void nx::sdk::cloud_storage::IEngine::startAsyncTasks | ( | const char * | lastSequenceId | ) |
| pure virtual

No async handlers 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.

## ◆ stopAsyncTasks()

virtual void nx::sdk::cloud_storage::IEngine::stopAsyncTasks | ( |  | ) |
| pure virtual

No async handlers should be called by the plugin after this function has been called.

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

## ◆ storageSpace()

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

Get backend storage space information.

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

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

- src/nx/sdk/cloud_storage/i_engine.h