.NET Based OPC UA Client/Server SDK  3.3.3.537
UnifiedAutomation.UaBase.ApplicationInstance Class Reference

Represents an instance of a UA application. More...

Inherits UnifiedAutomation.UaBase.ApplicationInstanceBase.

Classes

class  BuiltInCommands
 The built-in command line parameters. More...
 
class  CommandDescription
 Stores the description of a command. More...
 
class  WindowsService
 Manages the interface between the UA server and the Windows SCM. More...
 

Public Member Functions

 ApplicationInstance ()
 
override void Start (ServerBase server, WaitCallback callback, object userData, bool silent=false)
 Starts the application. More...
 
override void LoadConfiguration (bool silent, bool isServer)
 Loads the configuration. More...
 
void Install ()
 Installs the application. More...
 
void Uninstall ()
 Uninstalls the application. More...
 
void Install (bool silent)
 Installs the application. More...
 
void Uninstall (bool silent)
 Uninstalls the application. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaBase.ApplicationInstanceBase
 ApplicationInstanceBase ()
 Creates an instance of ApplicationInstanceBase. More...
 
ICertificateValidator FindCertificateValidator (string endpointUrl)
 Finds the certificate validator for the specified endpoint. More...
 
void UpdateCertificateValidator (string endpointUrl, ICertificateValidator validator)
 Updates the certificate validator associated with the endpoint. More...
 
void ChangeCertificate (ICertificate oldCertificate, ICertificate newCertificate)
 Changes the certificate. More...
 
MessageContext GetServerMessageContext ()
 Create a new message context for the server. More...
 
StatusCode GetEndpointStatus (EndpointDescription endpoint)
 Gets the endpoint status. More...
 
void SetEndpointStatus (EndpointDescription endpoint, StatusCode status)
 Sets the endpoint status. More...
 
virtual void SetApplicationSettings (UaSchema.IConfiguration settings)
 Sets the application settings. More...
 
GetConfigurationExtension< T > (bool silent, XmlQualifiedName elementName=null)
 Parses the extension. More...
 
void SetConfigurationExtension< T > (T extension)
 Updates the extension. More...
 
virtual void ValidateCertificate (ICertificate certificate)
 Verifies the certificate. More...
 
void ValidateCertificate (ICertificate certificate, string applicationUri, string endpointUrl)
 Verifies the certificate. More...
 
virtual void AddCertificateToTrustList (ICertificate certificate)
 Adds the certificate to trust list. More...
 
void Start ()
 Starts the application. More...
 
void Start (WaitCallback callback, object userData)
 Starts the application. More...
 
virtual void CreateCertificateGroups ()
 Creates the certificate groups that appear in the ServerConfiguration object. More...
 
virtual void SaveConfiguration (bool silent)
 Saves the configuration. More...
 

Protected Member Functions

void ParseCommandLine (bool ignoreUnknownArguments)
 Parses the command line. More...
 
virtual string ValidateArguments (bool ignoreUnknownArguments, Dictionary< string, string > args)
 Validates the arguments. More...
 
virtual CommandDescription[] GetCommandDescriptions ()
 Gets the descriptions for the supported command line arguments. More...
 
virtual string GetHelpString (CommandDescription[] commands)
 Gets the help string for the command line parameters. More...
 
virtual bool ProcessCommand (bool silent, Dictionary< string, string > args)
 Processes the command. More...
 
virtual void StartWindowsService (ServerBase server, ApplicationInstanceBase application, WaitCallback callback, object userData)
 Starts a new instance of the WindowsService class as a service. To add more service features like OnSessionChange events, create new classes which inherit from ApplicationInstance and the nested WindowsService class. Override the StartWindowsService method which will be started within ApplicationInstance.Start, and call ServiceBase.Run(ServiceBase) with your new WindowsService class. More...
 
override void ApplicationInDemoMode (ApplicationLicense license)
 
override void CreateDefaultSecurityProvider ()
 
virtual void ExchangeLdsCertificates ()
 Adds a copy of the application certificate to the trusted store of the local discovery server and adds a copy of the lds certificate to the trusted store of the application. More...
 
virtual void PreInstallProcessing (bool silent, UaSchema.InstallationSettings settings)
 Does any pre-install processing. More...
 
virtual void PostInstallProcessing (bool silent, UaSchema.InstallationSettings settings)
 Does any post-install processing. More...
 
ICertificateStore FindTrustedStoreForLDS ()
 Finds the trusted store for LDS. More...
 
ICertificate FindCertificateForLDS ()
 Finds the certificate for LDS. More...
 
virtual void InstallService (bool silent, UaSchema.InstallationSettings settings)
 Installs the service. More...
 
