C++ UA Server SDK
1.5.2.336
|
Base class for the main OPC UA Server management object. More...
#include <uaserverapplication.h>
Inherits UaCoreServerApplication, and UaApplicationControlCallback.
Inherited by OpcServer.
Public Member Functions | |
UaServerApplication () | |
Construction. More... | |
UaServerApplication (int argc, char *argv[], bool bRunAsService, const UaString &sApplicationName) | |
Construction. More... | |
virtual | ~UaServerApplication () |
Destruction. More... | |
OpcUa_UInt32 | getEndpointCount () |
Returns the number of OPC UA endpoints in the server. More... | |
UaEndpoint * | getEndpoint (OpcUa_UInt32 endpointIndex) |
Returns the endpoint at the sepcified index. More... | |
OpcUa_UInt32 | addEndpoint (UaEndpoint *pEndpoint) |
Adds an endpoint to the server. More... | |
UaStatus | openEndpoint (OpcUa_UInt32 endpointIndex) |
Opens the endpoint sepcified by the index. More... | |
UaStatus | closeEndpoint (OpcUa_UInt32 endpointIndex) |
Closes the endpoint sepcified by the index. More... | |
UaStatus | requestServerShutDown (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason, OpcUa_Boolean restart) |
Requests the shutdown of the OPC UA Server application from the SDK module through an OPC UA method. More... | |
void | beforeEndpointOpen (UaEndpoint *pEndpoint, bool certificateAvailable) |
Information about an endpoint that will be opened by the server. More... | |
Public Member Functions inherited from UaCoreServerApplication | |
UaCoreServerApplication () | |
Creates an instance of UaCoreServerApplication with default settings. More... | |
UaCoreServerApplication (int argc, char *argv[], bool bRunAsService, const UaString &sApplicationName) | |
Creates an instance of UaCoreServerApplication with service related settings. More... | |
virtual | ~UaCoreServerApplication () |
Destroys the UaCoreServerApplication 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 | removeNodeManager (NodeManager *pNodeManager) |
Removes and deletes the NodeManager from the SDK. More... | |
int | removeModule (UaServerApplicationModule *pModule) |
Removes and deletes the Module from the SDK. More... | |
int | setCallback (UaServerApplicationCallback *pUaServerApplicationCallback) |
Sets the callback interface for the server object. More... | |
void | setSecondsTillShutdown (OpcUa_Int32 secondsTillShutdown) |
Set seconds till shudown sent to OPC UA client during shut down. | |
void | setShutdownReason (const UaLocalizedText &shutdownReason) |
Set shudown reason sent to OPC UA client during shut down. | |
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. | |
OpcUa_Int32 | secondsTillShutdown () |
Get seconds till shudown sent to OPC UA client during shut down. | |
UaLocalizedText | shutdownReason () |
Get shudown reason sent to OPC UA client during shut down. | |
Public Member Functions inherited from UaApplicationControlCallback | |
UaApplicationControlCallback () | |
Construction. | |
virtual | ~UaApplicationControlCallback () |
Destruction. | |
Protected Member Functions | |
virtual Session * | createDefaultSession (OpcUa_Int32 sessionID, const UaNodeId &authenticationToken) |
Creates a session object for the OPC server. More... | |
virtual UaStatus | afterInitialize () |
This method needs to be implemented by the derived class and is called to finish the initialization of the UaCoreServerApplication. More... | |
virtual UaStatus | afterStartUp () |
This method needs to be implemented by the derived class and is called to finish the start-up of the UaCoreServerApplication. More... | |
virtual UaStatus | beforeShutdown () |
This method needs to be implemented by the derived class and is called to start the shutdown of the UaCoreServerApplication. More... | |
Protected Member Functions inherited from UaCoreServerApplication | |
virtual int | main () |
Main function for server process. More... | |
Base class for the main OPC UA Server management object.
This class is a utility class managing all server SDK modules including the OPC UA communicaiton module 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.
A derived may overwrite the methods afterInitialize(), afterStartUp() and beforeShutdown() but must call also the base class methods. In addition the derived class must add the following code to the destructor to make sure beforeShutdown() is called before the object is deleted.
UaServerApplication::UaServerApplication | ( | ) |
Construction.
UaServerApplication::UaServerApplication | ( | int | argc, |
char * | argv[], | ||
bool | bRunAsService, | ||
const UaString & | sApplicationName | ||
) |
Construction.
|
virtual |
Destruction.
OpcUa_UInt32 UaServerApplication::addEndpoint | ( | UaEndpoint * | pEndpoint | ) |
Adds an endpoint to the server.
[in] | pEndpoint | Endpoiont to add to the server |
|
protectedvirtual |
This method needs to be implemented by the derived class and is called to finish the initialization of the UaCoreServerApplication.
This method is typically used to initialize the communication modules like the UaModule.
Implements UaCoreServerApplication.
|
protectedvirtual |
This method needs to be implemented by the derived class and is called to finish the start-up of the UaCoreServerApplication.
This method is typically used to start up the communication modules like the UaModule.
Implements UaCoreServerApplication.
Reimplemented in OpcServer.
|
virtual |
Information about an endpoint that will be opened by the server.
This callbacks allows certificate checks or creation.
This method is used internally by the SDK to forward the information to the application callback.
[in] | pEndpoint | UaEndpoint that will be opened by the server |
[in] | certificateAvailable | Flag indicating if a certificate is available |
Implements UaApplicationControlCallback.
|
protectedvirtual |
This method needs to be implemented by the derived class and is called to start the shutdown of the UaCoreServerApplication.
This method is typically used to stop the communication modules like the UaModule.
Reimplemented from UaCoreServerApplication.
|
virtual |
Closes the endpoint sepcified by the index.
[in] | endpointIndex | Index of the Endpoint to close |
Implements UaApplicationControlCallback.
|
protectedvirtual |
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. |
Implements UaCoreServerApplication.
|
virtual |
Returns the endpoint at the sepcified index.
[in] | endpointIndex | Index of the Endpoint to return |
Implements UaApplicationControlCallback.
|
virtual |
Returns the number of OPC UA endpoints in the server.
Implements UaApplicationControlCallback.
|
virtual |
Opens the endpoint sepcified by the index.
[in] | endpointIndex | Index of the Endpoint to open |
Implements UaApplicationControlCallback.
|
virtual |
Requests the shutdown of the OPC UA Server application from the SDK module through an OPC UA method.
This method is used internally by the SDK. If you want to shutdown the server, call stop()
[in] | secondsTillShutdown | Seconds till shutdown of the server |
[in] | shutdownReason | Reason for the shutdown |
[in] | restart | A flag indicating if the Server should be restarted after shutdown |
Implements UaApplicationControlCallback.