VideoOS.Platform.EnvironmentManager Class Referenceabstract

The EnvironmentManager is the top class for the MIP Environment. The class can always be accessed though: EnvironmentManager.Instance As it is a singleton. More...

Public Types

enum  MessageReceiverHint { None , AvoidAsync }
 Gives a hint about how to call the message receiver method. More...
 

Public Member Functions

void ExceptionDialog (String nameOfClass, String where, Exception exception)
 Opens an ExceptionDialog to the user with a formatted layout of the exception itself.
 
void ExceptionDialog (String where, Exception exception)
 Opens an ExceptionDialog to the user with a formatted layout of the exception itself.
 
void ExceptionHandler (String nameOfClass, String where, Exception exception)
 Common exception handler. Logs the incident into the Log and opens the ExceptionDialog to the user.
 
void ExceptionHandler (String where, Exception exception)
 Common exception handler. Logs the incident into the Log and opens the ExceptionDialog to the user.
 
void FireEnvironmentOptionsChangedEvent ()
 Applications changing the EnvironmentOptions dictionary, should call this method.
 
virtual Item GetSiteItem (FQID fqid)
 Get the Item representing a specific site / island. The fqid is the id of a XProtect Management server.
 
virtual Item GetSiteItem (Guid id)
 Get the Item representing a specific site / island. The id is the id of a XProtect Management server.
 
virtual bool HasCapability (String capability)
 Can be used to check if the product supports a given capability Check EnvironmentCapabilities for available capabilities.
 
virtual void Log (bool error, String where, [Localizable(false)] String text)
 Logs a message.
 
virtual void Log (bool error, String where, [Localizable(false)] String text, object[] args)
 Logs a message.
 
virtual void Log (String nameOfClass, bool error, String where, [Localizable(false)] String text, object[] args)
 Logs a message in a Debug log.
 
virtual void PostMessage (Message message)
 Overloaded method if both destination and sender == null.
 
virtual void PostMessage (Message message, FQID destination)
 Overloaded message if sender == null.
 
void PostMessage (Message message, FQID destination, FQID sender)
 Post a Message. Similar method as SendMessage except that there is not result value.
 
object RegisterReceiver (MessageReceiver messageReceiver, MessageFilter messageFilter)
 Register a method to receive messages.
 
virtual object RegisterReceiver (MessageReceiver messageReceiver, MessageFilter messageFilter, MessageReceiverHint hint)
 Register a method to receive messages with a hint about how to launch the message.
 
virtual Collection< object > SendMessage (Message message)
 Overloaded method to be used if both destination and sender == null.
 
virtual Collection< object > SendMessage (Message message, FQID destination)
 Overloaded method to be used if sender==null.
 
Collection< object > SendMessage (Message message, FQID destination, FQID sender)
 Send a Message. All receivers will be called before the call returns. Message id's and formatted Data field are found in namespace VideoOS.Platform.Messaging for the Milestone defined messages.
 
void UnRegisterReceiver (object registeredReceiver)
 UnRegister a MessageReceiver.
 

Protected Member Functions

virtual void Init ()
 Initializes the environment.
 
virtual void Init (IDictionary< string, Color > brandColors)
 Initializes the environment.
 

Properties

virtual List< PluginDefinitionAllPluginDefinitions [get]
 Returns a list of all loaded MIP Plug-ins.
 
bool ApplicationLoggedOn [get]
 Indicate if the application is currently logged on.
 
virtual FQID CurrentSite [get]
 Get the Item that represent the server currently selected (May only be relevant for XProtect management client)
 
bool DebugLoggingEnabled = false [get, set]
 Tells whether debug logs (log commands with error == false) should be written to the log file. Default is false.
 
bool DebugTelemetryLoggingEnabled = false [get, set]
 Tells whether telemetry debug logs should be written to the log file. Default is false.
 
virtual bool EnableConfigurationChangedService [get, set]
 Set this if you want to receive the Messaging.MessageId.Server.ConfigurationChangedIndication messages. When this is true, a service will poll the plug-in configuration server every 60 second for changes and send the message if anything changed in plug-in configurations.
The message being sent is Messaging.MessageId.Server.ConfigurationChangedIndication, where the Message.RelatedFQID contains the top node of what was changed. Often you can just check if the Message.RelatedFQID.Kind matches one of your kinds.
 