virtual List< AccessRuleGetAccessRules (UaSchema.InstallationSettings settings)
 Gets the access rules. More...
 
virtual void SetFilePermissions (bool silent, UaSchema.InstallationSettings settings)
 Sets the file permissions. More...
 
virtual void OpenFirewallPorts (UaSchema.InstallationSettings settings)
 Empty virtual method called during the /install command if set in InstallationSettings. More...
 
virtual void CloseFirewallPorts (UaSchema.InstallationSettings settings)
 Empty virtual method called during the /uninstall command if set in InstallationSettings. More...
 
virtual void CreateHttpsBindings (UaSchema.InstallationSettings settings)
 Creates the HTTPS bindings. Called during the /install command. More...
 
virtual void DeleteHttpsBindings (UaSchema.InstallationSettings settings)
 Deletes the HTTPS bindings. Called during the /uninstall command. More...
 
virtual void RemoveCertificateFromLds ()
 Removes the application certificate from the trusted store of the local discovery server. More...
 
virtual void PreUninstallProcessing (bool silent, UaSchema.InstallationSettings settings)
 Does any pre-uninstall processing. More...
 
virtual void PostUninstallProcessing (bool silent, UaSchema.InstallationSettings settings)
 Does any post-uninstall processing. More...
 
virtual void UninstallService (bool silent, UaSchema.InstallationSettings settings)
 Uninstalls the service. More...
 
- Protected Member Functions inherited from UnifiedAutomation.UaBase.ApplicationInstanceBase
virtual void CreateDefaultProtocolFactory ()
 Creates the default security provider. More...
 
void CallApplicationSettingsLoaded ()
 Calls the ApplicationSettingsLoaded event handler if set. More...
 
virtual void ChangesCompleted ()
 
void StartGdsHandlerIfConfigured ()
 Calls GdsHandler.Start if not null and configured More...
 
string GetDefaultOrganisationName ()
 Gets the default organization name of the product. More...
 
virtual bool CheckConfiguration (bool silent)
 Checks the configuration. More...
 
virtual void CreateReverseConnect ()
 Creates a new instance of the ReverseConnect manager More...
 
EndpointDescription GetEndpointDescription (string endpointUrl, UaSchema.EndpointConfiguration configuration, string securityProfileUri, MessageSecurityMode securityMode, ApplicationDescription application)
 Gets the endpoint description. More...
 
void ApplyTraceSettings ()
 Applies the trace settings found in the ApplicationSettings. More...
 
bool LoadConfigurationFromFile (string filePath, bool silent)
 Loads the configuration from file. More...
 
bool LoadConfigurationFromResource (bool silent)
 Loads the configuration from embedded resource. More...
 
virtual void LoadDefaultConfiguration (bool isServer)
 Creates the default application settings. More...
 

Properties

Dictionary< string, string > CommandLine [get]
 Gets the command line parameters passed to the process. More...
 
static new ApplicationInstance Default [get]
 Gets the default ApplicationInstanceBase for the process. More...
 
bool NoAutoStartService [get, set]
 Gets or sets a value indicating whether a Windows service should be automatically started if the EXE was started by a non-interactive user. More...
 
bool DisableCommandLineProcessing [get, set]
 Gets or sets a value indicating whether that the SDK should NOT attempt to interpret the command line when it is initialize. More...
 
- Properties inherited from UnifiedAutomation.UaBase.ApplicationInstanceBase
static ApplicationInstanceBase Default [get]
 Gets the default ApplicationInstanceBase for the process. More...
 
string ApplicationName [get, set]
 Gets or sets the name of the application. More...
 
string ApplicationUri [get, set]
 Gets or sets the application URI. More...
 
ApplicationType ApplicationType [get, set]
 Gets or sets the type of the application. More...
 
string ProductUri [get, set]
 Gets or sets the product URI. More...
 
string ProductVersion [get, set]
 Gets or sets the product version. More...
 
IProtocolFactory ProtocolFactory [get, set]
 Get the object that provides access to protocols used by the application. More...
 
ISecurityProvider SecurityProvider [get, set]
 Get the object that provides access to cryptography services used by the application. More...
 
ICertificate ApplicationCertificate [get, set]
 Gets or sets the application certificate. More...
 
ICertificateStore TrustedStore [get, set]
 Gets or sets the trusted store. More...
 
ICertificateStore IssuerStore [get, set]
 Gets or sets the issuer store. More...
 
ICertificateStore RejectedStore [get, set]
 Gets or sets the rejected store. More...
 
ICertificateValidator CertificateValidator [get, set]
 Gets or sets the certificate validator. More...
 
