Skip to content

Reference

OpcApplicationInstance<TTransport, TSecurity> Members

Represents the base class of an OPC UA application instance (e.g. a client or a server) using the transport and security settings of the types specified.

Reference

OpcApplicationInstance<TTransport, TSecurity> Members ​

Type
OpcApplicationInstance<TTransport, TSecurity>
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Constructors ​

OpcApplicationInstance ​

protected

Initializes a new instance of the OpcApplicationInstance<TTransport, TSecurity> class for an application of the type specified.

csharp
protected OpcApplicationInstance(OpcApplicationType type)
vbnet
Protected Sub New(type As OpcApplicationType)

Parameters

NameTypeDescription
typeOpcApplicationTypeThe type of the application.

Remarks

The constructor calls the abstract methods CreateTransport and CreateSecurity, so that an implementation in a derived class is called before the constructor of the derived class has run.

Properties ​

ApplicationName ​

virtual

Gets or sets the name of the application.

csharp
public virtual string ApplicationName { get; set; }
vbnet
Public Overridable Property ApplicationName As String

Property value

String

The name of the application. The default value is "OPC Application" in case there is no entry assembly available; otherwise the value of the AssemblyTitleAttribute of the entry assembly.

Implements

ApplicationName

Remarks

The name does not have to be unique. The value of this property is also used as the SubjectName of the application certificate whenever an application certificate is to be created/looked-up (from the application certificates store).

ApplicationUri ​

Gets or sets the URI of the application.

csharp
public Uri ApplicationUri { get; set; }
vbnet
Public Property ApplicationUri As Uri

Property value

Uri

The Uri or a null reference (Nothing in Visual Basic) which uniquely identifies the application instance.

Implements

ApplicationUri

Remarks

In case there the value of this property is a null reference (Nothing in Visual Basic) the URI of the application is determined by the subject alternate name of the application certificate used. In case there an application certificate is to be automatically created (if Certificate is unspecified and AutoCreateCertificate is equals true), this value is used to define the certificates subject alternate name.

If there exists already an application certificate the value of this property is replaced with the subject alternate name in the certificate. Nevertheless another URI has been manually configured.

Certificate ​

Gets or sets the application certificate representing the applications identity. Changing the application certificate using this property will change the PathType of the ApplicationStore to System.

csharp
public X509Certificate2 Certificate { get; set; }
vbnet
Public Property Certificate As X509Certificate2

Property value

X509Certificate2

An instance of the X509Certificate2 class used to identify the application instance.

Implements

Certificate

CertificateStores ​

Gets the OpcCertificateStores instance used to maintain the different certificate stores used by the server application.

csharp
public OpcCertificateStores CertificateStores { get; }
vbnet
Public ReadOnly Property CertificateStores As OpcCertificateStores

Property value

OpcCertificateStores

An instance of the OpcCertificateStores class used by the IOpcApplicationInstance to setup and maintain the certificate stores and their certificates used by the application.

Implements

CertificateStores

Configuration ​

virtual

Gets or sets an instance of the OpcApplicationConfiguration class which is used as a low-level representation of the code/file based application configuration.

csharp
[CLSCompliant(false)]
public virtual OpcApplicationConfiguration Configuration { get; set; }
vbnet
<CLSCompliant(False)>
Public Overridable Property Configuration As OpcApplicationConfiguration

Property value

OpcApplicationConfiguration

An instance of the OpcApplicationConfiguration class configured with the application specific setup to use. An assignment of a null reference (Nothing in Visual Basic) will lead to the creation of a new instance of the OpcApplicationConfiguration class with all defaults typically used by this type of applications.

Implements

Configuration

Namespaces ​

abstract · since v2.12

Gets a read-only collection of namespaces used by the application instance.

csharp
public abstract OpcReadOnlyNamespaceCollection Namespaces { get; }
vbnet
Public MustOverride ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection

Property value

OpcReadOnlyNamespaceCollection

