Figure 38depicts the PublishSubscribeTypeand the components used to represent the PublishSubscribeObject.

image041.png

Figure 38– PublishSubscribe Object Types Overview

The PublishSubscribe Objectis the root node for all PubSubrelated configuration Objects. It is an instance of the PublishSubscribeTypeand a component of the Server Object.

The PublishSubscribeTypecontains the entry point for PublishedDataSetconfiguration, the entry point for PubSubconnections. In addition, it provides Methodsfor connection management.

An instance of this ObjectTyperepresents the root Objectfor all PubSubrelated configuration and metadata Objects. The one instance of this ObjectTypethat represents the root Objectis defined in 8.4. The ObjectTypeis formally defined in Table 103.

Table 103– PublishSubscribeType Definition

Attribute

Value

BrowseName

PublishSubscribeType

IsAbstract

False

References

Node Class

BrowseName

DataType

TypeDefinition

Modelling Rule

Subtype of PubSubKeyServiceType defined in 8.2.

HasPubSub‌Connection

Object

<ConnectionName>

PubSubConnectionType

Optional‌Placeholder

HasComponent

Method

SetSecurityKeys

Defined in 9.1.3.3.

Optional

HasComponent

Method

AddConnection

Defined in 9.1.3.4.

Optional

HasComponent

Method

RemoveConnection

Defined in 9.1.3.5.

Optional

HasComponent

Object

PublishedDataSets

DataSetFolderType

Mandatory

HasComponent

Object

Status

PubSubStatusType

Mandatory

HasComponent

Object

Diagnostics

PubSubDiagnosticsRootType

Optional

HasProperty

Variable

SupportedTransportProfiles

String[]

PropertyType

Mandatory

The PublishSubscribeType ObjectTypeis a concrete type and can be used directly.

The configured connectionObjectsare added as components to the instance of the PublishSubscribeType. ConnectionObjectsmay be configured with product specific configuration tools or added and removed through the Methods AddUadpConnection, AddBrokerConnectionand RemoveConnection. The PubSubConnectionTypeis defined in 9.1.5.2. The HasPubSubConnection ReferenceTypeis defined in 9.1.3.6.

The PublishedDataSets Objectcontains the configured PublishedDataSets. The DataSetFolderTypeis defined in 9.1.4.5.1. The DataSetFolderTypecan be used to build a tree of DataSetFolders.

The Status Objectprovides the current operational status of the PublishSubscribefunctionality. The PubSubStatusTypeis defined in 9.1.10. The state machine for the status and the relation to other PubSub Objectslike PubSubConnection, PubSubGroup, DataSetWriterand DataSetReaderare defined in 6.2.1.

The Diagnostics Object provides the current diagnostic information for the PublishSubscribe Object. The PubSubDiagnosticsRootTypeis defined in 9.1.11.7.

The SupportedTransportProfiles Propertyprovides a list of TransportProfileUrissupported by the Server. The TransportProfileUris are defined in OPC 10000-7.

This Methodis used to push the security keys for a SecurityGroupinto a Publisheror Subscriber. It is used if Publisheror Subscriberhave no OPC UA Clientfunctionality.

Encryption is required for this Method. The Methodshall return Bad_SecurityModeInsufficient if the communication is not encrypted.

Signature

SetSecurityKeys(

[in]String SecurityGroupId

[in]String SecurityPolicyUri

[in]IntegerId CurrentTokenId

[in]ByteString CurrentKey

[in]ByteString[]FutureKeys

[in]Duration TimeToNextKey

[in]Duration KeyLifetime

);

Argument

Description

SecurityGroupId

The identifier for the SecurityGroup.

SecurityPolicyUri

The URI for the set of algorithms and key lengths used to secure the messages. The SecurityPoliciesare defined in OPC 10000-7.

CurrentTokenId

The SecurityTokenIdthat appears in the header of messages secured with the CurrentKey. It starts at 1 and is incremented by 1 each time the KeyLifetimeelapses even if no keys are requested. If the CurrentTokenId increments past the maximum value of UInt32it restarts a 1.

If the PubSub Objecthas key material from previous SetSecurityKeys Methodcalls, the CurrentTokenIdis used to match the existing list with the fetched list and to eliminate duplicates.

If the CurrentTokenId is unknown, the existing list shall be discarded and replaced.