EncodeableFactory KnownTypeFactory [get, set]
 Gets or sets the known type factory. More...
 
EndpointConfiguration DefaultEndpointConfiguration [get, set]
 Gets or sets the default endpoint configuration. More...
 
ApplicationThreadPool ThreadPool [get, set]
 Gets or sets the thread pool used by the application. More...
 
IList< CertificateGroupCertificateGroups [get]
 Gets the certificate groups used to manage configuration of certificates and trust lists. More...
 
ReverseConnectManager ReverseConnectManager [get]
 Gets the ReverseConnect manager for client applications More...
 
IGlobalDiscoveryService GdsHandler [get, set]
 Starts the Gds interaction if not null on Start. More...
 
IList< EndpointDescriptionEndpoints [get, set]
 Gets or sets the endpoints. More...
 
bool IsStarted [get, protected set]
 Gets a value indicating whether this instance is started. More...
 
bool AutoCreateCertificate [get, set]
 Gets or sets a value indicating whether the certificate should be automatically created. More...
 
bool SuppressErrorReporting [get, set]
 
UaSchema.IConfiguration ApplicationSettings [get, protected set]
 Gets the application settings. More...
 
string ConfigurationFilePath [get, set]
 Gets or sets the configuration file path. More...
 
string EmbeddedConfigurationAssemblyName [get, set]
 Gets or sets the name of the assembly which has the embedded resource containing the default configuration file. More...
 
bool ConfigurationDirty [get, set]
 
bool ConfigurationLoaded [get, set]
 

Additional Inherited Members

- Events inherited from UnifiedAutomation.UaBase.ApplicationInstanceBase
CreateCertificateEventHandler MissingApplicationCertificate
 Occurs when the application certificate is missing. More...
 
UntrustedCertificateEventHandler UntrustedCertificate
 Occurs when an untrusted certificate is encountered. More...
 
EventHandler ConfigurationChanged
 Occurs if the configuration has changed and needs to be persisted. More...
 
EventHandler ApplicationSettingsLoaded
 Occurs after ApplicationSettings are loaded. Can be used to update ApplicationSettings in code. More...
 

Detailed Description

Represents an instance of a UA application.

Member Function Documentation

virtual void UnifiedAutomation.UaBase.ApplicationInstance.CloseFirewallPorts ( UaSchema.InstallationSettings  settings)
protectedvirtual

Empty virtual method called during the /uninstall command if set in InstallationSettings.

Developers can override the method to close the firewall configuration for there application.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.CreateHttpsBindings ( UaSchema.InstallationSettings  settings)
protectedvirtual

Creates the HTTPS bindings. Called during the /install command.

All HTTPS addresses are bound to all IP address using the HTTPS certificate in the InstallationSettings. Developers can override the method if they need something different.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.DeleteHttpsBindings ( UaSchema.InstallationSettings  settings)
protectedvirtual

Deletes the HTTPS bindings. Called during the /uninstall command.

All HTTPS addresses are unbound from all IP addresses. Developers can override the method if they need something different.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.ExchangeLdsCertificates ( )
protectedvirtual

Adds a copy of the application certificate to the trusted store of the local discovery server and adds a copy of the lds certificate to the trusted store of the application.

ICertificate UnifiedAutomation.UaBase.ApplicationInstance.FindCertificateForLDS ( )
protected

Finds the certificate for LDS.

Returns
ICertificateStore UnifiedAutomation.UaBase.ApplicationInstance.FindTrustedStoreForLDS ( )
protected

Finds the trusted store for LDS.

Returns
virtual List<AccessRule> UnifiedAutomation.UaBase.ApplicationInstance.GetAccessRules ( UaSchema.InstallationSettings  settings)
protectedvirtual

Gets the access rules.

Parameters
settingsThe settings.
Returns
The access rules to use when setting file permissions.
virtual CommandDescription [] UnifiedAutomation.UaBase.ApplicationInstance.GetCommandDescriptions ( )
protectedvirtual

Gets the descriptions for the supported command line arguments.

Returns
A list of descriptions for the supported command line arguments.
virtual string UnifiedAutomation.UaBase.ApplicationInstance.GetHelpString ( CommandDescription[]  commands)
protectedvirtual

Gets the help string for the command line parameters.

Parameters
commandsThe descriptions for the supported arguments.
Returns
Formatted help text that can be displayed in a console.
void UnifiedAutomation.UaBase.ApplicationInstance.Install ( )

Installs the application.

void UnifiedAutomation.UaBase.ApplicationInstance.Install ( bool  silent)

