C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
ServerConfigBase Class Reference

This class represent a server configuration in memory without file access. More...

#include <serverconfigbase.h>

Inherits ServerConfigData.

Public Member Functions

 ServerConfigBase (const UaString &sApplicationPath, const UaString &sConfigurationPath, const UaString &sTracePath, const UaString &sProductUri, const UaString &sManufacturerName, const UaString &sProductName, const UaString &sSoftwareVersion, const UaString &sBuildNumber, const UaString &sServerInstanceUri, const UaString &sServerInstanceName, UaCoreServerApplication *pUaCoreServerApplication, UaServerApplicationCallback *pUaServerApplicationCallback)
 Creates an instance of the ServerConfigBase class working without file access. More...
 
virtual ~ServerConfigBase ()
 Destroys the ServerConfigBase object.
 
void addEndpoint (UaEndpointBase *pEndpoint)
 Adds an endpoint to the server configuration. More...
 
virtual UaStatus loadConfiguration ()
 Load the configuration from the config file. More...
 
virtual UaStatus startUp (ServerManager *pServerManager)
 Start up OPC ServerConfig. More...
 
virtual UaStatus shutDown ()
 Shut down OPC ServerConfig. More...
 
virtual UaStatus saveConfiguration ()
 Save the configuration to the config file. More...
 
virtual SessioncreateSession (OpcUa_Int32 sessionID, const UaNodeId &authenticationToken)
 Creates a session object for the OPC server. More...
 
virtual UaStatus logonSessionUser (Session *pSession, UaUserIdentityToken *pUserIdentityToken)
 Validates the user identity token and sets the user for a session. More...
 
UaStatus setServerTraceSettings (OpcUa_Boolean bTraceEnabled, OpcUa_UInt32 uTraceLevel, OpcUa_UInt32 uMaxTraceEntries, OpcUa_UInt32 uMaxBackupFiles, const UaString &sTraceFile, OpcUa_Boolean bDisableFlush)
 
- Public Member Functions inherited from ServerConfigData
 ServerConfigData (const UaString &sApplicationPath, const UaString &sConfigPath, const UaString &sTracePath)
 Creates an instance of the ServerConfigData class reading the configuration settings from an INI file. More...
 
virtual ~ServerConfigData ()
 Destroys the ServerConfigData object.
 
void clear ()
 Clears all members and intializes them with default values.
 
virtual UaStatus getEndpointConfiguration (UaString &sRejectedCertificateDirectory, OpcUa_UInt32 &nRejectedCertificatesCount, UaEndpointArray &uaEndpointArray)
 Get Endpoint Configuration. More...
 
virtual void endpointOpened (OpcUa_UInt32 index)
 Set state of successfully opened endpoint.
 
virtual OpcUa_Boolean getAllowDeprecatedPolicies () const
 Get flag if using deprecated policies is allowed.
 
virtual OpcUa_Boolean getCheckForDuplicateReferences () const
 Get flag if checking for duplicate before adding a UaReference.
 
virtual UaStatus getCertificateStoreConfigurations (CertificateStoreConfigurationPArray &certificateStores)
 Get the configurations for server certificates and trust lists. More...
 
virtual UaStatus getUserIdentityTokenConfig (OpcUa_Boolean &bEnableAnonymous, OpcUa_Boolean &bEnableUserPw, OpcUa_Boolean &bEnableCertificate, OpcUa_Boolean &bEnableKerberosTicket)
 Gets the enabled settings for the different user identity tokens supported by the server. More...
 
virtual UaStatus getUserIdentityTokenSecurityPolicy (UaString &sSecurityPolicyUri)
 Get the security policy to use when encrypting or signing the UserIdentityToken when it is passed to the server. More...
 
virtual UaStatus getDefaultUserCertificateStore (CertificateStoreConfiguration **ppCertificateStore, UaString &sRejectedCertificateDirectory, OpcUa_UInt32 &nRejectedCertificatesCount, OpcUa_Boolean &bCertificateTokenConfigured)
 Get the configurations for the trust list and rejected folder for user certificates. More...
 
virtual UaStatus getDiscoveryRegistrationConfig (OpcUa_UInt32 &nRegistrationInterval, UaStringArray &discoveryUrlArray)
 Get settings for registration with discovery service. More...
 
virtual UaStatus getWindowsDiscoveryRegistrationSecuritySetup (OpcUa_Boolean &bAutomaticCertificateExchange, UaString &sDiscoveryServerTrustListLocation, UaString &sDiscoveryServerStoreName, UaString &sDiscoveryServerCertificateName)
 Get settings for exchanging certificates with local discovery server on a windows computer for registration with local windows discovery server. More...
 
