UA Server SDK C++ Bundle
1.4.0.258
|
Main OPC Server object. More...
#include <uaserverapplication.h>
Inherited by OpcServer.
Public Member Functions | |
UaServerApplication () | |
Creates an instance of UaServerApplication with default settings. More... | |
virtual | ~UaServerApplication () |
Destroys the UaServerApplication object. More... | |
int | setServerConfig (const UaString &configurationFile, const UaString &sApplicationPath) |
Sets the server configuration by passing the path of the configuration file. More... | |
int | setServerConfig (const UaString &configurationFile, const UaString &sApplicationPath, const UaString &sConfigPath, const UaString &sTracePath) |
Sets the server configuration by passing the path of the configuration file. More... | |
int | setServerConfig (ServerConfig *pServerConfig) |
Sets the server configuration by passing a server configuration object. More... | |
int | addNodeManager (NodeManager *pNodeManager) |
Adds a node manager to the SDK. More... | |
int | addModule (UaServerApplicationModule *pModule) |
Adds a Module to the SDK. More... | |
int | setCallback (UaServerApplicationCallback *pUaServerApplicationCallback) |
Sets the callback interface for the server object. More... | |
int | start () |
Starts the OPC server Initializes and starts up all NodeManagers and SDK modules. More... | |
int | stop (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason) |
Stopps the OPC server Shutdown and deletes all SDK modules and NodeManagers. More... | |
NodeManagerConfig * | getDefaultNodeManager () |
Returns the default node manager for server specific nodes in namespace one. More... | |
ServerManager * | getServerManager () |
Returns the ServerManager object. | |
ServerConfig * | getServerConfig () |
Returns the ServerConfig object. | |
CoreModule * | getCoreModule () |
Returns the CoreModule object. | |
OpcUa_Boolean | isStarted () |
Returns the isStarted flag. | |
virtual Session * | createDefaultSession (OpcUa_Int32 sessionID, const UaNodeId &authenticationToken)=0 |
Creates a session object for the OPC server. More... | |
virtual OpcUa_DateTime | getBuildDate () const |
Static Public Member Functions | |
static int | initEnvironment () |
Initialize the environment like UA stack platform layer or XML parser. | |
static void | cleanupEnvironment () |
Clean up the environment like UA stack platform layer or XML parser. | |
Protected Member Functions | |
virtual UaStatus | afterInitialize ()=0 |
This method needs to be implemented by the derived class and is called to finish the initialization of the UaServerApplication. More... | |
virtual UaStatus | afterStartUp ()=0 |
This method needs to be implemented by the derived class and is called to finish the start-up of the UaServerApplication. More... | |
virtual UaStatus | beforeShutdown ()=0 |
This method needs to be implemented by the derived class and is called to start the shutdown of the UaServerApplication. More... | |
UaServerApplicationCallback * | getServerApplicationCallback () |
Protected Attributes | |
UaServerApplicationPrivate * | d |
Main OPC Server object.
This class is a utility class managing all server SDK modules for common use cases in a simplified way. Enhanced users may replace this class with their own implementation to be able to use derived classes to overwrite SDK functionality.
UaServerApplication::UaServerApplication | ( | ) |
Creates an instance of UaServerApplication with default settings.
|
virtual |
Destroys the UaServerApplication object.
int UaServerApplication::addModule | ( | UaServerApplicationModule * | pModule | ) |
Adds a Module to the SDK.
The module will be managed by this class including starting, stopping and deletion of the module. The method can be called several times for a list of modules. If the method is called before start, all modules will be started during the call of the start method. If this method is called if the server is already started the module will be started by this method.
int UaServerApplication::addNodeManager | ( | NodeManager * | pNodeManager | ) |
Adds a node manager to the SDK.
The node manager will be managed by this class including starting, stopping and deletion of the node manager. The method can be called several times for a list of node managers. If the method is called before start, all node managers will be started during the call of the start method. If this method is called if the server is already started the node manager will be started by this method.
|
protectedpure virtual |
This method needs to be implemented by the derived class and is called to finish the initialization of the UaServerApplication.
This method is typically used to initialize the communication modules like the UaModule.
Implemented in OpcServer.
|
protectedpure virtual |
This method needs to be implemented by the derived class and is called to finish the start-up of the UaServerApplication.
This method is typically used to start up the communication modules like the UaModule.
Implemented in OpcServer.
|
protectedpure virtual |
This method needs to be implemented by the derived class and is called to start the shutdown of the UaServerApplication.
This method is typically used to stop the communication modules like the UaModule.
Implemented in OpcServer.
|
pure virtual |
Creates a session object for the OPC server.
This is the default implementation. It can be overwritten by implementing the UaServerApplicationCallback.
sessionID | Session Id created by the server application. |
authenticationToken | Secret session Id created by the server application. |
Implemented in OpcServer.
NodeManagerConfig * UaServerApplication::getDefaultNodeManager | ( | ) |
Returns the default node manager for server specific nodes in namespace one.
This node manager can be used to create objects and variables for data access. It can not be used for enhanced OPC UA features. Usind features like events, methods and historical access requires the implementation of a specific node manager.
int UaServerApplication::setCallback | ( | UaServerApplicationCallback * | pUaServerApplicationCallback | ) |
Sets the callback interface for the server object.
This callback interface needs to be implemented if the application wants to implement user authentication.
pUaServerApplicationCallback | Interface pointer of the callback interface. |
int UaServerApplication::setServerConfig | ( | const UaString & | configurationFile, |
const UaString & | sApplicationPath | ||
) |
Sets the server configuration by passing the path of the configuration file.
One of the overloaded methods needs to be called to give the server a valid configuration.
This version forces the server to use the default implementation for the ServerConfig object and allows to specify the configuraiton file and the path to the application or the directory containing the configuration and the PKI store.
configurationFile | Path and file name of the configuration file. The file can be one of the two file formats supported by the SDK, a XML file format and an INI file format. The XML file format requires linking of the XML parser module and needs to be activated by compiling this class with the compiler switch SUPPORT_XML_PARSER set to 1 |
sApplicationPath | The path of the application folder used to replace the [ApplicationPath] placeholders in the configuration file |
int UaServerApplication::setServerConfig | ( | const UaString & | configurationFile, |
const UaString & | sApplicationPath, | ||
const UaString & | sConfigPath, | ||
const UaString & | sTracePath | ||
) |
Sets the server configuration by passing the path of the configuration file.
One of the overloaded methods needs to be called to give the server a valid configuration.
This version forces the server to use the default implementation for the ServerConfig object and allows to specify the configuraiton file and the path to the application or the directory containing the configuration and the PKI store.
configurationFile | Path and file name of the configuration file. The file can be one of the two file formats supported by the SDK, a XML file format and an INI file format. The XML file format requires linking of the XML parser module and needs to be activated by compiling this class with the compiler switch SUPPORT_XML_PARSER set to 1 |
sApplicationPath | The path of the application folder used to replace the [ApplicationPath] placeholders in the configuration file |
sConfigPath | The path of the configuration files and PKI store used to replace the [ConfigPath] placeholders in the configuration file |
sTracePath | The path of the trace file folder used to replace the [TracePath] placeholders in the configuration file |
int UaServerApplication::setServerConfig | ( | ServerConfig * | pServerConfig | ) |
Sets the server configuration by passing a server configuration object.
One of the overloaded methods needs to be called to give the server a valid configuration.
This version allows to pass in a ServerConfig object with a user specific implementation.
pServerConfig | Interface pointer of the object implementing the ServerConfig interface. |
int UaServerApplication::start | ( | ) |
Starts the OPC server Initializes and starts up all NodeManagers and SDK modules.
It is possible to add more NodeManagers after the server is started.
int UaServerApplication::stop | ( | OpcUa_Int32 | secondsTillShutdown, |
const UaLocalizedText & | shutdownReason | ||
) |
Stopps the OPC server Shutdown and deletes all SDK modules and NodeManagers.
secondsTillShutdown | Seconds till shutdown of the server if clients are connected. |
shutdownReason | Reason for the shutdown. |