Installs the application.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.InstallService ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Installs the service.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
override void UnifiedAutomation.UaBase.ApplicationInstance.LoadConfiguration ( bool  silent,
bool  isServer 
)
virtual

Loads the configuration.

Parameters
silentif set to true then no exceptions will be thrown.
isServerif set to true the application is a server.

Reimplemented from UnifiedAutomation.UaBase.ApplicationInstanceBase.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.OpenFirewallPorts ( UaSchema.InstallationSettings  settings)
protectedvirtual

Empty virtual method called during the /install command if set in InstallationSettings.

Developers can override the method to open the firewall configuration for there application.

void UnifiedAutomation.UaBase.ApplicationInstance.ParseCommandLine ( bool  ignoreUnknownArguments)
protected

Parses the command line.

Parameters
ignoreUnknownArgumentsif set to true unknown arguments are ignored.
virtual void UnifiedAutomation.UaBase.ApplicationInstance.PostInstallProcessing ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Does any post-install processing.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
virtual void UnifiedAutomation.UaBase.ApplicationInstance.PostUninstallProcessing ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Does any post-uninstall processing.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
virtual void UnifiedAutomation.UaBase.ApplicationInstance.PreInstallProcessing ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Does any pre-install processing.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
virtual void UnifiedAutomation.UaBase.ApplicationInstance.PreUninstallProcessing ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Does any pre-uninstall processing.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
virtual bool UnifiedAutomation.UaBase.ApplicationInstance.ProcessCommand ( bool  silent,
Dictionary< string, string >  args 
)
protectedvirtual

Processes the command.

Parameters
silentif set to true no dialogs such be displayed.
argsAdditional arguments provided on the command line.
Returns
True if the command was processed.
virtual void UnifiedAutomation.UaBase.ApplicationInstance.RemoveCertificateFromLds ( )
protectedvirtual

Removes the application certificate from the trusted store of the local discovery server.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.SetFilePermissions ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Sets the file permissions.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
override void UnifiedAutomation.UaBase.ApplicationInstance.Start ( ServerBase  server,
WaitCallback  callback,
object  userData,
bool  silent = false 
)
virtual

Starts the application.

Parameters
serverThe server.
callbackThe method to call when initialization is complete.
userDataThe user data to be passed to the callback.
silent

Reimplemented from UnifiedAutomation.UaBase.ApplicationInstanceBase.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.StartWindowsService ( ServerBase  server,
ApplicationInstanceBase  application,
WaitCallback  callback,
object  userData 
)
protectedvirtual

Starts a new instance of the WindowsService class as a service. To add more service features like OnSessionChange events, create new classes which inherit from ApplicationInstance and the nested WindowsService class. Override the StartWindowsService method which will be started within ApplicationInstance.Start, and call ServiceBase.Run(ServiceBase) with your new WindowsService class.

Parameters
serverThe server.
applicationThe application.
callbackThe callback.
userDataThe user data.
void UnifiedAutomation.UaBase.ApplicationInstance.Uninstall ( )

Uninstalls the application.

void UnifiedAutomation.UaBase.ApplicationInstance.Uninstall ( bool  silent)

Uninstalls the application.

virtual void UnifiedAutomation.UaBase.ApplicationInstance.UninstallService ( bool  silent,
UaSchema.InstallationSettings  settings 
)
protectedvirtual

Uninstalls the service.

Parameters
silentDo not throw exceptions if TRUE.
settingsThe settings.
virtual string UnifiedAutomation.UaBase.ApplicationInstance.ValidateArguments ( bool  ignoreUnknownArguments,
Dictionary< string, string >  args 
)
protectedvirtual

Validates the arguments.

Parameters
ignoreUnknownArgumentsif set to true unknown arguments are ignored.
argsThe arguments passed on the command line.
Returns
Returns an error string. Null if no error occurs.

Property Documentation

Dictionary<string, string> UnifiedAutomation.UaBase.ApplicationInstance.CommandLine
getprotected

Gets the command line parameters passed to the process.

new ApplicationInstance UnifiedAutomation.UaBase.ApplicationInstance.Default
staticget

Gets the default ApplicationInstanceBase for the process.

bool UnifiedAutomation.UaBase.ApplicationInstance.DisableCommandLineProcessing
getset

Gets or sets a value indicating whether that the SDK should NOT attempt to interpret the command line when it is initialize.

true if the SDK should NOT attempt to interpret command line options; otherwise, false.

bool UnifiedAutomation.UaBase.ApplicationInstance.NoAutoStartService
getset

Gets or sets a value indicating whether a Windows service should be automatically started if the EXE was started by a non-interactive user.

true if a Windows service should NOT be automatically started if the EXE was started by a non-interactive user; otherwise, false.


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