virtual Dictionary< string, string > EnvironmentOptions [get]
 Used to control specific environment behavior. For dynamic options, call the FireEnvironmentOptionsChangedEvent method to let the system know it was changed.
 
virtual String EnvironmentProduct [get]
 Identifies the current product executing.
 
virtual EnvironmentType EnvironmentType [get]
 Identifies the current executing Environment.
 
static EnvironmentManager Instance [get, set]
 This Singleton item of this class. Only the 'get' access should be used.
 
virtual License.LicenseManager LicenseManager [get]
 Helps the plug-in with checking current use of licenses.
 
virtual String LoginAuthType [get, set]
 Defines the type of authentication stored in the LoginNetworkCredential property.
This property can be used to construct a credentialCache.
Values are defined in VideoOS.Platform.Login.AuthenticationType:
"Negotiate" for Active Directory, Windows and local system defined users
"Basic" for basic users
"External" for user defined on an external IDP, e.g. 3rd party OAuth service

 
virtual ICredentials LoginCredentialCache [get, set]
 The Credential cache for all types of authorizations.
Notice: Only valid in Smart Client from version 7.0b.
 
virtual NetworkCredential LoginNetworkCredential [get, set]
 The credential used when connecting with Windows, WindowsDefault or basic user authorization.
 
virtual FQID MasterSite [get]
 Get the Item that represent the server that was logged in to.
 
bool MeasureSendPostHandlers [get, set]
 Creates an ElapseTimer class and measures how much time each message handler is using. (Implemented for Event Server only in 2019 R3)
The MIP SDK Tray Manager can display the results.
 
List< String > MessageIdList [get]
 List of all known MessageIds. This includes all the message id's defined by the PlatformPlugin and environment as well as for all loaded plug-ins.

 
virtual Mode Mode [get, set]
 The Mode the environment is executing right now.
 
bool PluginInitializationInProgress [get, set]
 Identifies if the plugin load process in progress.
 
virtual bool SmartClientInOfflineMode [get, set]
 Determines if the Smart Client is executing after an export, and therefor is running in Offline mode. In Offline mode, it will not be possible to contact any servers for additional information. Make sure to export all relevant material during the Export process.
 
virtual string SmartClientOfflineDirectory [get, set]
 When Smart Client is running in offline mode, this property defines the root directory for the exported data.
 
virtual SystemLicense SystemLicense [get]
 SystemLicense contains general information about the license for the XProtect system.
 
bool TraceFunctionCalls [get, set]
 Set this bool if you like to have a line of trace written for all calls to all plug-ins. The trace lines are written to the respective debug logs for the environment.
 
bool TraceMessageCommunication [get, set]
 Set this bool if you like to have a lot of trace lines about how message communication works. The trace lines are written to the respective debug logs for the environment.
 
bool TracePlaybackDetails [get, set]
 Make deeper log entries for playback (MIPSDK 2016 - just for stand alone MIP Environment)
 
bool TraceSendDetails [get, set]
 Make deeper log entries for send message / post message (MIPSDK 2016 - just for stand alone MIP Environment)
 
static bool UsingUserContext [get, set]
 This field identifies if the current stand alone environment is using multi-user context.

 

Events

EventHandler EnvironmentOptionsChangedEvent
 This event is used for components that need to change behavior when an option has been modified.
 

Detailed Description

The EnvironmentManager is the top class for the MIP Environment. The class can always be accessed though: EnvironmentManager.Instance As it is a singleton.

The class has identification information of the current environment executing. When executing in XProtect Management Client, the Event Server and the Smart Client, the EnvironmentManager is created by the main application, while when executing in a stand-alone application, the SDK version of the EnvironmentManager needs to be instantiated by the standalone application.

Please check out the SDK instantiation notes for a complete description of SDK startup.

Member Enumeration Documentation

◆ MessageReceiverHint

Gives a hint about how to call the message receiver method.

Enumerator
None 

No hint at all, this is the default value.

AvoidAsync 

Indicates that the message receiver method shoud not be called in a new thread.

Member Function Documentation

◆ ExceptionDialog() [1/2]

void VideoOS.Platform.EnvironmentManager.ExceptionDialog ( String nameOfClass,
String where,
Exception exception )
abstract

Opens an ExceptionDialog to the user with a formatted layout of the exception itself.

Parameters
nameOfClassThe class being worked on, when the exception happened
whereWhere the Exception happened
exceptionThe Exception itself