virtual UaStatus getSerializerConfiguration (OpcUa_Int32 &iMaxAlloc, OpcUa_Int32 &iMaxStringLength, OpcUa_Int32 &iMaxByteStringLength, OpcUa_Int32 &iMaxArrayLength, OpcUa_Int32 &iMaxMessageSize) const
 Get Serializer Configuration. More...
 
virtual UaStatus getStackThreadPoolSettings (OpcUa_Boolean &bEnabled, OpcUa_Int32 &iMinThreads, OpcUa_Int32 &iMaxThreads, OpcUa_Int32 &iMaxJobs, OpcUa_Boolean &bBlockOnAdd, OpcUa_UInt32 &nTimeout) const
 Returns the settings for the thread pool used in the OPC UA Stack. More...
 
virtual UaStatus getStackTraceSettings (OpcUa_Boolean &bTraceEnabled, OpcUa_UInt32 &uTraceLevel) const
 Get UA Stack trace settings. More...
 
virtual UaStatus getPubSubStackTraceSettings (OpcUa_Boolean &bTraceEnabled, OpcUa_Int32 &nTraceLevel, OpcUa_Int32 &nFacility) const
 Get PubSub Stack trace settings. More...
 
virtual UaStatus getServerTraceSettings (OpcUa_Boolean &bTraceEnabled, OpcUa_UInt32 &uTraceLevel, OpcUa_UInt32 &uMaxTraceEntries, OpcUa_UInt32 &uMaxBackupFiles, UaString &sTraceFile, OpcUa_Boolean &bDisableFlush) const
 Get UA Server SDK trace settings. More...
 
virtual UaStatus getTraceEventSettings (OpcUa_UInt32 &uTraceEventLevel) const
 Get UA Server SDK trace event settings. More...
 
virtual OpcUa_Int32 getMaxRequestAge () const
 Returns the maximum age of a request the server allows. More...
 
virtual UaStatus getSessionSettings (OpcUa_Int32 &iMaxSessionCount, OpcUa_Int32 &iMaxSessionsPerClient, OpcUa_Int32 &iMinSessionTimeout, OpcUa_Int32 &iMaxSessionTimeout) const
 Get the setting parameters for session creation. More...
 
virtual UaStatus getServerSettings (OpcUa_Double &minSupportedSampleRate, UaStringArray &localeIdArray, UaStringArray &serverProfileArray, UaByteStringArray &softwareCertificateArray) const
 Get the general setting parameters for the server. More...
 
virtual UaStatus getServerCapabilities (UaStringArray &serverCapabilityArray) const
 Returns the server capablities. More...
 
virtual OpcUa_Int32 getMaxBrowseContinuationPoints () const
 Returns the maximum number of Browse Continuation Points managed by the server. More...
 
virtual OpcUa_Int32 getMaxBrowseResults () const
 Returns the maximum number of Browse results for one browse operation. More...
 
virtual OpcUa_Int32 getMaxNodesToBrowse () const
 Returns the maximum number of nodes to browse the server will accept. More...
 
virtual OpcUa_UInt32 getMaxNodesPerRead () const
 Returns the maximum number of nodes per read the server will accept. More...
 
virtual OpcUa_UInt32 getMaxNodesPerWrite () const
 Returns the maximum number of nodes per write the server will accept. More...
 
virtual OpcUa_UInt32 getMaxNodesPerMethodCall () const
 Returns the maximum number of nodes per method call the server will accept. More...
 
virtual OpcUa_UInt32 getMaxNodesPerRegisterNodes () const
 Returns the maximum number of nodes per register nodes the server will accept. More...
 
virtual OpcUa_UInt32 getMaxMonitoredItemsPerCall () const
 Returns the maximum number of monitored items the server allows to create, modify or delete. More...
 
virtual OpcUa_UInt32 getMaxNodesPerNodeManagement () const
 Returns the maximum number of nodes per NodeManagement service the server will accept. More...
 
virtual OpcUa_UInt32 getMaxNodesPerTranslateBrowsePathsToNodeIds () const
 Returns the maximum number of nodes the server will accept for a TranslateBrowsePathsToNodeIds service request. More...
 
virtual UaStatus getMaxNodesPerHistoryService (OpcUa_UInt32 &iMaxNodesPerHistoryReadData, OpcUa_UInt32 &iMaxNodesPerHistoryReadEvents, OpcUa_UInt32 &iMaxNodesPerHistoryUpdateData, OpcUa_UInt32 &iMaxNodesPerHistoryUpdateEvents) const
 Get the operation limit setting parameters for historical access. More...
 
virtual OpcUa_Int32 getMaxHistoryContinuationPoints () const
 Returns the maximum number of History Continuation Points managed by the server. More...
 