An instance of the OpcReadOnlyNamespaceCollection class with OpcNamespace items for each 'NamespaceUri' known/used.

Implements

Namespaces

ProductUri ​

since v2.10

Gets or sets the URI of the product.

csharp
public Uri ProductUri { get; set; }
vbnet
Public Property ProductUri As Uri

Property value

Uri

The Uri or a null reference (Nothing in Visual Basic) which uniquely identifies the product.

Implements

ProductUri

Remarks

In case there the value of this property is a null reference (Nothing in Visual Basic) the URI of the product is determined by the AssemblyCompanyAttribute and AssemblyProductAttribute used.

Security ​

Gets the TSecurity instance used to maintain the different security options used by the application instance.

csharp
public TSecurity Security { get; }
vbnet
Public ReadOnly Property Security As TSecurity

Property value

TSecurity

An instance of the TSecurity class used by the application instance to setup and maintain the different security options.

SystemContext ​

abstract · since v2.11

Gets the OpcContext which is used to store the context sensitive data and configuration used by the current application instance.

csharp
public abstract OpcContext SystemContext { get; }
vbnet
Public MustOverride ReadOnly Property SystemContext As OpcContext

Property value

OpcContext

An instance of the OpcContext class which might be at least Empty.

Implements

SystemContext

Transport ​

Gets the TTransport instance used to maintain the different transport options used by the application instance.

csharp
public TTransport Transport { get; }
vbnet
Public ReadOnly Property Transport As TTransport

Property value

TTransport

An instance of the TTransport class used by the application instance to setup and maintain the different transport options.

Methods ​

ChangeApplicationState ​

protected · since v2.50

Changes the ApplicationState of this instance.

csharp
protected void ChangeApplicationState(OpcApplicationState newState)
vbnet
Protected Sub ChangeApplicationState(newState As OpcApplicationState)

Parameters

NameTypeDescription
newStateOpcApplicationStateThe new OpcApplicationState to change to.

Exceptions

ExceptionCondition
InvalidOperationExceptionThe Created is restricted as the initial state only.

CreateSecurity ​

protected · abstract

When implemented in a derived class; creates and initializes a new instance of the TSecurity which is used for the Security property.

csharp
protected abstract TSecurity CreateSecurity()
vbnet
Protected MustOverride Function CreateSecurity() As TSecurity

Returns

TSecurity

A new instance of the type specified by TSecurity.

CreateTransport ​

protected · abstract

When implemented in a derived class; creates and initializes a new instance of the TTransport which is used for the Transport property.

csharp
protected abstract TTransport CreateTransport()
vbnet
Protected MustOverride Function CreateTransport() As TTransport

Returns

TTransport

A new instance of the type specified by TTransport.

DenyIfIsDisposed ​

protected

Verifies whether the current IOpcApplicationInstance instance has been already disposed of. In the case there isDisposed is equals true an ObjectDisposedException will be thrown.

csharp
protected void DenyIfIsDisposed()
vbnet
Protected Sub DenyIfIsDisposed()

Exceptions

ExceptionCondition
ObjectDisposedExceptionThe object has been disposed of.

Dispose ​

2 overloads

OverloadDescription
Dispose()Releases all resources used by the IOpcApplicationInstance.
Dispose(bool)protected · virtualReleases the unmanaged resources used by the IOpcApplicationInstance and optionally releases the managed resources.

Dispose() ​

Releases all resources used by the IOpcApplicationInstance.

csharp
public void Dispose()
vbnet
Public Sub Dispose()

Implements

Dispose()

Dispose(bool) ​

protected · virtual

Releases the unmanaged resources used by the IOpcApplicationInstance and optionally releases the managed resources.

csharp
protected virtual void Dispose(bool disposing)
vbnet
Protected Overridable Sub Dispose(disposing As Boolean)

Parameters

NameTypeDescription
disposingBooleanThe value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources.

IsAddressSupported ​

static · 2 overloads

