ServerEngine Class
create a new server session object.
Constructor
ServerEngine
        
                - 
                                
options 
Parameters:
- 
                                
optionsObject- 
                                            
buildInfo - 
                                            
[isAuditing= false]Boolean optional - 
                                            
[serverCapabilities]optional- 
                                                        
[serverProfileArray]optional - 
                                                        
[localeIdArray]optional 
 - 
                                                        
 - 
                                            
applicationUriStringthe application URI.
 - 
                                            
[historyServerCapabilities]optional - 
                                            
[serverDiagnosticsEnabled= true]optionalset to true to enable serverDiagnostics
 
 - 
                                            
 
Returns:
Item Index
Methods
Methods
_createSubscriptionOnSession
                    
                            - 
                                            
request 
create a new subscription
Parameters:
- 
                                            
requestObject- 
                                                        
requestedPublishingIntervalDuration - 
                                                        
requestedLifetimeCountCounter - 
                                                        
requestedMaxKeepAliveCountCounter - 
                                                        
maxNotificationsPerPublishCounter - 
                                                        
publishingEnabledBoolean - 
                                                        
priorityByte 
 - 
                                                        
 
Returns:
bindMethod
                    
                            - 
                                            
nodeId - 
                                            
func 
Parameters:
- 
                                            
nodeIdNodeIdthe node id of the method
 - 
                                            
funcObject- 
                                                        
inputArgumentsArray - 
                                                        
contextObject - 
                                                        
callbackFunction- 
                                                                    
errError - 
                                                                    
callMethodResultCallMethodResult 
 - 
                                                                    
 
 - 
                                                        
 
browse
                    
                            - 
                                            
nodesToBrowse - 
                                            
[session] 
Parameters:
- 
                                            
nodesToBrowseBrowseDescription[] - 
                                            
[session]ServerSession optional 
Returns:
browseSingleNode
                    
                            - 
                                            
nodeId - 
                                            
browseDescription - 
                                            
[session] 
Parameters:
- 
                                            
nodeIdNodeId | String: the nodeid of the element to browse
 - 
                                            
browseDescriptionObject- 
                                                        
browseDirectionBrowseDirection:
 - 
                                                        
referenceTypeIdString | NodeId 
 - 
                                                        
 - 
                                            
[session]ServerSession optional 
Returns:
closeSession
                    
                            - 
                                            
authenticationToken - 
                                            
deleteSubscriptions - 
                                            
[reason = "CloseSession"] 
Parameters:
- 
                                            
authenticationTokenObject - 
                                            
deleteSubscriptionsBoolean: true if sessions's subscription shall be deleted
 - 
                                            
[reason = "CloseSession"]String optionalthe reason for closing the session (shall be "Timeout", "Terminated" or "CloseSession")
what the specs say:
If a Client invokes the CloseSession Service then all Subscriptions associated with the Session are also deleted if the deleteSubscriptions flag is set to TRUE. If a Server terminates a Session for any other reason, Subscriptions associated with the Session, are not deleted. Each Subscription has its own lifetime to protect against data loss in the case of a Session termination. In these cases, the Subscription can be reassigned to another Client before its lifetime expires.
 
getSession
                    
                            - 
                                            
authenticationToken - 
                                            
activeOnly 
retrieve a session by its authenticationToken.
Parameters:
- 
                                            
authenticationTokenObject - 
                                            
activeOnlyObject 
Returns:
historyRead
                    
                            - 
                                            
context - 
                                            
historyReadRequest - 
                                            
callback 
Parameters:
- 
                                            
contextSessionContext - 
                                            
historyReadRequestHistoryReadRequest- 
                                                        
requestHeaderRequestHeader - 
                                                        
historyReadDetailsHistoryReadDetails - 
                                                        
timestampsToReturnTimestampsToReturn - 
                                                        
releaseContinuationPointsBoolean - 
                                                        
nodesToReadHistoryReadValueId[] 
 - 
                                                        
 - 
                                            
callbackFunction- 
                                                        
err - 
                                                        
resultsHistoryReadResult[] 
 - 
                                                        
 
historyReadSingleNode
                    
                            - 
                                            
context - 
                                            
nodeId - 
                                            
attributeId - 
                                            
historyReadDetails - 
                                            
[timestampsToReturn=TimestampsToReturn.Neither] - 
                                            
callback 
Parameters:
- 
                                            
contextSessionContext - 
                                            
nodeIdNodeId - 
                                            
attributeIdAttributeId - 
                                            
historyReadDetailsHistoryReadDetails - 
                                            
[timestampsToReturn=TimestampsToReturn.Neither]Object optional - 
                                            
callbackFunction- 
                                                        
err - 
                                                        
resultsHistoryReadResult 
 - 
                                                        
 
initialize
                    
                            - 
                                            
options - 
                                            
callback 
Parameters:
- 
                                            
optionsObject- 
                                                        