◆ ExceptionDialog() [2/2]

void VideoOS.Platform.EnvironmentManager.ExceptionDialog ( String where,
Exception exception )
abstract

Opens an ExceptionDialog to the user with a formatted layout of the exception itself.

Parameters
whereWhere the Exception happened
exceptionThe Exception itself

◆ ExceptionHandler() [1/2]

void VideoOS.Platform.EnvironmentManager.ExceptionHandler ( String nameOfClass,
String where,
Exception exception )
abstract

Common exception handler. Logs the incident into the Log and opens the ExceptionDialog to the user.

Parameters
nameOfClassThe class being worked on, when the exception happened.
whereWhere the Exception happened
exceptionThe Exception itself

◆ ExceptionHandler() [2/2]

void VideoOS.Platform.EnvironmentManager.ExceptionHandler ( String where,
Exception exception )
abstract

Common exception handler. Logs the incident into the Log and opens the ExceptionDialog to the user.

Parameters
whereWhere the Exception happened
exceptionThe Exception itself

◆ FireEnvironmentOptionsChangedEvent()

void VideoOS.Platform.EnvironmentManager.FireEnvironmentOptionsChangedEvent ( )
inline

Applications changing the EnvironmentOptions dictionary, should call this method.

◆ GetSiteItem() [1/2]

virtual Item VideoOS.Platform.EnvironmentManager.GetSiteItem ( FQID fqid)
inlinevirtual

Get the Item representing a specific site / island. The fqid is the id of a XProtect Management server.

Parameters
fqid
Returns

◆ GetSiteItem() [2/2]

virtual Item VideoOS.Platform.EnvironmentManager.GetSiteItem ( Guid id)
inlinevirtual

Get the Item representing a specific site / island. The id is the id of a XProtect Management server.

Parameters
id
Returns

◆ HasCapability()

virtual bool VideoOS.Platform.EnvironmentManager.HasCapability ( String capability)
inlinevirtual

Can be used to check if the product supports a given capability Check EnvironmentCapabilities for available capabilities.

Supported from 2016

◆ Init() [1/2]

virtual void VideoOS.Platform.EnvironmentManager.Init ( )
inlineprotectedvirtual

Initializes the environment.

◆ Init() [2/2]

virtual void VideoOS.Platform.EnvironmentManager.Init ( IDictionary< string, Color > brandColors)
inlineprotectedvirtual

Initializes the environment.

◆ Log() [1/3]

virtual void VideoOS.Platform.EnvironmentManager.Log ( bool error,
String where,
[Localizable(false)] String text )
inlinevirtual

Logs a message.

Parameters
errorTrue if this is an error
whereWhere the this is coming from, provide class name and method
textThe message

◆ Log() [2/3]

virtual void VideoOS.Platform.EnvironmentManager.Log ( bool error,
String where,
[Localizable(false)] String text,
object[] args )
inlinevirtual

Logs a message.

Parameters
errorTrue if this is an error
whereWhere the this is coming from, provide class name and method
textThe message
argsAny relevant parameters

◆ Log() [3/3]

virtual void VideoOS.Platform.EnvironmentManager.Log ( String nameOfClass,
bool error,
String where,
[Localizable(false)] String text,
object[] args )
inlinevirtual

Logs a message in a Debug log.

Parameters
nameOfClassThe class being worked on.
errorTrue if this is an error
whereWhere the this is coming from
textThe message
argsAny relevant parameters

◆ PostMessage() [1/3]

virtual void VideoOS.Platform.EnvironmentManager.PostMessage ( Message message)
inlinevirtual

Overloaded method if both destination and sender == null.

Parameters
message

◆ PostMessage() [2/3]

virtual void VideoOS.Platform.EnvironmentManager.PostMessage ( Message message,
FQID destination )
inlinevirtual

Overloaded message if sender == null.

Parameters
message
destination

◆ PostMessage() [3/3]

void VideoOS.Platform.EnvironmentManager.PostMessage ( Message message,
FQID destination,
FQID sender )
abstract

Post a Message. Similar method as SendMessage except that there is not result value.

Parameters
messageThe message to send
destinationThe destination FQID, if relevant
senderThe sender, if known

◆ RegisterReceiver() [1/2]

object VideoOS.Platform.EnvironmentManager.RegisterReceiver ( MessageReceiver messageReceiver,
MessageFilter messageFilter )
abstract

