C# Класс Opc.Ua.ServerBase

A base class for a UA server implementation.
Наследование: IServerBase, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

Frees any unmanaged resources.

GetEndpoints ( ) : EndpointDescriptionCollection

Returns the endpoints supported by the server.

RequireEncryption ( EndpointDescription description ) : bool

Specifies if the server requires encryption; if so the server needs to send its certificate to the clients and validate the client certificates

ScheduleIncomingRequest ( IEndpointIncomingRequest request ) : void

Schedules an incoming request.

ServerBase ( ) : System

Initializes object with default values.

Start ( ApplicationConfiguration configuration ) : ServiceHost

Starts the server (called from a IIS host process).

Start ( ApplicationConfiguration configuration ) : void

Starts the server (called from a dedicated host process).

Защищенные методы

Метод Описание
CreateHttpsServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, List securityPolicies ) : List

Create a new service host for UA HTTPS.

CreateResponse ( RequestHeader requestHeader, Exception exception ) : ResponseHeader

Creates the response header.

CreateResponse ( RequestHeader requestHeader, StringTable stringTable ) : ResponseHeader

Creates the response header.

CreateResponse ( RequestHeader requestHeader, uint statusCode ) : ResponseHeader

Creates the response header.

CreateServiceHost ( ServerBase server ) : ServiceHost

Creates an instance of the service host.

CreateSinglePolicyServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, MessageSecurityMode securityMode, string securityPolicyUri, string basePath ) : List

Create a new service host for protocols that support only one policy per host.

CreateUaTcpServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, List securityPolicies ) : List

Create a new service host for UA TCP.

Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

FilterByEndpointUrl ( Uri endpointUrl, IList baseAddresses ) : IList

Filters the list of addresses by the URL that the client provided.

FilterByProfile ( StringCollection profileUris, IList baseAddresses ) : IList

Filters the list of addresses by profile.

GetDiscoveryUrls ( ) : StringCollection

Returns the discovery URLs for the server.

GetEndpointInstance ( ServerBase server ) : EndpointBase

Returns an instance of the endpoint to use.

GetServiceContract ( ) : Type

Returns the service contract to use.

GetUserTokenPolicies ( ApplicationConfiguration configuration, EndpointDescription description ) : UserTokenPolicyCollection

Returns the UserTokenPolicies supported by the server.

InitializeRequestQueue ( ApplicationConfiguration configuration ) : void

Initializes the request queue.

InitializeServiceHosts ( ApplicationConfiguration configuration, BindingFactory bindingFactory, ApplicationDescription &serverDescription, EndpointDescriptionCollection &endpoints ) : IList

Creates the endpoints and creates the hosts.

LoadServerProperties ( ) : ServerProperties

Returns the properties for associated with the server instance.

NormalizeHostname ( string hostname ) : string

Checks for IP address or well known hostnames that map to the computer.

OnServerStarting ( ApplicationConfiguration configuration ) : void

Called before the server starts.

OnServerStopping ( ) : void

Called before the server stops

OnUpdateConfiguration ( ApplicationConfiguration configuration ) : void

Called when the server configuration is changed on disk.

Servers are free to ignore changes if it is difficult/impossible to apply them without a restart.

ProcessRequest ( IEndpointIncomingRequest request, object calldata ) : void

Processes the request.

StartApplication ( ApplicationConfiguration configuration ) : void

Starts the server application.

TranslateApplicationDescription ( Uri clientUrl, ApplicationDescription description, IList baseAddresses, Opc.Ua.LocalizedText applicationName ) : ApplicationDescription

Translates the discovery URLs based on the client url and returns an updated ApplicationDescription.

TranslateEndpointDescriptions ( Uri clientUrl, IList baseAddresses, IList endpoints, ApplicationDescription application ) : EndpointDescriptionCollection

Translates the endpoint descriptions based on the client url and profiles provided.

ValidateRequest ( RequestHeader requestHeader ) : void

Verifies that the request header is valid.

Приватные методы

Метод Описание
GetBestDiscoveryUrl ( Uri clientUrl, BaseAddress baseAddress ) : string

Returns the best discovery URL for the base address based on the URL used by the client.

InitializeBaseAddresses ( ApplicationConfiguration configuration ) : void

Initializes the list of base addresses.