virtual UaStatus getSubscriptionSettings (OpcUa_UInt32 &iMinPublishingInterval, OpcUa_UInt32 &iMaxPublishingInterval, OpcUa_UInt32 &iMinKeepAliveInterval, OpcUa_UInt32 &iMinSubscriptionLifetime, OpcUa_UInt32 &iMaxSubscriptionLifetime, OpcUa_UInt32 &iMaxRetransmissionQueueSize, OpcUa_UInt32 &iMaxNotificationsPerPublish) const
 Get the setting parameters for a subscription. More...
 
virtual UaStatus getDurableSubscriptionSettings (OpcUa_Boolean &durableSubscriptionEnabled, UaString &storageDirectory, OpcUa_UInt32 &iMaxSubscriptionLifetimeInHours, OpcUa_UInt32 &iMaxMonitoredItemQueueSize, OpcUa_UInt32 &iLiveQueueSize) const
 Get the setting parameters for durable subscription support. More...
 
virtual UaStatus getMonitoredItemSettings (OpcUa_UInt32 &iMaxDataQueueSize, OpcUa_UInt32 &iMaxEventQueueSize) const
 Get the setting parameters for a MonitoreItem. More...
 
virtual UaStatus getSubscriptionMaxCountSettings (OpcUa_UInt32 &iMaxSubscriptionCount, OpcUa_UInt32 &iMaxSubscriptionsPerSession, OpcUa_UInt32 &iMaxMonitoredItemCount, OpcUa_UInt32 &iMaxMonitoredItemPerSubscriptionCount, OpcUa_UInt32 &iMaxMonitoredItemPerSessionCount) const
 Get the max object count parameters for Subscriptions. More...
 
virtual OpcUa_UInt32 getSamplingRateNonValueAttributes () const
 Returns the sampling interval used for attributes other than value by the OPC server. More...
 
virtual UaStatus getAvailableSamplingRates (UaUInt32Array &availableSamplingRates) const
 Returns the sampling rates provided by the OPC server. More...
 
virtual OpcUa_StatusCode getBuildInfo (UaString &ProductUri, UaString &ManufacturerName, UaString &ProductName, UaString &sSoftwareVersion, UaString &sBuildNumber, OpcUa_DateTime &BuildDate) const
 Returns the BuildInfo for the server. More...
 
virtual OpcUa_StatusCode getServerInstanceInfo (UaString &ServerUri, UaLocalizedTextArray &ServerName) const
 Returns the server instance information for the OPC server. More...
 
virtual UaString getServerId () const
 Returns the ServerId used for audit events. More...
 
virtual UaStatus getThreadPoolSettings (OpcUa_UInt32 &minSizeTransactionManager, OpcUa_UInt32 &maxSizeTransactionManager, OpcUa_UInt32 &minSizeSubscriptionManager, OpcUa_UInt32 &maxSizeSubscriptionManager) const
 Returns the settings for the thread pools used in the OPC server. More...
 
virtual OpcUa_Boolean isAuditActivated ()
 Flag indicating if audit events are activated. More...
 
virtual UaStatus getRedundancySettings (OpcUa_RedundancySupport &redundancySupport, UaStringArray &serverUriArray)
 Provides the redundancy settings for the server. More...
 
virtual UaStatus getNetworkRedundancySettings (UaNetworkGroupDataTypes &networkGroupArray)
 Provides the network redundancy settings for NonTransparent redundant servers. More...
 
virtual UaStatus getAdditionalServerEntries (UaApplicationDescriptions &serverDescriptions)
 Provides capability to configure additional servers to be returned in FindServers. More...
 
virtual UaStatus getApplicationType (OpcUa_ApplicationType &applicationType)
 Return the application type. More...
 
virtual UaStatus getConfiguredNamespaces (UaUInt16Array &namespaceIndexArray, UaStringArray &namespaceUriArray, UaBoolArray &allowRenameUriArray, UaStringArray &uniqueIdArray, UaStringArray &comAliasArray)
 Provides configuration option for namespaces other than index 0 and 1 (OPC UA and local server). More...
 
virtual UaStatus addConfiguredNamespace (OpcUa_UInt16 namespaceIndex, const UaString &namespaceUri, OpcUa_Boolean allowRenameUri, const UaString &uniqueId)
 Adds a namespaces configuration entry for preconfigured namespaces. More...
 
virtual UaStatus removeConfiguredNamespace (OpcUa_UInt16 namespaceIndex)
 Removes a namespaces configuration entry for preconfigured namespaces. More...
 
virtual UaStatus getProvisioningModeSettings (ProvisioningModeSettings &settings)
 Get the provisioning mode settings. More...
 
virtual UaStatus getTagFileConfiguration (UaString &defaultTagFileName, UaString &tagFileLocation, UaString &tagFileEnding, UaString &defaultFileUpdatePolicy)
 Provides information about tagfile name, path und file ending used in the NodeManagerTagFile. More...
 
virtual UaStatus setTagFileConfiguration (const UaString &defaultTagFileName, const UaString &tagFileLocation, const UaString &tagFileEnding, const UaString &defaultFileUpdatePolicy)
 Set information about tagfile name, path und file ending used in the NodeManagerTagFile. More...
 
