com.prosysopc.ua.server
Interface UaServerListener


public interface UaServerListener

A listener interface for server "events". Note that the interface definition may change in future.


Method Summary
 boolean onAllowReadSecurityDiagnostics(ServiceContext serviceContext)
          Define the user access level for reading the session security diagnostics from the server.
 NodeManager onCreateNewNodeManager(ServiceContext serviceContext, String namespaceUri)
          Called, when a client application is creating new nodes that do not have a respective NodeManager.
 void onRegisterServer(String discoveryServerUrl, boolean isOnline)
          Notification of a registration to the (Local) Discovery Server.
 boolean onRegisterServerError(String discoveryServerUrl, boolean isOnline, UaServerException e)
          Notification of a registration error to the (Local) Discovery Server.
 void onShutdown(UaServer uaServer, boolean restart)
          Called when server is shut down.
 boolean onShutdownRequest(ServiceContext serviceContext, int seconds, org.opcfoundation.ua.builtintypes.LocalizedText reason, boolean restart)
          Called when client asks to begin shutdown process.
 

Method Detail

onAllowReadSecurityDiagnostics

boolean onAllowReadSecurityDiagnostics(ServiceContext serviceContext)
Define the user access level for reading the session security diagnostics from the server. By default, no access is allowed, but you may allow read access to administrator users via the event.

Parameters:
serviceContext - client calling context, including the session information, which defines the userIdentity
Returns:
true, if the client may read the diagnostics

onCreateNewNodeManager

NodeManager onCreateNewNodeManager(ServiceContext serviceContext,
                                   String namespaceUri)
                                   throws StatusException
Called, when a client application is creating new nodes that do not have a respective NodeManager. You may create the correct NodeManager for the specified namespace in your code if that is allowed. If creation is not allowed, you should raise a StatusException, for example with the code StatusCodes.Bad_UserAccessDenied.

If the method returns null, a new NodeManagerUaNode will be created.

Parameters:
serviceContext - client calling context, including the session information, which defines the userIdentity
namespaceUri - the URI of the new namespace
Returns:
the new node manager or null, if the default NodeManagerUaNode may be used.
Throws:
StatusException

onRegisterServer

void onRegisterServer(String discoveryServerUrl,
                      boolean isOnline)
Notification of a registration to the (Local) Discovery Server.

Parameters:
isOnline - whether the server was about to be registered online or offline
discoveryServerUrl - the URL of the discovery server that was being connected to

onRegisterServerError

boolean onRegisterServerError(String discoveryServerUrl,
                              boolean isOnline,
                              UaServerException e)
Notification of a registration error to the (Local) Discovery Server.

Parameters:
isOnline - whether the server was about to be registered online or offline
discoveryServerUrl - the URL of the discovery server that was being connected to
e - the error that was raised.
Returns:
true if the error is handled in the event handler. Return false to let the SDK a default warning message to the log.

onShutdown

void onShutdown(UaServer uaServer,
                boolean restart)
Called when server is shut down.

Parameters:
uaServer - the server that is shut down
restart - a flag indicating whether the server will be restarted after shutdown

onShutdownRequest

boolean onShutdownRequest(ServiceContext serviceContext,
                          int seconds,
                          org.opcfoundation.ua.builtintypes.LocalizedText reason,
                          boolean restart)
                          throws StatusException
Called when client asks to begin shutdown process.

Parameters:
serviceContext - calling context, including the session information, which defines the userIdentity
seconds - the number of seconds until shutdown
reason - reason for the shutdown request
restart - a flag indicating whether the server will be restarted after shutdown
Returns:
a boolean value indicating whether the state change is allowed
Throws:
StatusException - StatusCodes.Bad_UserAccessDenied if the user is not authorized to request the state change


Copyright © 2018. All rights reserved.