EdgeVisDecoderSDK::Service Class Referenceabstract

Detailed Description

Definition of the Service abstract class.

A Service is a feature that can be used on an asset by only 1 application at a time. Other attempts to use the service will be denied until the service is closed by the other application.

This Service class manages keeping the service connection alive and also managing an idle timeout that will automatically close the service connection if it has not been used for a nominal time period.

Keep alive and idle timeouts can be disabled. However, this should be used with care because disabling them may result in the service connection being dropped or being kept open forever.

Availability

Available in version 6.0 of Decoder SDK. Requires a server version greater than 6.0

#include <Service.h>

Public Member Functions

DB_EDGEVIS_SDK std::wstring ServiceName () const
 Gets the name of the Service. More...
 
void UpdateState (ServiceState state, std::wstring user)
 Updates the service's state. More...
 
DB_EDGEVIS_SDK bool Started () const
 Determines whether the service has been started or not. More...
 
DB_EDGEVIS_SDK int32_t KeepAliveInterval () const
 Retrieves the keep alive interval for the service. More...
 
DB_EDGEVIS_SDK int32_t IdleTimeoutInterval () const
 Retrieves the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK void SetIdleTimeoutInterval (int32_t idleTimeout)
 Sets the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK bool KeepAliveTaskRunning () const
 Determines if the Keep alive task is currently running. More...
 
DB_EDGEVIS_SDK bool IdleTimeoutRunning () const
 Determines if the idle timeout is currently running. More...
 
DB_EDGEVIS_SDK void RegisterListener (IServiceListener *listener)
 Registers the specified listener to be notified when the service state changes. More...
 
DB_EDGEVIS_SDK void UnregisterListener (IServiceListener *listener)
 Removes the specified listener from the set of listeners to be notified about service state changes. More...
 
DB_EDGEVIS_SDK int64_t GetServiceUptime () const
 Retrieve the number of milliseconds since the service was started. More...
 

Member Function Documentation

DB_EDGEVIS_SDK std::wstring EdgeVisDecoderSDK::Service::ServiceName ( ) const

Gets the name of the Service.

Returns
The name of the Service.
void EdgeVisDecoderSDK::Service::UpdateState ( ServiceState  state,
std::wstring  user 
)

Updates the service's state.

This may occur after an operation such as connecting, disconnecting or using the service.

Parameters
stateThe service update state.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::Service::Started ( ) const

Determines whether the service has been started or not.

This only returns true if the service was started by the current application session.

Returns
True if the service has been started and is in use, false otherwise.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::Service::KeepAliveInterval ( ) const

Retrieves the keep alive interval for the service.

Returns
The keep alive interval in ms. -1 indicates that there is no keep alive interval for the service.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::Service::IdleTimeoutInterval ( ) const

Retrieves the idle timeout interval for the service.

Returns
The idle timeout interval in ms. -1 indicates that there is no idle timeout interval for the service.
DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Service::SetIdleTimeoutInterval ( int32_t  idleTimeout)

Sets the idle timeout interval for the service.

Parameters
idleTimeoutidle timeout interval in ms. Setting -1 indicates that there is no idle timeout interval for the service.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::Service::KeepAliveTaskRunning ( ) const

Determines if the Keep alive task is currently running.

Returns
True if running
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::Service::IdleTimeoutRunning ( ) const

Determines if the idle timeout is currently running.

Returns
True if running
DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Service::RegisterListener ( IServiceListener listener)

Registers the specified listener to be notified when the service state changes.

Parameters
listenerPointer to the listening object.
DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Service::UnregisterListener ( IServiceListener listener)

Removes the specified listener from the set of listeners to be notified about service state changes.

Parameters
listenerPointer to the listening object to remove.
DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Service::GetServiceUptime ( ) const

Retrieve the number of milliseconds since the service was started.

Returns
The number of milliseconds since the service was started. If the service is not started this will return 0.

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