Register a method to receive messages.

Parameters
messageReceiverThe method to be called
messageFilterThe filter to be used
Returns
The object to be used for UnRegister method

◆ RegisterReceiver() [2/2]

virtual object VideoOS.Platform.EnvironmentManager.RegisterReceiver ( MessageReceiver messageReceiver,
MessageFilter messageFilter,
MessageReceiverHint hint )
virtual

Register a method to receive messages with a hint about how to launch the message.

Parameters
messageReceiverThe method to be called
messageFilterThe filter to be used
hintHint to be used when calling the messageReceiver
Returns
The object to be used for UnRegister method

◆ SendMessage() [1/3]

virtual Collection< object > VideoOS.Platform.EnvironmentManager.SendMessage ( Message message)
inlinevirtual

Overloaded method to be used if both destination and sender == null.

Parameters
message
Returns

◆ SendMessage() [2/3]

virtual Collection< object > VideoOS.Platform.EnvironmentManager.SendMessage ( Message message,
FQID destination )
inlinevirtual

Overloaded method to be used if sender==null.

Parameters
message
destination
Returns

◆ SendMessage() [3/3]

Collection< object > VideoOS.Platform.EnvironmentManager.SendMessage ( Message message,
FQID destination,
FQID sender )
abstract

Send a Message. All receivers will be called before the call returns. Message id's and formatted Data field are found in namespace VideoOS.Platform.Messaging for the Milestone defined messages.

Parameters
messageThe message to send
destinationThe destination FQID, if relevant
senderThe sender, if known
Returns
A Collection of the result each receiver returns. null result are filtered off.

◆ UnRegisterReceiver()

void VideoOS.Platform.EnvironmentManager.UnRegisterReceiver ( object registeredReceiver)
abstract

UnRegister a MessageReceiver.

Parameters
registeredReceiverThe object returned from the RegisterReceiver call
Returns

Property Documentation

◆ AllPluginDefinitions

virtual List<PluginDefinition> VideoOS.Platform.EnvironmentManager.AllPluginDefinitions
get

Returns a list of all loaded MIP Plug-ins.

◆ ApplicationLoggedOn

bool VideoOS.Platform.EnvironmentManager.ApplicationLoggedOn
getabstract

Indicate if the application is currently logged on.

◆ CurrentSite

virtual FQID VideoOS.Platform.EnvironmentManager.CurrentSite
get

Get the Item that represent the server currently selected (May only be relevant for XProtect management client)

◆ DebugLoggingEnabled

bool VideoOS.Platform.EnvironmentManager.DebugLoggingEnabled = false
getset

Tells whether debug logs (log commands with error == false) should be written to the log file. Default is false.

Only affects standalone SDK.

◆ DebugTelemetryLoggingEnabled

bool VideoOS.Platform.EnvironmentManager.DebugTelemetryLoggingEnabled = false
getset

Tells whether telemetry debug logs should be written to the log file. Default is false.

Only affects standalone SDK.

◆ EnableConfigurationChangedService

virtual bool VideoOS.Platform.EnvironmentManager.EnableConfigurationChangedService
getset

Set this if you want to receive the Messaging.MessageId.Server.ConfigurationChangedIndication messages. When this is true, a service will poll the plug-in configuration server every 60 second for changes and send the message if anything changed in plug-in configurations.
The message being sent is Messaging.MessageId.Server.ConfigurationChangedIndication, where the Message.RelatedFQID contains the top node of what was changed. Often you can just check if the Message.RelatedFQID.Kind matches one of your kinds.

◆ EnvironmentOptions

virtual Dictionary<string, string> VideoOS.Platform.EnvironmentManager.EnvironmentOptions
get

Used to control specific environment behavior. For dynamic options, call the FireEnvironmentOptionsChangedEvent method to let the system know it was changed.

◆ EnvironmentProduct

virtual String VideoOS.Platform.EnvironmentManager.EnvironmentProduct
get

Identifies the current product executing.

◆ EnvironmentType

virtual EnvironmentType VideoOS.Platform.EnvironmentManager.EnvironmentType
get

Identifies the current executing Environment.

◆ Instance

EnvironmentManager VideoOS.Platform.EnvironmentManager.Instance
staticgetset

This Singleton item of this class. Only the 'get' access should be used.

◆ LicenseManager

virtual License.LicenseManager VideoOS.Platform.EnvironmentManager.LicenseManager
get