Stop ( ) : void

Описание методов

CreateHttpsServiceHost() защищенный Метод

Create a new service host for UA HTTPS.
protected CreateHttpsServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, List securityPolicies ) : List
hosts ServiceHost>.IDictionary
configuration ApplicationConfiguration
bindingFactory BindingFactory
baseAddresses IList
serverDescription ApplicationDescription
securityPolicies List
Результат List

CreateResponse() защищенный Метод

Creates the response header.
protected CreateResponse ( RequestHeader requestHeader, Exception exception ) : ResponseHeader
requestHeader RequestHeader The object that contains description for the RequestHeader DataType.
exception System.Exception The exception used to create DiagnosticInfo assigned to the ServiceDiagnostics.
Результат ResponseHeader

CreateResponse() защищенный Метод

Creates the response header.
protected CreateResponse ( RequestHeader requestHeader, StringTable stringTable ) : ResponseHeader
requestHeader RequestHeader The object that contains description for the RequestHeader DataType.
stringTable StringTable The thread safe table of string constants.
Результат ResponseHeader

CreateResponse() защищенный Метод

Creates the response header.
If statusCode is bad.
protected CreateResponse ( RequestHeader requestHeader, uint statusCode ) : ResponseHeader
requestHeader RequestHeader The object that contains description for the RequestHeader DataType.
statusCode uint The status code.
Результат ResponseHeader

CreateServiceHost() защищенный Метод

Creates an instance of the service host.
protected CreateServiceHost ( ServerBase server ) : ServiceHost
server ServerBase
Результат ServiceHost

CreateSinglePolicyServiceHost() защищенный Метод

Create a new service host for protocols that support only one policy per host.
protected CreateSinglePolicyServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, MessageSecurityMode securityMode, string securityPolicyUri, string basePath ) : List
hosts ServiceHost>.IDictionary The hosts.
configuration ApplicationConfiguration The configuration.
bindingFactory BindingFactory The binding factory.
baseAddresses IList The base addresses.
serverDescription ApplicationDescription The server description.
securityMode MessageSecurityMode The security mode.
securityPolicyUri string The security policy URI.
basePath string The base path to use when constructing the hosts.
Результат List

CreateUaTcpServiceHost() защищенный Метод

Create a new service host for UA TCP.
protected CreateUaTcpServiceHost ( ServiceHost>.IDictionary hosts, ApplicationConfiguration configuration, BindingFactory bindingFactory, IList baseAddresses, ApplicationDescription serverDescription, List securityPolicies ) : List
hosts ServiceHost>.IDictionary
configuration ApplicationConfiguration
bindingFactory BindingFactory
baseAddresses IList
serverDescription ApplicationDescription
securityPolicies List
Результат List

Dispose() публичный Метод

Frees any unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

FilterByEndpointUrl() защищенный Метод

Filters the list of addresses by the URL that the client provided.
protected FilterByEndpointUrl ( Uri endpointUrl, IList baseAddresses ) : IList
endpointUrl System.Uri
baseAddresses IList
Результат IList

FilterByProfile() защищенный Метод

Filters the list of addresses by profile.
protected FilterByProfile ( StringCollection profileUris, IList baseAddresses ) : IList
profileUris StringCollection
baseAddresses IList
Результат IList

GetDiscoveryUrls() защищенный Метод

Returns the discovery URLs for the server.
protected GetDiscoveryUrls ( ) : StringCollection
Результат StringCollection

GetEndpointInstance() защищенный Метод

Returns an instance of the endpoint to use.
protected GetEndpointInstance ( ServerBase server ) : EndpointBase
server ServerBase
Результат EndpointBase

GetEndpoints() публичный Метод

Returns the endpoints supported by the server.
public GetEndpoints ( ) : EndpointDescriptionCollection
Результат EndpointDescriptionCollection

GetServiceContract() защищенный Метод

Returns the service contract to use.
protected GetServiceContract ( ) : Type
Результат System.Type

GetUserTokenPolicies() защищенный Метод

Returns the UserTokenPolicies supported by the server.
protected GetUserTokenPolicies ( ApplicationConfiguration configuration, EndpointDescription description ) : UserTokenPolicyCollection
configuration ApplicationConfiguration The configuration.
description EndpointDescription The description.
Результат UserTokenPolicyCollection