virtual UaStatus getHttpFileAccess (OpcUa_Boolean &active, UaString &filePath)
 Provides settings for HTTP file access capability. More...
 
virtual UaStatus getComDaPropertyMapping (UaStringArray &propertyNames, UaStringArray &propertyNameSpaces, UaUInt32Array &propertyIds)
 Provides a mapping list of OPC UA property names to COM Data Access property Ids. More...
 
virtual UaStatus addComDaPropertyMapping (const UaString &propertyName, const UaString &propertyNameSpaceUri, OpcUa_UInt32 propertyId)
 Adds an entry to the mapping list of OPC UA property names to COM Data Access property Ids. More...
 
virtual UaStatus getComDaNamespaceInformation (UaString &defaultNamespace, UaUShort &namespaceDelimiter, OpcUa_Boolean &useComAlias)
 Provides additional namespace related information for COM DA Server module. More...
 
virtual ComDaTimestampSource getComDaTimestampSource ()
 Provides the source of timestamp used for COM Data Access items. More...
 
virtual ComDaTimestampSource getComHdaTimestampSource ()
 Provides the source of timestamp used for COM Historical Data Access items. More...
 
virtual OpcUa_Boolean getBrowseNextLevelForVariables ()
 When browsing for COM DA items this option causes the server to internally browse one additional level to see if there are any children.
 
virtual UaStatus getComAeNamespaceInformation (UaString &defaultNamespace)
 Provides additional namespace related information for COM A&E Server module. More...
 
virtual UaStatus getComAeEventCategoryMapping (ComAeEventType eventType, UaUInt32Array &categoryIDs, UaStringArray &categoryNames, UaNodeIdArray &eventTypeIds, UaStringArray &, UaBoolArray &)
 Provides a mapping list of OPC UA event type NodeIds to COM Alarms and Events category IDs. More...
 
virtual UaStatus addComAeEventCategoryMapping (ComAeEventType eventType, const UaUInt32Array &categoryIDs, const UaStringArray &categoryNames, const UaNodeIdArray &eventTypeIds, const UaStringArray &)
 Adds a mapping list of OPC UA event type NodeIds to COM Alarms and Events category IDs. More...
 
virtual UaStatus getComAeAttributeMapping (ComAeAttributeMappingArray &comAeAttributeMappingArray)
 Get the mapping list of OPC UA event fields to COM Alarms and Events attribute IDs. More...
 
virtual UaStatus addComAeAttributeMapping (OpcUa_UInt32 attributeID, const UaString &attributeName, OpcUa_BuiltInType dataType, OpcUa_Boolean isArray, const UaStringArray &eventFieldPathNames, const UaStringArray &eventFieldPathNamespaceUris)
 Adds an entry to the mapping list of OPC UA event fields to COM Alarms and Events attribute IDs. More...
 
virtual OpcUa_Boolean getComAeAreaFilterSupported ()
 Specify if QueryAvailableFilters includes OPC_FILTER_BY_AREA in the filterMask and if an area filter can be used in SetFilter.
 
void lockConfigFile ()
 Lock snchronization object for configuratin changes.
 
void unlockConfigFile ()
 Unlock snchronization object for configuratin changes.
 
OpcUa_UInt32 addCertificateStoreConfiguration (CertificateStoreConfiguration *pCertificateStoreConfiguration)
 Adds a new server trust list configuration. More...
 
void setProductUri (const UaString &sProductUri)
 Sets the product URI of the server product.
 
void setManufacturerName (const UaString &sManufacturerName)
 Sets the name of the manufacturer of the server product.
 
void setProductName (const UaString &sProductName)
 Sets the product name of the server product.
 
void setSoftwareVersion (const UaString &sSoftwareVersion)
 Sets the software version of the server product.
 
void setBuildNumber (const UaString &sBuildNumber)
 Sets the build number of the server product.
 
void setServerUri (const UaString &sServerUri)
 Sets the application instance URI of the server instance.
 
void setServerName (const UaString &sServerName)
 Sets the name of the server instance.
 
void setServerProfileArray (const UaStringArray &serverProfileArray)
 Sets the array of conformance profile URIs indicating the features supported by the server.
 
void setServerCapabilityArray (const UaStringArray &serverCapabilityArray)
 Sets the array of capability identifiers indicating the features supported by the server.
 
void setMaxSessionCount (OpcUa_Int32 maxSessionCount)
 Sets the maximum number of sessions the server allows to create.
 
void setMaxSessionsPerClient (OpcUa_Int32 maxSessionsPerClient)
 Sets the maximum number of sessions the server allows per Client, 0 is no limitation.
 
void setMinSessionTimeout (OpcUa_Int32 minSessionTimeout)
 Sets the minimum timeout in ms for a sessions the server allows to set.
 
