Version 3.1.6

This is a new bug fix release of the SDK.

Also the release notes has new look and feel and contains notes for all releases in a single document (per major version).

OPC Foundation Java Stack changes

Using version 1.3.345, which has following changes:

  • Fixed: GH#83 Fixed NPE if equals was called for lazily encoded ExtensionObject

  • Fixed: GH#150 First tcp message "UA Hello" was segmented, added buffering to avoid tcp fragments of one byte

  • Fixed: GH#154 ErrorMessage was sent twice during forming secure channel if there was errors, caused problems vs. Foundation C-stack

  • Fixed: GH#155 BinaryDecoder.getExpandedNodeId failed for standard numeric ids in range 128-255, which caused problems interacting with some 1.04 servers.

  • Fixed: ExpandedNodeId.toString uses 'svr' instead of 'srv' for server index output. This is expected by ExpandedNodeId.parseExpandedNodeId and is also the specificed as such in the XML encoding for ExpandedNodeId.

  • Improved: logging and allowing override for logic added in 1.3.344 for disabling the DTD procesing in XML

  • New: static TcpConnection.setDefaultHandshakeTimeout which can be used to set a lower timeout default for the initial connection from the default 60000 (milliseconds)

    Operating System settings influences the maximum possible value, in practice it would see to be at max 20 seconds on e.g. Windows defaults.

Changes to SDK common classes

  • Fixed: ApplicationIdentity multiple calls with default cert size 0 uses correct size, also allows 0 to be any of the parameter positions.

Changes to Client SDK

  • New: UaClient.setValidateCreateSessionResponseCert, which can be set to false (default true) to disable certificate equals check (GetEndpoints vs. CreateSessionResponse) when connecting. Should be only done if needed and operating in a closed network and the server is known to be safe (but behaves incorrectly).

  • Fixed: Certificate mismatch error (GetEndpoints vs. CreateSessionResponse) when server returns a certificate chain.

Changes to Server SDK

  • Fixed: Servers with more than one Certificate now sends the correct one in CreateSessionResponse

  • Fixed: Possible NPE if a Subscription is being deleted if at the same time an operation for it (e.g. adding items) is still running.

Changes to Code Generator

  • New: ServerInformationModel.getLocationURI method is generated, which will return URI pointing to the NodeSet2 XML.

    Assumes the NodeSet2 file is found on the classpath next to the generated ServerInformationModel class file, this is the default for NodeSets bundled with the SDK. Throws RuntimeException if the file is not found.
    Use server_model codegen target to automatically copy the NodeSet2 file to correct location during generation
  • Changed: Generated static encoding fields for Structures are now marked as final as they should not change

  • Improved: Commandline configuration files now support property-replacing all parameters

Changes to SampleConsoleClient

  • No changes

Changes to SampleConsoleServer

  • Improved: SampleConsoleServer.loadInformationModels shows different ways to register generated code classes and loading the model NodeSet2 XMLs

  • Changed: IPv6 is now enabled by default if running on Java 7+ (Java 6 does not support IPv6)

Version 3.1.4

This is a new bug fix release of the SDK. It also includes important security fixes.

OPC Foundation Java Stack changes

Using version 1.3.344, which has following fixes:

  • SECURITY FIX: Prevent accessing external resources with XMLs

  • SECURITY FIX: Additional logic for catching StackOverflowErrors during message decoding

  • Fixed GH#112: Binary encoding of DataValue with picoseconds

  • Fixed GH#144: Removed 'assert' checks in SerializerComposition

  • Fixed GH#145: Calculation of certificate thumbprint, when a certificate chain is received

  • Fixed GH#146: XmlDecoder.getExtensionObject() passes NamespaceTable and fixes the mapping of NamespaceIndexes with the table of the EncoderContext

Changes to SDK common classes

  • New: ApplicationIdentity.setApplicationDescription() takes an optional parameter 'enableValidation'