CurrentKey

The current key used to secure the messages. This key is not used directly since the protocol associated with the PubSubGroup(s)specifies an algorithm to generate distinct keys for different types of cryptography operations.

FutureKeys

An ordered list of future keys that are used when the KeyLifetime elapses.The SecurityTokenId associated with the first key in the list is 1 more than the CurrentTokenId. All following keys have a SecurityTokenId that is incremented by 1 for every key returned.

TimeToNextKey

The time, in milliseconds, before the CurrentKey is expected to expire.

If a Publisheruses this Methodto get the keys from a SKS, the TimeToNextKeyand KeyLifetimeare used to calculate the time the Publishershall use the next key. The TimeToNextKeydefines the time when to switch from CurrentKeyto FutureKeysand the KeyLifetimedefines when to switch from one future key to the next future key.

For a Subscriberthe TimeToNextKeyand KeyLifetimeare used to calculate the time the Subscribermust expect that the Publishersuse the next key. Due to network latency, out of order delivery and the use of keys for several Publishers, a Subscribermust expect some overlap time where NetworkMessagesare received that are using the previous or the next key.

TimeToNextKeyand KeyLifetimeare also used to calculate the time until Publisherand Subscribermust fetch new keys.

KeyLifetime

The lifetime of a key in milliseconds.

The returned keys may expire earlier if the keys are discarded for some reason. An unplanned key rotation is indicated in the NetworkMessageheader before the next key is used to give the Subscribersome time to fetch new keys.

If the CurrentTokenIdin the message is not recognized the receiver shall call this Methodagain to get new keys.

Method Result Codes

ResultCode

Description

Bad_NotFound

The SecurityGroupIdis unknown.

Bad_UserAccessDenied

The caller is not allowed to set the keys for the SecurityGroup.

Bad_SecurityModeInsufficient

The communication channel is not using encryption.

This Methodis used to add a new PubSubConnection Objectto the PublishSubscribe Object.

The Clientshall be authorized to modify the configuration for the PubSubfunctionality when invoking this Methodon the Server.

Signature

AddConnection(

[in]PubSubConnectionDataTypeConfiguration

[out]NodeId ConnectionId

);

Argument

Description

Configuration

Configuration parameters for the PubSubConnection. The parameters and the PubSubConnectionDataTypeare defined in 6.2.6.

ConnectionId

The NodeIdof the new connection.

Method Result Codes

ResultCode

Description

Bad_InvalidArgument

The Serveris not able to apply the name. The name may be too long or may contain invalid character.

Bad_BrowseNameDuplicated

An Objectwith the name already exists.

Bad_ResourceUnavailable

The Serverhas not enough resources to add the PubSubConnection Object.

Bad_UserAccessDenied

The Sessionuser is not allowed to create a PubSubConnection Object.

This Methodis used to remove a PubSubConnection Objectfrom the PublishSubscribe Object.

A successful removal of the PubSubConnection Objectremoves all associated group, DataSetWriterand DataSetReader Objects. Before the Objectsare removed, their state is set to Disabled_0.

The Clientshall be authorized to modify the configuration for the PubSubfunctionality when invoking this Methodon the Server.

Signature

RemoveConnection(

[in]NodeIdConnectionId

);

Argument

Description

ConnectionId

NodeIdof the PubSubConnection Object to remove from the Server

Method Result Codes

ResultCode

Description

Bad_NodeIdUnknown

The ConnectionIdis unknown.

Bad_UserAccessDenied

The Sessionuser is not allowed to delete the PubSubConnection Object.

The HasPubSubConnection ReferenceTypeis a concrete ReferenceTypethat can be used directly. It is a subtype of the HasComponent ReferenceType.

The SourceNodeof Referencesof this type shall be the PublishSubscribe Objectdefined in 8.4.

The TargetNodeof this ReferenceType shall be an Objectof type PubSubConnectionTypedefined in 9.1.5.2.

The representation of the HasPubSubConnection ReferenceTypein the AddressSpaceis specified in Table 104.

Table 104– HasPubSubConnection ReferenceType

Attributes

Value

BrowseName

HasPubSubConnection

InverseName

PubSubConnectionOf

Symmetric

False

IsAbstract

False

References

NodeClass

BrowseName

Comment

Subtype of HasComponent defined in OPC 10000-5.