void setMaxSessionTimeout (OpcUa_Int32 maxSessionTimeout)
 Sets the maximum timeout in ms for a sessions the server allows to set.
 
void setMaxBrowseContinuationPoints (OpcUa_Int32 maxBrowseContinuationPoints)
 Sets the maximum number of Browse Continuation Points managed by the server.
 
void setMaxBrowseResults (OpcUa_Int32 maxBrowseResults)
 Sets the maximum number of Browse results for one browse operation.
 
void setMaxNodesToBrowse (OpcUa_Int32 maxNodesToBrowse)
 Sets the maximum number of nodes to browse the server will accept.
 
void setMaxNodesPerRead (OpcUa_UInt32 maxNodesPerRead)
 Sets the maximum number of nodes per read the server will accept.
 
void setMaxNodesPerWrite (OpcUa_UInt32 maxNodesPerWrite)
 Sets the maximum number of nodes per write the server will accept.
 
void setMaxNodesPerMethodCall (OpcUa_UInt32 maxNodesPerMethodCall)
 Sets the maximum number of nodes per method call the server will accept.
 
void setMaxNodesPerRegisterNodes (OpcUa_UInt32 maxNodesPerRegisterNodes)
 Sets the maximum number of nodes per register nodes the server will accept.
 
void setMaxMonitoredItemsperCall (OpcUa_UInt32 maxMonitoredItemsPerCall)
 Sets the maximum number of monitored items the server allows to create, modify or delete.
 
void setMaxNodesPerNodeManagement (OpcUa_UInt32 maxNodesPerNodeManagement)
 Sets the maximum number of nodes per NodeManagement service the server will accept.
 
void setMaxNodesPerTranslateBrowsePathsToNodeIds (OpcUa_UInt32 maxNodesPerTranslateBrowsePathsToNodeIds)
 Sets the maximum number of nodes to accept for PerTranslateBrowsePathsToNodeIds service.
 
void setMaxNodesPerHistoryReadData (OpcUa_UInt32 maxNodesPerHistoryReadData)
 Sets the maximum number of nodes the server will accept for HistoryRead Data.
 
void setMaxNodesPerHistoryReadEvents (OpcUa_UInt32 maxNodesPerHistoryReadEvents)
 Sets the maximum number of nodes the server will accept for HistoryRead Events.
 
void setMaxNodesPerHistoryUpdateData (OpcUa_UInt32 maxNodesPerHistoryUpdateData)
 Sets the maximum number of nodes the server will accept for HistoryUpdate Data.
 
void setMaxNodesPerHistoryUpdateEvents (OpcUa_UInt32 maxNodesPerHistoryUpdateEvents)
 Sets the maximum number of nodes the server will accept for HistoryUpdate Events.
 
void setMaxHistoryContinuationPoints (OpcUa_Int32 maxHistoryContinuationPoints)
 Sets the maximum number of History Continuation Points managed by the server.
 
void setMinPublishingInterval (OpcUa_UInt32 minPublishingInterval)
 Sets the minimum publishing interval in milliseconds the server allows.
 
void setMaxPublishingInterval (OpcUa_UInt32 maxPublishingInterval)
 Sets the maximum publishing interval in milliseconds the server allows.
 
void setMinKeepAliveInterval (OpcUa_UInt32 minKeepAliveInterval)
 Sets the minimum KeepAlive interval in milliseconds the server allows.
 
void setMinSubscriptionLifetime (OpcUa_UInt32 minSubscriptionLifetime)
 Sets the minimum Subscription lifetime in milliseconds the server allows.
 
void setMaxSubscriptionLifetime (OpcUa_UInt32 maxSubscriptionLifetime)
 Sets the maximum Subscription lifetime in milliseconds the server allows.
 
void setMaxRetransmissionQueueSize (OpcUa_UInt32 maxRetransmissionQueueSize)
 Sets the maximum number of messages in the republish queue the server allows per Subscription.
 
void setMaxNotificationsPerPublish (OpcUa_UInt32 maxNotificationsPerPublish)
 Sets the maximum number of notifications per Publish the server allows.
 
void setMaxSubscriptionCount (OpcUa_UInt32 maxSubscriptionCount)
 Sets the maximum number of subscriptions the server allows to create. More...
 
void setMaxSubscriptionsPerSession (OpcUa_UInt32 maxSubscriptionsPerSession)
 Sets the maximum number of subscriptions the server allows to create per session. More...
 
void setMaxMonitoredItemCount (OpcUa_UInt32 maxMonitoredItemCount)
 Sets the maximum number of monitored items the server allows to create. More...
 
void setMaxMonitoredItemPerSubscriptionCount (OpcUa_UInt32 maxMonitoredItemPerSubscriptionCount)
 Sets the maximum number of monitored items per subscriptions the server allows to create. More...
 