Helps the plug-in with checking current use of licenses.

◆ LoginAuthType

virtual String VideoOS.Platform.EnvironmentManager.LoginAuthType
getset

Defines the type of authentication stored in the LoginNetworkCredential property.
This property can be used to construct a credentialCache.
Values are defined in VideoOS.Platform.Login.AuthenticationType:
"Negotiate" for Active Directory, Windows and local system defined users
"Basic" for basic users
"External" for user defined on an external IDP, e.g. 3rd party OAuth service

◆ LoginCredentialCache

virtual ICredentials VideoOS.Platform.EnvironmentManager.LoginCredentialCache
getset

The Credential cache for all types of authorizations.
Notice: Only valid in Smart Client from version 7.0b.

◆ LoginNetworkCredential

virtual NetworkCredential VideoOS.Platform.EnvironmentManager.LoginNetworkCredential
getset

The credential used when connecting with Windows, WindowsDefault or basic user authorization.

NOTE: From 2022 R1, this property may be null when the user is using OAuth 2.0 tokens. Try always to use the LoginSettings class instead and check the IsOAuthIdentity == false, before using the NetworkCredential there.

◆ MasterSite

virtual FQID VideoOS.Platform.EnvironmentManager.MasterSite
get

Get the Item that represent the server that was logged in to.

◆ MeasureSendPostHandlers

bool VideoOS.Platform.EnvironmentManager.MeasureSendPostHandlers
getset

Creates an ElapseTimer class and measures how much time each message handler is using. (Implemented for Event Server only in 2019 R3)
The MIP SDK Tray Manager can display the results.

◆ MessageIdList

List<String> VideoOS.Platform.EnvironmentManager.MessageIdList
getabstract

List of all known MessageIds. This includes all the message id's defined by the PlatformPlugin and environment as well as for all loaded plug-ins.

A plug-in should add any plug-in defined messages to the plug-ins own PluginDefinition

◆ Mode

virtual Mode VideoOS.Platform.EnvironmentManager.Mode
getset

The Mode the environment is executing right now.

◆ PluginInitializationInProgress

bool VideoOS.Platform.EnvironmentManager.PluginInitializationInProgress
getset

Identifies if the plugin load process in progress.

◆ SmartClientInOfflineMode

virtual bool VideoOS.Platform.EnvironmentManager.SmartClientInOfflineMode
getset

Determines if the Smart Client is executing after an export, and therefor is running in Offline mode. In Offline mode, it will not be possible to contact any servers for additional information. Make sure to export all relevant material during the Export process.

◆ SmartClientOfflineDirectory

virtual string VideoOS.Platform.EnvironmentManager.SmartClientOfflineDirectory
getset

When Smart Client is running in offline mode, this property defines the root directory for the exported data.

◆ SystemLicense

virtual SystemLicense VideoOS.Platform.EnvironmentManager.SystemLicense
get

SystemLicense contains general information about the license for the XProtect system.

◆ TraceFunctionCalls

bool VideoOS.Platform.EnvironmentManager.TraceFunctionCalls
getsetabstract

Set this bool if you like to have a line of trace written for all calls to all plug-ins. The trace lines are written to the respective debug logs for the environment.

◆ TraceMessageCommunication

bool VideoOS.Platform.EnvironmentManager.TraceMessageCommunication
getset

Set this bool if you like to have a lot of trace lines about how message communication works. The trace lines are written to the respective debug logs for the environment.

◆ TracePlaybackDetails

bool VideoOS.Platform.EnvironmentManager.TracePlaybackDetails
getset

Make deeper log entries for playback (MIPSDK 2016 - just for stand alone MIP Environment)

◆ TraceSendDetails

bool VideoOS.Platform.EnvironmentManager.TraceSendDetails
getset

Make deeper log entries for send message / post message (MIPSDK 2016 - just for stand alone MIP Environment)

◆ UsingUserContext

bool VideoOS.Platform.EnvironmentManager.UsingUserContext
staticgetset

This field identifies if the current stand alone environment is using multi-user context.

Event Documentation

◆ EnvironmentOptionsChangedEvent

EventHandler VideoOS.Platform.EnvironmentManager.EnvironmentOptionsChangedEvent

This event is used for components that need to change behavior when an option has been modified.

Applications changing the EnvironmentOptions dictionary, should call the FireEnvironmentOptionsChangedEvent method.