VideoOS.Platform.SDK.Util.ServerMonitor Class Reference

A class to assist with information if a server is available or not. More...

Inheritance diagram for VideoOS.Platform.SDK.Util.ServerMonitor:

Public Member Functions

void Close ()
 Close background thread.
 
void Dispose ()
 Dispose internal resources.
 
void Init ()
 Initialize and start checking if connection is available.
 
 ServerMonitor (bool secureOnly, Uri uri, string username, SecureString password, bool adUser)
 Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.
 
 ServerMonitor (bool secureOnly, Uri uri, string username, string password, bool adUser)
 Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.
 
 ServerMonitor (Uri uri)
 Using this constructor will cause the ServerMonitor to use the already logged in user.
 
 ServerMonitor (Uri uri, string username, SecureString password, bool adUser)
 Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.
 
 ServerMonitor (Uri uri, string username, string password, bool adUser)
 Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.
 

Static Public Attributes

const int DefPollInterval = 15
 Default poll interval in seconds.
 
const int MinPollInterval = 5
 Minimum allowed poll interval in seconds.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Dispose internal resources.
 

Properties

bool IsConnected [get, set]
 Identifies if the server is available for login.
 
Exception LastException [get]
 Any exception occurred during the check is stored in this property.
 
int PollInterval [get, set]
 The pause interval between checks. The default value is DefPollInterval. The minimum allowed is MinPollInterval. Note that when server is down, additional time between checks occur depending on various timeouts on the network.
 
bool Running [get]
 Tells if this check function in this class is running.
 
ServerId ServerId [get]
 Provides the ID of the server being monitored.
 
Uri Uri [get]
 The URI as provided during initialization, possibly modified to be correct.
 

Events

ConnectionStateChangedEventHandler ConnectionStateChangedEvent
 You can register on this event, if you need to know when the session to the Event Server is changing.
When receiving the event call, check the IsConnected property for the actual state.
 

Detailed Description

A class to assist with information if a server is available or not.

This class does not add the server into the different environments, but simply informs if it is available.

Constructor & Destructor Documentation

◆ ServerMonitor() [1/5]

VideoOS.Platform.SDK.Util.ServerMonitor.ServerMonitor ( Uri uri)
inline

Using this constructor will cause the ServerMonitor to use the already logged in user.

Note: For this constructor to work, EnvironmentManager.LoginNetworkCredential and EnvironmentManager.LoginAuthType properties must be set on EnvironmentManager.Instance.

Parameters
uriURI of the server to monitor
Exceptions
InvalidCredentialsMIPExceptionNo valid login session was found

◆ ServerMonitor() [2/5]

VideoOS.Platform.SDK.Util.ServerMonitor.ServerMonitor ( Uri uri,
string username,
string password,
bool adUser )
inline

Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.

Exception LastException
Any exception occurred during the check is stored in this property.
Definition ServerMonitor.cs:282

property.
Please consider using the more secure version using SecureString for the password instead.

Parameters
uriURI of the server to monitor
usernameUser name - must be valid on the server
passwordPassword
adUserSet to false if provided user is a Basic user, otherwise set to true

◆ ServerMonitor() [3/5]

VideoOS.Platform.SDK.Util.ServerMonitor.ServerMonitor ( bool secureOnly,
Uri uri,
string username,
string password,
bool adUser )
inline

Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.

property.
Please consider using the more secure version using SecureString for the password instead.

Parameters
secureOnlyIf true, only authentication over https is accepted. Can only be used for server versions 2021 R1 or newer. If false, authentication over both http and https is accepted. Can be used for any server version.
uriURI of the server to monitor
usernameUser name - must be valid on the server
passwordPassword
adUserSet to false if provided user is a Basic user, otherwise set to true

◆ ServerMonitor() [4/5]

VideoOS.Platform.SDK.Util.ServerMonitor.ServerMonitor ( Uri uri,
string username,
SecureString password,
bool adUser )
inline

Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.

property.

Parameters
uriURI of the server to monitor
usernameUser name - must be valid on the server
passwordPassword
adUserSet to false if provided user is a Basic user, otherwise set to true

◆ ServerMonitor() [5/5]

VideoOS.Platform.SDK.Util.ServerMonitor.ServerMonitor ( bool secureOnly,
Uri uri,
string username,
SecureString password,
bool adUser )
inline

Constructor for creating a monitor using its own login session. If incorrect credentials are provided the monitor will report the server as not connected and further information can be found in the.

property.

Parameters
secureOnlyIf true, only authentication over https is accepted. Can only be used for server versions 2021 R1 or newer. If false, authentication over both http and https is accepted. Can be used for any server version.
uriURI of the server to monitor
usernameUser name - must be valid on the server
passwordPassword
adUserSet to false if provided user is a Basic user, otherwise set to true

Member Function Documentation

◆ Close()

void VideoOS.Platform.SDK.Util.ServerMonitor.Close ( )
inline

Close background thread.

◆ Dispose() [1/2]

void VideoOS.Platform.SDK.Util.ServerMonitor.Dispose ( )
inline

Dispose internal resources.

◆ Dispose() [2/2]

virtual void VideoOS.Platform.SDK.Util.ServerMonitor.Dispose ( bool disposing)
inlineprotectedvirtual

Dispose internal resources.

◆ Init()

void VideoOS.Platform.SDK.Util.ServerMonitor.Init ( )
inline

Initialize and start checking if connection is available.

Member Data Documentation

◆ DefPollInterval

const int VideoOS.Platform.SDK.Util.ServerMonitor.DefPollInterval = 15
static

Default poll interval in seconds.

◆ MinPollInterval

const int VideoOS.Platform.SDK.Util.ServerMonitor.MinPollInterval = 5
static

Minimum allowed poll interval in seconds.

Property Documentation

◆ IsConnected

bool VideoOS.Platform.SDK.Util.ServerMonitor.IsConnected
getset

Identifies if the server is available for login.

◆ LastException

Exception VideoOS.Platform.SDK.Util.ServerMonitor.LastException
get

Any exception occurred during the check is stored in this property.

◆ PollInterval

int VideoOS.Platform.SDK.Util.ServerMonitor.PollInterval
getset

The pause interval between checks. The default value is DefPollInterval. The minimum allowed is MinPollInterval. Note that when server is down, additional time between checks occur depending on various timeouts on the network.

◆ Running

bool VideoOS.Platform.SDK.Util.ServerMonitor.Running
get

Tells if this check function in this class is running.

◆ ServerId

ServerId VideoOS.Platform.SDK.Util.ServerMonitor.ServerId
get

Provides the ID of the server being monitored.

◆ Uri

Uri VideoOS.Platform.SDK.Util.ServerMonitor.Uri
get

The URI as provided during initialization, possibly modified to be correct.

Event Documentation

◆ ConnectionStateChangedEvent

ConnectionStateChangedEventHandler VideoOS.Platform.SDK.Util.ServerMonitor.ConnectionStateChangedEvent

You can register on this event, if you need to know when the session to the Event Server is changing.
When receiving the event call, check the IsConnected property for the actual state.