void setMaxMonitoredItemPerSessionCount (OpcUa_UInt32 maxMonitoredItemPerSessionCount)
 Sets the maximum number of monitored items per session the server allows to create. More...
 
void setMinSupportedSampleRate (OpcUa_Double minSupportedSampleRate)
 Sets the minimum supported SamplingRate.
 
void setSamplingRateNonValueAttributes (OpcUa_UInt32 samplingRateNonValueAttributes)
 Sets the sampling interval for non value attributes.
 
void setMaxDataQueueSize (OpcUa_UInt32 maxDataQueueSize)
 Sets the maximum queue size for a data monitored item.
 
void setMaxEventQueueSize (OpcUa_UInt32 maxEventQueueSize)
 Sets the maximum queue size for an event monitored item.
 
void setThreadPoolTransactionManager (OpcUa_UInt32 minSize, OpcUa_UInt32 maxSize)
 Sets the thread pool size settings for the TransactionManager thread pool.
 
void setThreadPoolSubscriptionManager (OpcUa_UInt32 minSize, OpcUa_UInt32 maxSize)
 Sets the thread pool size settings for the SubscriptionManager thread pool.
 
void setRejectedCertificatesDirectory (const UaString &sRejectedCertificatesDirectory)
 Sets the directory used to store rejected certificates. More...
 
void setRejectedCertificatesCount (OpcUa_UInt32 rejectedCertificatesCount)
 Sets the maximum number of rejected certificates stored in the rejected certificate directory. More...
 
void setRedundancySettings (OpcUa_RedundancySupport redundancySupport, const UaStringArray &serverUriArray)
 Sets the redundancy settings for the server.
 
void setNetworkRedundancySettings (const UaNetworkGroupDataTypes &networkGroupArray)
 Sets the network redundancy settings for NonTransparent redundant servers.
 
void setEnableAnonymous (OpcUa_Boolean bEnableAnonymous)
 Sets the enable state for the Anonymous user token.
 
void setEnableUserPw (OpcUa_Boolean bEnableUserPw)
 Sets the enable state for the UserName user token.
 
void setEnableCertificate (OpcUa_Boolean bEnableCertificate)
 Sets the enable state for the Certificate user token.
 
void setUserIdentityTokenSecurityPolicy (const UaString &sUserIdentityTokenSecurityPolicy)
 Sets the security policy used for user token security.
 
void setRejectedUserCertificatesDirectory (const UaString &sRejectedUserCertificatesDirectory)
 Sets the directory used to store rejected user certificates. More...
 
void setRejectedUserCertificatesCount (OpcUa_UInt32 nRejectedUserCertificatesCount)
 Sets the maximum number of rejected user certificates stored in the rejected user certificate directory. More...
 
void setIsAuditActivated (OpcUa_Boolean isAuditActivated)
 Sets the enable state for audit events.
 
void setMaxSerializerAlloc (OpcUa_Int32 maxAlloc)
 Sets the largest size for a memory block the serializer can do when deserializing a message.
 
void setMaxSerializerStringLength (OpcUa_Int32 maxStringLength)
 Sets the largest string accepted by the serializer.
 
void setMaxSerializerByteStringLength (OpcUa_Int32 maxByteStringLength)
 Sets the largest byte string accepted by the serializer.
 
void setMaxSerializerArrayLength (OpcUa_Int32 maxArrayLength)
 Sets the maximum number of elements in an array accepted by the serializer.
 
void setMaxSerializerMessageSize (OpcUa_Int32 maxMessageSize)
 Sets the maximum number of bytes per message in total.
 
void setAdditionalServerEntries (const UaApplicationDescriptions &serverDescriptions)
 Sets additional servers to be returned in FindServers. More...
 
OpcUa_UInt32 getEndpointCount ()
 Returns the number of OPC UA endpoints configured for the server. More...
 
UaEndpointgetEndpointByIndex (OpcUa_UInt32 endpointIndex)
 Returns the endpoint at the sepcified index. More...
 
- Public Member Functions inherited from ServerConfig
 ServerConfig ()
 construction. More...
 
virtual ~ServerConfig ()
 destruction
 
virtual UaStatus setProvisioningModeSettings (const ProvisioningModeSettings &settings)
 Set the provisioning mode settings. More...
 
virtual UaStatus setServerCertificateThumbprint (const UaString &thumbprint, const OpcUa_UInt32 &endPointIndex)
 

Additional Inherited Members

- Public Types inherited from ServerConfig
enum  ComDaTimestampSource { INTERNAL, SOURCE_TIMESTAMP, SERVER_TIMESTAMP }
 ComDaTimestampSource enumeration. More...
 
enum  ComAeEventType { SIMPLE_EVENT, TRACKING_EVENT, CONDITION_EVENT }
 ComAeEventType enumeration. More...
 
