This Method closes the file and applies the changes to the PubSub configuration as defined in the ConfigurationReferences argument. It can only be called if the file was opened for writing. If the Close Method is called any cached data is discarded and the PubSub configuration is not changed.

The file content shall be a UABinaryFileDataType with a PubSubConfiguration2DataType as Body. The ConfigurationReferences argument specifies the configuration elements to add, modify or remove. Configuration elements in PubSubConfiguration2DataType that are not referenced by ConfigurationReferences may be used indirectly as parent elements for referencing. In this case only the name of the element is relevant and all other fields of the element are ignored. Configuration elements in PubSubConfiguration2DataType not referenced and not used as parent elements are ignored.

Remove element operations shall be processed before any other operations are processed. The PubSubConfiguration2DataType may contain duplicate names for cases where elements are removed and added with the same name.

The top-level fields in the PubSubConfiguration2DataType are not referenced in ConfigurationReferences argument. Most of them are only relevant for the read case.

The Client shall be authorized to modify the configuration for the PubSub functionality when invoking this Method on the Server.

Signature

CloseAndUpdate (

[in]UInt32 FileHandle,

[in]Boolean RequireCompleteUpdate,

[in]PubSubConfigurationRefDataType[]ConfigurationReferences,

[out]Boolean ChangesApplied,

[out]StatusCode[] ReferencesResults,

[out]PubSubConfigurationValueDataType[] ConfigurationValues,

[out]NodeId[] ConfigurationObjects

);

Argument

Description

FileHandle

The handle of the previously opened file.

RequireCompleteUpdate

If true, the modification is only applied if the all changes can be applied to all objects.

ConfigurationReferences

References to the PubSub configuration elements in the written file that should be added, modified or removed.

ChangesApplied

If true, one or more changes were applied. If RequireCompleteUpdate was set to false, the ReferencesResults argument indicates if referenced configuration elements failed.

If false, no changes were applied. The detailed errors are provided in the ReferencesResults argument.

ReferencesResults

Results of the add, modify, match or remove operation for the referenced element. The length and order of the array shall match the ConfigurationReferences array.

ConfigurationValues

The assigned names and identifiers for the elements where empty names or null identifiers where provided in the elements. The values are only provided for elements with the bits ElementAdd or ElementMatch set and where a name and identifier was assigned.

ConfigurationObjects

NodeIds of the related Objects to referenced

If NodeIds are returned, the length and order of the array shall match the ConfigurationReferences array.

If the Server does not support the creation of NodeIds, the array is null or empty.

Method Result Codes

ResultCode

Description

Bad_TypeMismatch

The file content is not a UABinaryFileDataType with a PubSubConfiguration2DataType as Body.

Bad_InvalidArgument

The file handle is not valid.

Bad_InvalidState

The file was not opened for writer access.

Bad_UserAccessDenied

The Session user is not allowed to modify the PubSub configuration.

Bad_NothingToDo

The ConfigurationReferences array is null or empty.

Element Result Codes

ResultCode

Description

Bad_BrowseNameDuplicated

An element with the name already exists. The element cannot be added.

Bad_NoMatch

An element with the name does not exist or there is no element with matching parameters. The element cannot be matched, modified or removed.

Bad_NotFound

One of the parent elements does not exist or was not added or matched. The element cannot be processed.

Bad_InvalidArgument

The element reference is invalid or has invalid index entries.

Bad_ResourceUnavailable

The maximum number of supported elements is reached.

Bad_InvalidState

A WriterGroup with active GroupHeader was references with ElementMatch.

Bad_UserAccessDenied

The user has not the rights to access the element.

Table 219 specifies the AddressSpace representation for the CloseAndUpdate Method.

Table 219 – CloseAndUpdate Method AddressSpace definition

Attribute

Value

BrowseName

CloseAndUpdate

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

HasProperty

Variable

InputArguments

Argument[]

PropertyType

Mandatory

HasProperty

Variable

OutputArguments

Argument[]

PropertyType

Mandatory

ConformanceUnits

PubSub Model Base