nodeset_filenameString- [option](default : 'mini.Node.Set2.xml' )
 
 
 - 
                                                        
 - 
                                            
callbackObject 
read
                    
                            - 
                                            
readRequest 
Parameters:
- 
                                            
readRequestReadRequest- 
                                                        
timestampsToReturnTimestampsToReturn - 
                                                        
nodesToRead - 
                                                        
maxAgeNumbermaxAge - must be greater or equal than zero. Maximum age of the value to be read in milliseconds. The age of the value is based on the difference between the ServerTimestamp and the time when the Server starts processing the request. For example if the Client specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing the request, the age of the returned value could be 600 milliseconds prior to the time it was requested. If the Server has one or more values of an Attribute that are within the maximum age, it can return any one of the values or it can read a new value from the data source. The number of values of an Attribute that a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case, the Client can make no assumption about which copy of the data will be returned. If the Server does not have a value that is within the maximum age, it shall attempt to read a new value from the data source. If the Server cannot meet the requested maxAge, it returns its 'best effort' value rather than rejecting the request. This may occur when the time it takes the Server to process and return the new data value after it has been accessed is greater than the specified maximum age. If maxAge is set to 0, the Server shall attempt to read a new value from the data source. If maxAge is set to the max Int32 value or greater, the Server shall attempt to geta cached value. Negative values are invalid for maxAge.
 
 - 
                                                        
 
Returns:
readSingleNode
                    
                            - 
                                            
context - 
                                            
nodeId - 
                                            
attributeId - 
                                            
[timestampsToReturn=TimestampsToReturn.Neither] 
Parameters:
- 
                                            
contextSessionContext - 
                                            
nodeIdObject - 
                                            
attributeIdAttributeId - 
                                            
[timestampsToReturn=TimestampsToReturn.Neither]Object optional 
Returns:
refreshValues
                    
                            - 
                                            
nodesToRefresh - 
                                            
callback 
performs a call to asyncRefresh on all variable nodes that provide an async refresh func.
Parameters:
- 
                                            
nodesToRefreshArrayan array containing the node to consider Each element of the array shall be of the form { nodeId:
, attributeIds: }.  - 
                                            
callbackFunction- 
                                                        
errNull | Error - 
                                                        
dataArray: an array containing value read The array length matches the number of nodeIds that are candidate for an async refresh (i.e: nodes that are of type Variable with asyncRefresh func }
 
 - 
                                                        
 
registerShutdownTask
                    
                            ()
                    
                    
                    
                    
                    
                    
                    
                    
                        
                    
                        register a function that will be called when the server will perform its shut down.
secondsTillShutdown
                    
                            ()
                    
                            
                                UInt32
                            
                    
                    
                    
                    
                    
                    
                    
                        
                    
                        Returns:
the approximate number of seconds until the server will be shut down. The value is only relevant once the state changes into SHUTDOWN.
shutdown
                    
                            ()
                    
                    
                    
                    
                    
                    
                    
                    
                        
                    
                        transferSubscription
                    
                            - 
                                            
session - 
                                            
subscriptionId - 
                                            
sendInitialValues 
Parameters:
- 
                                            
sessionServerSession- the new session that will own the subscription
 
 - 
                                            
subscriptionIdIntegerId- the subscription Id to transfer
 
 - 
                                            
sendInitialValuesBoolean- true if initial values will be resent.
 
 
Returns:
write
                    
                            - 
                                            
context - 
                                            
nodesToWrite - 
                                            
callback 
write a collection of nodes
Parameters:
- 
                                            
contextObject - 
                                            
nodesToWriteObject - 
                                            
callbackFunction- 
                                                        
err - 
                                                        
resultsStatusCode[] 
 - 
                                                        
 
writeSingleNode
                    
                            - 
                                            
context - 
                                            
writeValue - 
                                            
callback 
Parameters:
- 
                                            
contextContext - 
                                            
writeValueDataValue - 
                                            
callbackFunction- 
                                                        
errError | Null - 
                                                        
statusCodeStatusCode 
 - 
                                                        
 
Properties
cumulatedSessionCount
                        Number
                    
                    
                    
                    
                    
                        
                    
                        the cumulated number of sessions that have been opened since this object exists
cumulatedSubscriptionCount
                        Number
                    
                    
                    
                    
                    
                        
                    
                        the cumulated number of subscriptions that have been created since this object exists
currentSessionCount
                        Number
                    
                    
                    
                    
                    
                        
                    
                        the number of active sessions
currentSubscriptionCount
                        Number
                    
                    
                    
                    
                    
                        
                    
                        the number of active subscriptions.
serverName
                        String
                    
                    
                    
                    
                    
                        
                    
                        the name of the server
serverNamespaceName
                        String
                    
                    
                    
                    
                    
                        
                    
                        the urn of the server namespace
serverNameUrn
                        String
                    
                    
                    
                    
                    
                        
                    
                        the server urn
            The NodeOPCUA API