ServerEngine Class
create a new server session object.
Constructor
ServerEngine
-
options
Parameters:
-
options
Object-
buildInfo
-
[isAuditing= false]
Boolean optional -
[serverCapabilities]
optional-
[serverProfileArray]
optional -
[localeIdArray]
optional
-
-
applicationUri
Stringthe application URI.
-
[historyServerCapabilities]
optional
-
Returns:
Item Index
Methods
- add_subscription
- bindMethod
- browse
- browsePath
- browseSingleNode
- closeSession
- getSession
- getSubscriptionById
- historyRead
- historyReadSingleNode
- initialize
- read
- readSingleNode
- refreshValues
- registerShutdownTask
- secondsTillShutdown
- send_keep_alive_response
- send_notification_message
- shutdown
- write
- writeSingleNode
Methods
bindMethod
-
nodeId
-
func
Parameters:
-
nodeId
NodeIdthe node id of the method
-
func
Object-
inputArguments
Array -
context
Object -
callback
Function-
err
Error -
callMethodResult
CallMethodResult
-
-
browse
-
nodesToBrowse
-
[session]
Parameters:
-
nodesToBrowse
BrowseDescription[] -
[session]
ServerSession optional
Returns:
browseSingleNode
-
nodeId
-
browseDescription
-
[session]
Parameters:
-
nodeId
NodeId | String: the nodeid of the element to browse
-
browseDescription
Object-
browseDirection
BrowseDirection:
-
referenceTypeId
String | NodeId
-
-
[session]
ServerSession optional
Returns:
closeSession
-
authenticationToken
-
deleteSubscriptions
-
[reason = "CloseSession"]
Parameters:
-
authenticationToken
Object -
deleteSubscriptions
Boolean: 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:
-
authenticationToken
Object -
activeOnly
Object
Returns:
getSubscriptionById
-
subscriptionId
Parameters:
-
subscriptionId
Integer
Returns:
historyRead
-
context
-
historyReadRequest
-
callback
Parameters:
-
context
SessionContext -
historyReadRequest
HistoryReadRequest-
requestHeader
RequestHeader -
historyReadDetails
HistoryReadDetails -
timestampsToReturn
TimestampsToReturn -
releaseContinuationPoints
Boolean -
nodesToRead
HistoryReadValueId[]
-
-
callback
Function-
err
-
results
HistoryReadResult[]
-
historyReadSingleNode
-
context
-
nodeId
-
attributeId
-
historyReadDetails
-
[timestampsToReturn=TimestampsToReturn.Neither]
-
callback
Parameters:
-
context
SessionContext -
nodeId
NodeId -
attributeId
AttributeId -
historyReadDetails
HistoryReadDetails -
[timestampsToReturn=TimestampsToReturn.Neither]
Object optional -
callback
Function-
err
-
results
HistoryReadResult
-
initialize
-
options
-
callback
Parameters:
-
options
Object-
nodeset_filename
String- [option](default : 'mini.Node.Set2.xml' )
-
-
callback
Object
read
-
readRequest
Parameters:
-
readRequest
ReadRequest-
timestampsToReturn
TimestampsToReturn -
nodesToRead
-
maxAge
NumbermaxAge - 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:
-
context
SessionContext -
nodeId
Object -
attributeId
AttributeId -
[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:
-
nodesToRefresh
Array