InitializeRequestQueue() защищенный Метод

Initializes the request queue.
protected InitializeRequestQueue ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The configuration.
Результат void

InitializeServiceHosts() защищенный Метод

Creates the endpoints and creates the hosts.
protected InitializeServiceHosts ( ApplicationConfiguration configuration, BindingFactory bindingFactory, ApplicationDescription &serverDescription, EndpointDescriptionCollection &endpoints ) : IList
configuration ApplicationConfiguration The object that stores the configurable configuration information for a UA application.
bindingFactory BindingFactory The object of a class that manages a mapping between a URL scheme and a binding.
serverDescription ApplicationDescription The object of the class that contains a description for the ApplicationDescription DataType.
endpoints EndpointDescriptionCollection The collection of objects.
Результат IList

LoadServerProperties() защищенный Метод

Returns the properties for associated with the server instance.
protected LoadServerProperties ( ) : ServerProperties
Результат ServerProperties

NormalizeHostname() защищенный Метод

Checks for IP address or well known hostnames that map to the computer.
protected NormalizeHostname ( string hostname ) : string
hostname string The hostname.
Результат string

OnServerStarting() защищенный Метод

Called before the server starts.
protected OnServerStarting ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The object that stores the configurable configuration information for a UA application.
Результат void

OnServerStopping() защищенный Метод

Called before the server stops
protected OnServerStopping ( ) : void
Результат void

OnUpdateConfiguration() защищенный Метод

Called when the server configuration is changed on disk.
Servers are free to ignore changes if it is difficult/impossible to apply them without a restart.
protected OnUpdateConfiguration ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The object that stores the configurable configuration information for a UA application.
Результат void

ProcessRequest() защищенный Метод

Processes the request.
protected ProcessRequest ( IEndpointIncomingRequest request, object calldata ) : void
request IEndpointIncomingRequest The request.
calldata object The calldata passed with the request.
Результат void

RequireEncryption() публичный статический Метод

Specifies if the server requires encryption; if so the server needs to send its certificate to the clients and validate the client certificates
public static RequireEncryption ( EndpointDescription description ) : bool
description EndpointDescription The description.
Результат bool

ScheduleIncomingRequest() публичный Метод

Schedules an incoming request.
public ScheduleIncomingRequest ( IEndpointIncomingRequest request ) : void
request IEndpointIncomingRequest The request.
Результат void

ServerBase() публичный Метод

Initializes object with default values.
public ServerBase ( ) : System
Результат System

Start() публичный Метод

Starts the server (called from a IIS host process).
public Start ( ApplicationConfiguration configuration ) : ServiceHost
configuration ApplicationConfiguration The object that stores the configurable configuration information /// for a UA application
Результат ServiceHost

Start() публичный Метод

Starts the server (called from a dedicated host process).
public Start ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The object that stores the configurable configuration /// information for a UA application. ///
Результат void

StartApplication() защищенный Метод

Starts the server application.
protected StartApplication ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The object that stores the configurable configuration information for a UA application.
Результат void

TranslateApplicationDescription() защищенный Метод

Translates the discovery URLs based on the client url and returns an updated ApplicationDescription.
protected TranslateApplicationDescription ( Uri clientUrl, ApplicationDescription description, IList baseAddresses, Opc.Ua.LocalizedText applicationName ) : ApplicationDescription
clientUrl System.Uri The client URL.
description ApplicationDescription The application description.
baseAddresses IList The base addresses.
applicationName Opc.Ua.LocalizedText The localized application name.
Результат ApplicationDescription

TranslateEndpointDescriptions() защищенный Метод

Translates the endpoint descriptions based on the client url and profiles provided.
protected TranslateEndpointDescriptions ( Uri clientUrl, IList baseAddresses, IList endpoints, ApplicationDescription application ) : EndpointDescriptionCollection
clientUrl System.Uri The client URL.
baseAddresses IList The base addresses.
endpoints IList The endpoints.
application ApplicationDescription The application to use with the endpoints.
Результат EndpointDescriptionCollection

ValidateRequest() защищенный Метод

Verifies that the request header is valid.
protected ValidateRequest ( RequestHeader requestHeader ) : void
requestHeader RequestHeader The object that contains description for the RequestHeader DataType.
Результат void