OverloadDescription
IsAddressSupported(string)staticDetermines if the address specified is supported.
IsAddressSupported(Uri)staticDetermines if the address specified is supported.

IsAddressSupported(string) ​

static

Determines if the address specified is supported.

csharp
public static bool IsAddressSupported(string address)
vbnet
Public Shared Function IsAddressSupported(address As String) As Boolean

Parameters

NameTypeDescription
addressStringA string representing the Uri to evaluate.

Returns

Boolean

The value true if the address is supported; otherwise the value false.

Remarks

The value of the address parameter can also be a null reference (Nothing in Visual Basic) or an empty string. In both cases the result will be false.

IsAddressSupported(Uri) ​

static

Determines if the address specified is supported.

csharp
public static bool IsAddressSupported(Uri address)
vbnet
Public Shared Function IsAddressSupported(address As Uri) As Boolean

Parameters

NameTypeDescription
addressUriThe Uri to evalatuate.

Returns

Boolean

The value true if the address is supported; otherwise the value false.

Remarks

The value the address parameter can be a null reference (Nothing in Visual Basic). In this case the result of the will be false.

OnCertificateRequested ​

protected · virtual

Raises the CertificateRequested event of the application instance.

csharp
protected virtual void OnCertificateRequested(
    OpcCertificateRequestedEventArgs e)
vbnet
Protected Overridable Sub OnCertificateRequested(
    e As OpcCertificateRequestedEventArgs)

Parameters

NameTypeDescription
eOpcCertificateRequestedEventArgsThe event data.

OnCertificateValidationFailed ​

protected · virtual

Raises the CertificateValidationFailed event of the application instance.

csharp
protected virtual void OnCertificateValidationFailed(
    OpcCertificateValidationFailedEventArgs e)
vbnet
Protected Overridable Sub OnCertificateValidationFailed(
    e As OpcCertificateValidationFailedEventArgs)

Parameters

NameTypeDescription
eOpcCertificateValidationFailedEventArgsThe event data.

Setup ​

protected · virtual

Prepares the configuration specified before the application connects to a server or starts: updates the application certificate (see CertificateRequested) and validates the configuration.

csharp
[CLSCompliant(false)]
protected virtual void Setup(OpcApplicationConfiguration configuration)
vbnet
<CLSCompliant(False)>
Protected Overridable Sub Setup(configuration As OpcApplicationConfiguration)

Parameters

NameTypeDescription
configurationOpcApplicationConfigurationThe configuration used to connect or to start.

Exceptions

ExceptionCondition
OpcExceptionThe application certificate could not be created or the configuration is invalid.

Events ​

CertificateRequested ​

Occurs when the certificate of this application instance could not automatically determined using the information of this application instance. This event is when used to query the certificate to use for the application instance. Additionally use this event to determine the case that an appropriate instance certificate is missing and in case there AutoCreateCertificate of CertificateStores is equals true a new certificate is being created automatically after the event has been processed (and this may take some time).

csharp
public event OpcCertificateRequestedEventHandler CertificateRequested
vbnet
Public Event CertificateRequested As OpcCertificateRequestedEventHandler

Event type

OpcCertificateRequestedEventHandler

Implements

CertificateRequested

Remarks

The event occurs when a server starts or a client connects, with one of the following Reason values:

A certificate which is not trusted yet does not raise the event; it is added to the TrustedPeerStore.

CertificateValidationFailed ​

Occurs when the validation of a opponent application instance certificate does not fulfill the requirements for valid and trusted certificates.

csharp
public event OpcCertificateValidationFailedEventHandler CertificateValidationFailed
vbnet
Public Event CertificateValidationFailed As OpcCertificateValidationFailedEventHandler

Event type

OpcCertificateValidationFailedEventHandler

Implements

CertificateValidationFailed

Remarks

This event can be used to complement the default validation of opponent application instance certificates. Using the event arguments it is possible to accept the certificate using different/custom circumstances.