- Static Public Member Functions inherited from ServerConfigData
static int replaceString (UaString &sString, const UaString &sSearch, const UaString &sReplace)
 Replaces all occurrences of the search string sSearch in sString with sReplace. More...
 
static void replaceNodeName (UaString &sString, const UaString &sNodeName)
 Replace placeholder [NodeName] with real node name. More...
 
static void replaceServerName (UaString &sString, const UaString &sServerName)
 Replace placeholder [ServerName] with real node name. More...
 
static void replaceApplicationPath (UaString &sString, const UaString &sApplicationPath)
 Replace placeholder [ApplicationPath] with real application path. More...
 
static void replaceConfigPath (UaString &sString, const UaString &sConfigPath)
 Replace placeholder [ConfigPath] with real configuration files path. More...
 
static void replaceTracePath (UaString &sString, const UaString &sTracePath)
 Replace placeholder [TracePath] with real trace file path. More...
 
- Protected Member Functions inherited from ServerConfigData
virtual OpcUa_DateTime getBuildDate () const
 Get the build date from the static compiled in string. More...
 

Detailed Description

This class represent a server configuration in memory without file access.

This implementation of the ServerConfig interface can be used if a configuration file cannot be used or the configuration is set from other product specific information. File access is only required for certificat management.

The following code provides an example for the use in a server

// Create and initialize server object
OpcServer* pServer = new OpcServer;
// Set the callback for user authentication
MyServerCallback serverCallback;
pServer->setCallback(&serverCallback);
// Create ServerConfig object without config file access
ServerConfigBase* pServerConfig = new ServerConfigBase(
szAppPath, // Application path
szAppPath, // Configuraiton path
szAppPath, // Trace file path
"urn:UnifiedAutomation:UaServerCpp", // Product URI
"Unified Automation GmbH", // Manufacturer name
"C++ SDK OPC UA Demo Server", // Product name
SERVERCONFIG_SOFTWAREVERSION, // Software version
SERVERCONFIG_BUILDNUMBER, // Build number
"urn:[NodeName]:UnifiedAutomation:UaServerCpp", // Server instance URI
"UaServerCpp@[NodeName]", // Server instance name
pServer, // Server application object
&serverCallback); // User application callback
// trace configuration
pServerConfig->setStackTraceSettings(OpcUa_True, OPCUA_TRACE_OUTPUT_LEVEL_INFO);
pServerConfig->setServerTraceSettings(OpcUa_True, UaTrace::InterfaceCall, 100000, 5, "trace.txt", OpcUa_False);
// Create endpoint configuration
UaEndpointBase* pEndpoint = new UaEndpointBase();
char szHostName[256] = "127.0.0.1"; // set default
UA_GetHostname(szHostName, 256);
pEndpoint->setEndpointUrl(UaString("opc.tcp://%1:48010").arg(szHostName), OpcUa_True);
// add Endpoint with SecurityPolicy None
UaEndpointSecuritySetting securitySetting;
securitySetting.setSecurityPolicy(OpcUa_SecurityPolicy_None);
securitySetting.addMessageSecurityMode(OPCUA_ENDPOINT_MESSAGESECURITYMODE_NONE);
pEndpoint->addSecuritySetting(securitySetting);
// add Endpoint with SecurityPolicy Basic256Sha256
securitySetting.setSecurityPolicy(OpcUa_SecurityPolicy_Basic256Sha256);
securitySetting.clearMessageSecurityModes();
securitySetting.addMessageSecurityMode(OPCUA_ENDPOINT_MESSAGESECURITYMODE_SIGN);
securitySetting.addMessageSecurityMode(OPCUA_ENDPOINT_MESSAGESECURITYMODE_SIGNANDENCRYPT);
pEndpoint->addSecuritySetting(securitySetting);
// configure rejected directory
pServerConfig->setRejectedCertificatesDirectory(UaString("%1/pkiserver/rejected").arg(szAppPath));
// configure available user tokens
pServerConfig->setEnableUserPw(OpcUa_True);
pServerConfig->setEnableCertificate(OpcUa_True);
pServerConfig->setUserIdentityTokenSecurityPolicy(OpcUa_SecurityPolicy_Basic256Sha256);
pServerConfig->setRejectedUserCertificatesDirectory(UaString("%1/pkiuser/rejected").arg(szAppPath));
// configure certificate store for user certificates
CertificateStoreConfiguration* pCertConfig = NULL;
UaString sRejected;
OpcUa_UInt32 nNumRejected = 0;
OpcUa_Boolean bCertTokenconfigured = OpcUa_False;
&pCertConfig,
sRejected,
nNumRejected,
bCertTokenconfigured);
pCertConfig->m_sCertificateTrustListLocation = UaString("%1/pkiuser/trusted/certs").arg(szAppPath);
pCertConfig->m_sCertificateRevocationListLocation = UaString("%1/pkiuser/trusted/crl").arg(szAppPath);
pCertConfig->m_sIssuersCertificatesLocation = UaString("%1/pkiuser/issuers/certs").arg(szAppPath);
pCertConfig->m_sIssuersRevocationListLocation = UaString("%1/pkiuser/issuers/crl").arg(szAppPath);
// add Endpoint
pServerConfig->addEndpoint(pEndpoint);
// Set the configuration object for the server
pServer->setServerConfig(pServerConfig);