Changes to Client SDK

  • SECURITY FIX: Validate server certificate, if 1. Connected with SecurityMode None AND 2. Server did send a certificate AND 3. Connecting with UserTokenPolicy that requires encryption

  • Fixed: Do not auto-replace 'localhost' when receiving the server’s ApplicationUri (Servers should not define such ApplicationUris, though)

  • Fixed: Avoid StackOverflowError if a Method has a TypeDefinition Reference to itself (NOTE! Some servers use TypeDefinitions for Methods, although the specification does not allow that)

  • Fixed: UaClient.getServerIdentity() returned null when connected to servers that do not send a certificate for SecurityMode None

Changes to Server SDK

  • SECURITY FIX: Validate that padding bytes are 0 after encrypted user token designated length

  • SECURITY FIX: Prevent possible attack scenarios when decrypting user tokens

  • Fixed: Empty UserIdentityToken was not handled correctly. It is now interpreted as Anonymous token as defined in the ActivateSession in spec. Part 4

  • Fixed: Loading a NodeSet2 XML with nodes having more than one inverse Reference of certain ReferenceTypes

    This has the side-effect for the following method in NodeManager:

    protected NodeId addNode(ServiceContext serviceContext, NodeId nodeId, NodeId parentNodeId, QualifiedName browseName, NodeClass nodeClass, ExpandedNodeId typeDefinitionId, NodeAttributes attributes, NodeId referenceTypeId)

    Now the parameters parentNodeId and NodeId are always null when adding nodes from a NodeSet2 XML, and the so called "parent-reference" is added as a normal reference via addReference()

Changes to Code Generator

  • Fixed: Empty Structure arrays were not converted to the actual type for Method output parameters.

We recommend regenerating code with 3.1.4 codegen, if you have methods that define an array of some Structure type as their output argument

Changes to SampleConsoleClient

  • No changes

Changes to SampleConsoleServer

  • No changes

Version 3.1.2

This is a new bug fix release of the SDK.

Main fixes are for the TypeDictionary system introduced in 3.0.0 for handling unknown custom Structures and for generated code for custom Structures having array fields.

OPC Foundation Java Stack changes

No changes, using version 1.3.343 (same as in SDK 3.0.0 and 3.1.0)

Changes to common classes

  • Fixed: StructureUtils.clone helper for generated code now properly deep-clones arrays instead of logging errors, this affected generated code for custom Structures that have array fields. Note that also the bundled generated code for the DI and GDS companion specification information models were affected.

Changes to Client SDK

  • Fixed: DynamicStructure.hashCode and equals now works properly, previously was incorrect if DynamicStructure had array fields

  • Fixed: DynamicStructure.clone is now implemented, array fields are deep-cloned

Changes to Server SDK

  • Fixed: When creating instances of a VariableType that has a non-null Structure as Value, the parts of the Structure are set correctly to the created sub-nodes for the Variable during NodeManagerUaNode.createInstance.

Code Generator

  • Fixed: TypeDefinitionId annotation is generated for Structures and Enumerations. This affected sub-node creation for Variable nodes with custom Structures having custom Enumeration fields.

  • Fixed: Generated code for handling Union deserialization now handles null, i.e. SwitchField value is 0, situation correctly.

  • Fixed: Generating Ids on model with large number of types will split the initialization to multiple files (if over 3000 NodeIds at the moment) to avoid "Code too large" compilation errors. Public API of the generated Ids java file is the same, this only affect internal initialization.

We recommend regenerating code with 3.1.2 codegen.

Changes to SampleConsoleClient sample

  • No changes

Changes to SampleConsoleServer sample

  • No changes

Version 3.1.0

This is a new minor release of the SDK. Most of the changes are related to the TypeDictionary system introduced in SDK 3.0.0.

This release adds support for custom Enumeration fields for custom Structures obtained from TypeDictionary. It also enables support for several TypeDictionaries per namespace, which is allowed by the OPC UA specification.

OPC Foundation Java Stack changes

  • No changes, using version 1.3.343 (same as in SDK 3.0.0)

Changes to both the Client and Server SDKs

  • Fixed: UaAddress now handles URIs with '.local.' parts (by removing the final '.' after 'local'), which the new OPC Foundation Local Discovery Server (LDS-ME) provides as response to FindServersOnNetwork requests

  • Fixed: UaNodeId.from(namespace, value) now accepts also Integer as value - in addition to UnsignedInteger and the other valid types

  • Improved: ApplicationIdentity.getActualHostName() & getActualHostNameWithoutDomain() cache the resolved local hostname

