com.prosysopc.ua
Class UaApplication

java.lang.Object
  extended by com.prosysopc.ua.UaApplication
Direct Known Subclasses:
UaClient, UaServer

public abstract class UaApplication
extends Object

A common base class for client and server applications.


Nested Class Summary
static class UaApplication.a
           
static class UaApplication.DiagnosticMask
          Bits values used to mask the types of vendor-specific diagnostics.
static class UaApplication.Protocol
           
 
Constructor Summary
UaApplication()
           
 
Method Summary
static String formatUri(UaApplication.Protocol protocol, String host, int port, String serverName)
          Compose a valid OPCUA URI string from the parts
abstract  UaAddressSpace getAddressSpace()
           
 AggregateCalculator getAggregateCalculator()
           
 org.opcfoundation.ua.transport.security.CertificateValidator getCertificateValidator()
           
abstract  org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
           
 DataTypeDictionary getKnownDataTypeDictionary()
           
 org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
           
 OperationLimits getOperationLimits()
           
 RegisteredClasses getRegisteredClasses()
          Returns the RegisteredClasses object of the application.
static String getSdkVersion()
           
static String getVersion()
          Deprecated. use getSdkVersion(), but note that it does not contain the "v" prefix
 void registerClass(Class<? extends UaInstance> clazz)
          Register a class representing an UA Type.
 void registerClass(Class<? extends UaInstance> clazz, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
          Register a class representing an UA Type.
 void registerClass(Class<? extends UaInstance> clazz, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
          Register a class representing an UA Type.
 void registerClasses(Collection<Class<? extends UaInstance>> classes)
          Register given classes for the application.
protected  void registerModelInternal(CodegenModel codegenModel)
          Register an information model to use in the application.
 void setCertificateValidator(org.opcfoundation.ua.transport.security.CertificateValidator certificateValidator)
          Define a certificate validator that checks the server certificate after connect.
 void setOperationLimits(OperationLimits operationLimits)
          Define the operation limits for the application
protected  org.opcfoundation.ua.builtintypes.StatusCode validateApplicationCertificate(ApplicationIdentity applicationIdentity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UaApplication

public UaApplication()
Method Detail

formatUri

public static String formatUri(UaApplication.Protocol protocol,
                               String host,
                               int port,
                               String serverName)
Compose a valid OPCUA URI string from the parts

Parameters:
protocol - Communication protocol
host - Host name of the computer
port - TCP port number
serverName - the server name part of the URI
Returns:
A string of the format "://:/" - the slash before serverName is not added, if serverName is empty

getSdkVersion

public static String getSdkVersion()
Returns:
the version of the Prosys OPC UA Java SDK in "%VERSION%" format.

getVersion

@Deprecated
public static String getVersion()
Deprecated. use getSdkVersion(), but note that it does not contain the "v" prefix

Returns:
the version of the Prosys OPC UA Java SDK in "v%VERSION%" format.

getAddressSpace

public abstract UaAddressSpace getAddressSpace()
Returns:
the AddressSpace, which provides access to the UA nodes.

getAggregateCalculator

public AggregateCalculator getAggregateCalculator()

getCertificateValidator

public org.opcfoundation.ua.transport.security.CertificateValidator getCertificateValidator()
Returns:
the current certificate validator.

getKnownDataTypeDictionary

public DataTypeDictionary getKnownDataTypeDictionary()
Returns:
The DataTypeDictionary of known types

getEncoderContext

public abstract org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
Returns:
the encoder context, which is used for mapping namespaces and nodeIds in the stack layer.

getNamespaceTable

public org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
Returns:
the address space

getOperationLimits

public OperationLimits getOperationLimits()
Returns:
the operation limits that the application uses

getRegisteredClasses

public RegisteredClasses getRegisteredClasses()
Returns the RegisteredClasses object of the application.


registerClass

public void registerClass(Class<? extends UaInstance> clazz)
                   throws AnnotationException
Register a class representing an UA Type. The registered classes are used when new instances are created.

Parameters:
clazz - The class to register. It must have the TypeDefinitionId annotation.
Throws:
AnnotationException - If the class does not have the TypeDefinitionId annotation.

registerClass

public void registerClass(Class<? extends UaInstance> clazz,
                          org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
Register a class representing an UA Type. The registered classes are used when new instances are created to the application's address space.

Parameters:
clazz - the class
typeDefinitionId - the TypeDefinitionId of the type

registerClass

public void registerClass(Class<? extends UaInstance> clazz,
                          org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
Register a class representing an UA Type. The registered classes are used when new instances are created to the application's address space.

Parameters:
clazz - the class
typeDefinitionId - the TypeDefinitionId of the type

registerClasses

public void registerClasses(Collection<Class<? extends UaInstance>> classes)
Register given classes for the application. Classes must have the TypeDefinitionId annotation.

Parameters:
classes - that are registered

setCertificateValidator

public void setCertificateValidator(org.opcfoundation.ua.transport.security.CertificateValidator certificateValidator)
Define a certificate validator that checks the server certificate after connect.

Parameters:
certificateValidator -

setOperationLimits

public void setOperationLimits(OperationLimits operationLimits)
Define the operation limits for the application

Parameters:
operationLimits -

registerModelInternal

protected void registerModelInternal(CodegenModel codegenModel)
Register an information model to use in the application. All the types in the model are then available for the application, when it constructs new instances.

Parameters:
codegenModel - the InformationModel created by the codegen.

validateApplicationCertificate

protected org.opcfoundation.ua.builtintypes.StatusCode validateApplicationCertificate(ApplicationIdentity applicationIdentity)
Parameters:
applicationIdentity - the certificate to validate
Returns:
The validation result, if the certificate is valid or there is no validator, returns a good StatusCode. If the certificate is not valid returns a bad StatusCode.


Copyright © 2018. All rights reserved.