Constructor & Destructor Documentation

ServerConfigBase::ServerConfigBase ( const UaString sApplicationPath,
const UaString sConfigurationPath,
const UaString sTracePath,
const UaString sProductUri,
const UaString sManufacturerName,
const UaString sProductName,
const UaString sSoftwareVersion,
const UaString sBuildNumber,
const UaString sServerInstanceUri,
const UaString sServerInstanceName,
UaCoreServerApplication pUaCoreServerApplication,
UaServerApplicationCallback pUaServerApplicationCallback 
)

Creates an instance of the ServerConfigBase class working without file access.

This constructor creates also a default certificate store using the sConfigurationPath parameter as base path and a default certificate configuration. This includes default certificate create settings. To change these settings, the created configuration can be accessed with getCertificateStoreConfigurations() and the configuration can be updated before the server is started.

Parameters
sApplicationPathThe path to the server executable.
sConfigurationPathThe path to the configuration files.
sTracePathThe path to the log files.
sProductUriThe product URI of the server.
sManufacturerNameThe manufacturer name of the server.
sProductNameThe product name of the server.
sSoftwareVersionThe software version of the server.
sBuildNumberThe build number of the server.
sServerInstanceUriThe application instance URI of the server. The placeholder [NodeName] can be used to automatically insert the host name.
sServerInstanceNameThe application instance name of the server. The placeholder [NodeName] can be used to automatically insert the host name.
pUaCoreServerApplicationThe main server application object.
pUaServerApplicationCallbackThe user application callback interface.

Member Function Documentation

void ServerConfigBase::addEndpoint ( UaEndpointBase pEndpoint)

Adds an endpoint to the server configuration.

It sets also the default certificate store if no certificate store is configured for the endpoint.

Session * ServerConfigBase::createSession ( OpcUa_Int32  sessionID,
const UaNodeId authenticationToken 
)
virtual

Creates a session object for the OPC server.

This could be an instance of the default Session class provided by the SDK or a derived class that contains application specific functionality and vendor specific data related to the underlying system.

Returns
Session object

Implements ServerConfig.

UaStatus ServerConfigBase::loadConfiguration ( )
virtual

Load the configuration from the config file.

This is the first method called after the creation of ServerConfig. This method must load all configuration options and must create all NodeManagers before the method startUp is called. The configuration can be loaded from a file, a data base or any other source to overwrite default settings defined in the constructor of the implementation class.

Returns
Error code.

Implements ServerConfig.

UaStatus ServerConfigBase::logonSessionUser ( Session pSession,
UaUserIdentityToken pUserIdentityToken 
)
virtual

Validates the user identity token and sets the user for a session.

Returns
Error code

Implements ServerConfig.

UaStatus ServerConfigBase::saveConfiguration ( )
virtual

Save the configuration to the config file.

Returns
Error code.

Implements ServerConfig.

UaStatus ServerConfigBase::setServerTraceSettings ( OpcUa_Boolean  bTraceEnabled,
OpcUa_UInt32  uTraceLevel,
OpcUa_UInt32  uMaxTraceEntries,
OpcUa_UInt32  uMaxBackupFiles,
const UaString sTraceFile,
OpcUa_Boolean  bDisableFlush 
)
Parameters
[in]bTraceEnabledGlobally enable/disable trace output from the SDK
[in]uTraceLevelConfigures the level of messages traced
  • (0) NoTrace - No Trace
  • (1) Errors - Unexpected errors
  • (2) Warning - Unexpected behaviour that is not an error
  • (3) Info - Information about important activities like connection establishment
  • (4) InterfaceCall - Calls to module interfaces
  • (5) CtorDtor - Creation and destruction of objects
  • (6) ProgramFlow - Internal program flow
  • (7) Data - Data
[in]uMaxTraceEntriesMaximum number of trace entries in one trace file
[in]uMaxBackupFilesMaximum number of backup files
[in]sTraceFileName and path of the trace file
[in]bDisableFlushDisable flushing the trace file after each trace entry
UaStatus ServerConfigBase::shutDown ( )
virtual

Shut down OPC ServerConfig.

Returns
Error code

Implements ServerConfig.

UaStatus ServerConfigBase::startUp ( ServerManager pServerManager)
virtual

Start up OPC ServerConfig.

Returns
Error code

Implements ServerConfig.


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