Changes to Client SDK

  • Fixed: Support several TypeDictionaries per namespace

  • Interface Change: DataTypeDictionary.supportedNamespaceUris() removed, added DataTypeDictionary.knownAddressSpaceNamespaces() and DataTypeDictionary.supportedDictionaryTargetNamespaces()

  • Interface Change: Added fields to the FieldSpecification constructor

  • New: TypeDictionary supports custom Structures that have custom Enumerations

  • New: FieldSpecification.getDataTypeId() can be used to obtain the UA DataType of the custom Structure field

  • New: DynamicEnumeration, EnumerationSpecification; Used for custom Enumeration fields of custom Structures

Changes to Server SDK

  • No changes

Code Generator

  • Fixed: Support several TypeDictionaries per namespace. Namespaces that have several type dictionaries require new code generation.

Changes to SampleConsoleClient

  • No changes

Changes to SampleConsoleServer

  • No changes

Version 3.0.0

This is a new major release of the SDK. It has some major modifications and changes to the previous version 2.x, but old projects can be migrated with little effort to this version. Please see the Migration Guide for details.

Feature Highlights:

  • Support for OPC UA version 1.03

  • Rewritten, improved Code Generator

OPC Foundation Java Stack changes

  • Version: 1.3.343

  • Changed: OPC UA ByteString is now mapped to org.opcfoundation.ua.builtintypes.ByteString instead of byte[] in all interfaces.

  • New: DefaultCertificateValidator & PkiDirectoryCertificateStore (replacing the PkiFileBasedCertificateValidator in the SDK)

Changes to both the Client and Server SDKs

  • New: ApplicationIdentity.getHostNameWithoutDomain().

  • New: Support for (a subset of) OPC UA Aggregates (UaClient.getAggregateCalculator() and UaServer.getAggregateCalculator()).

  • New: Support for the Global Discovery Server (GDS) information model.

  • Changed: Using OPC UA 1.03 information model.

  • Changed: AnalogItemType.getEuRange() changed to .getEURange().

  • Fixed: UaType.getJavaClass() for StatusCode.

  • Fixed: UaType.getJavaClass() for Structures (assuming they are code generated with the new Code Generator).

  • Deprecated: PkiFileBasedCertificateValidator and UaCertificateValidator; replaced by the stack classes DefaultCertificateValidator & PkiDirectoryCertificateStore (see the Tutorials for details).

Changes to Client SDK

  • New: TypeDictionary class, which can be used to decode custom Structure types that are not known at compile time. NOTE: Custom Enumeration fields not supported, yet.

  • New: AddressSpace.getNodes(); Similar to getNode() but offers better performance when retrieving several nodes at once.

  • Changed: UaClient.doRead() is now protected (was public unintentionally)

  • Changed: UaNodeImpl.getForwardReferences() and getInverseReferences() return all References instead of no References when empty varargs parameter is passed.

  • Fixed: Recovery of Subscriptions after a connection break longer of than the keepAlive time but shorter than lifeTime

  • Removed: FileSyncClient (see end of the notes for details).

Changes to Server SDK

  • Improved: Node instantiation has been improved along wit the new code generation. This enables handling of more complex situations also in future.

  • New: TypeDefinitionBasedNodeBuilderConfiguration class. An alternative and improved way for configuring InstanceDeclarations with Optional ModellingRules for instantiation.

  • New: Updating CurrentTime in ServerStatus once per second (required for clients that create a MonitoredItem instead of using a periodic read).

  • New: Support for the new ConditionRefresh2 Method defined in the OPC UA Specification.

  • New: UaNodeId, UaBrowsePath and UaQualifiedName that use a NamespaceURI instead of a NamespaceIndex (that is used by NodeId, BrowsePath and QualifiedName).

  • New: IoManagerAdapter.

  • New: UaNode.addReference(ExpandedNodeId) enabling external references

  • Changed: AddNodes service call from clients creates full instances for Object and Variable NodeClasses (using the NodeBuilder of the respective NodeManagerUaNode).

  • Changed: Bundled NodeSet2 XML files are now located in the same package as the generated ServerInformationModel class is.

  • Changed: Passing an empty array instead of null for CallableListeners of MethodManagerUaNode.

  • Changed: UaServer logs the message "UaServer closed." during server close to logger instead of system out.

  • Removed: NodeManagerTable.historyRead(ServiceContext, …​) and historyUpdate(ServiceContext, …​)

  • Changed: All instantiation related classes (NodeBuilder and related classes) are moved to the package 'com.prosysopc.ua.server.instantiation'.

  • Fixed: NPE problems and data errors related to Diagnostics.

  • Fixed: Default ValueRank while loading NodeSet2 XML files (using the default ValueRank Scalar (-1) as defined in the XML schema instead of Any (-2)).

  • Fixed: Loading of IsAbstract Attribute for ReferenceTypes from NodeSet2 XMLs.

  • Fixed: Possible memory leak in LocalizedTextMap.

  • Fixed: Writing to Condition node properties didn’t work.

  • Changed/Fixed: LocalizedTextMap. Empty locale is treated the same as null locale. Fixed situation where LocalizedText with null or empty locale could not be replaced. Using overwrite rules of the Specification (v1.03) Part 4 section 5.10.4.1.

  • Changed/Fixed: StructureChanged bit not set anymore on DataType, ValueRank or ArrayDimensions change (changed in OPC UA 1.01 → 1.02).

  • Moved: FileNodeManager and FileFolderType to SampleConsoleServer example.

  • Moved: Compliance nodes moved to SampleConsoleServer

  • Changed: FileFolderType extends new FileDirectoryType (introduced in OPC UA 1.03)

Code Generator

  • New completely rewritten version; generated classes are mostly similar to the old ones, but there are some additions and changes so a regeneration is required.

  • IMPORTANT: the new Code Generator overrides any existing file it generates.

  • IMPORTANT: Running the Code Generator requires Java 7 (generated classes compile and work on Java 6).

  • New: Generated Ids contain NodeIds for ReferenceTypes.

  • New: Generated Ids contain NodeIds for all sub-nodes of the types.

  • New: Support copying the source XML next to the generated classes.

  • New: An optional prefix to use for the generated class names of Ids, ClientInformationModel and ServerInformationModel (for example to generate DiIds, etc.).

  • New: Enable implementation of UA methods and initialization external to the generated classes (to avoid editing the generated classes).

  • New: Support for Unions and Optional Structures.

  • New: Experimental Maven plugin.

  • Changed: Using Prefixes Di, Adi, Plc, Gds for the bundled companion specifications (the standard namespace does not have a prefix).

  • Changed: InformationModel classes renamed to ClientInformationModel on the client side and ServerInformationModel on the server side.

  • Changed: Generating Parameter Objects for UA Methods having more than one OutputArgument.

  • Changed: Client-side async method calls return correct generic parameter (AsyncResult for methods returning none).

  • Changed: getter and setter names for type components use actual names: e.g. AnalogItemType.getEuRange() changed to .getEURange().

Changes to SampleConsoleClient

  • Fixed: Problems initializing logging if log file path contained spaces.

  • Changed: Uses certificate validation from the Stack classes.

Changes to SampleConsoleServer

  • Fixed: Problems initializing logging if log file path contained spaces.

  • Moved: The compliance nodes are now directly a part of the samples instead of the SDK.

  • Moved: FileNodeManager and FileFolderType moved as sample implementation out of the main SDK

  • Changed: Uses certificate validation from the Stack classes.

  • Removed: MyLevelAlarmType class (was not used anywhere).

More

  • The SDK and Stack jar names have changed slightly due to changes in build processes.

  • Compliance nodes that were used in the SampleConsoleServer are moved from the SDK to the samples. The original idea was that you could just include ComplianceNodeManager for your server in order to help for the certification process, however in practice that only works for the samples as you need to use the actual nodes of your server. Therefore the related classes are moved to samples.

  • FileNodeManager and related classes are also moved to be a part of the SampleConsoleServer as the implementation is too application specific and serves better as a sample and a starting point for servers requiring similar functionality.

  • FileSyncClient class is removed due to the functionality being too unreliable and application specific. If the removal is a problem, let us know.