mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-28 14:09:56 +08:00
Set DefaultEncodingId in DataTypeDefinition, was always null NodeId (#1523)
- DefaultEncodingId is always set to binary encoding id. Helper added to StructureDefinition for other use cases (e.g. PubSub) - the default encoding id is derived for the encodeable factory, since the typetree does not contain sufficent information to find the proper binary encoding id - add a few helper functions in core for an upcoming PR that was used for testing with custom types, will simplify to add more nodemanagers to servers with custom types
This commit is contained in:
@@ -33,11 +33,24 @@ using System.Text;
|
||||
|
||||
namespace Opc.Ua.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface to an object that creates a INodeManager object.
|
||||
/// </summary>
|
||||
public interface INodeManagerFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// The INodeManager factory.
|
||||
/// </summary>
|
||||
/// <param name="server">The server instance.</param>
|
||||
/// <param name="configuration">The application configuration.</param>
|
||||
INodeManager Create(IServerInternal server, ApplicationConfiguration configuration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An interface to an object that manages a set of nodes in the address space.
|
||||
/// </summary>
|
||||
public interface INodeManager
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the NamespaceUris for the Nodes belonging to the NodeManager.
|
||||
/// </summary>
|
||||
@@ -61,8 +74,8 @@ namespace Opc.Ua.Server
|
||||
/// by other node managers. In these cases, the node managers only manage one half of those references. The
|
||||
/// other half of the reference should be returned to the MasterNodeManager.
|
||||
/// </remarks>
|
||||
void CreateAddressSpace(IDictionary<NodeId,IList<IReference>> externalReferences);
|
||||
|
||||
void CreateAddressSpace(IDictionary<NodeId, IList<IReference>> externalReferences);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the address by releasing all resources and disconnecting from any underlying system.
|
||||
/// </summary>
|
||||
@@ -85,17 +98,17 @@ namespace Opc.Ua.Server
|
||||
/// <remarks>
|
||||
/// The node manager checks the dictionary for nodes that it owns and ensures the associated references exist.
|
||||
/// </remarks>
|
||||
void AddReferences(IDictionary<NodeId,IList<IReference>> references);
|
||||
|
||||
void AddReferences(IDictionary<NodeId, IList<IReference>> references);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reference.
|
||||
/// </summary>
|
||||
ServiceResult DeleteReference(
|
||||
object sourceHandle,
|
||||
NodeId referenceTypeId,
|
||||
bool isInverse,
|
||||
ExpandedNodeId targetId,
|
||||
bool deleteBidirectional);
|
||||
object sourceHandle,
|
||||
NodeId referenceTypeId,
|
||||
bool isInverse,
|
||||
ExpandedNodeId targetId,
|
||||
bool deleteBidirectional);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the metadata associated with the node.
|
||||
@@ -125,8 +138,8 @@ namespace Opc.Ua.Server
|
||||
/// <exception cref="ArgumentNullException">Thrown if the context, continuationPoint or references parameters are null.</exception>
|
||||
/// <exception cref="ServiceResultException">Thrown if an error occurs during processing.</exception>
|
||||
void Browse(
|
||||
OperationContext context,
|
||||
ref ContinuationPoint continuationPoint,
|
||||
OperationContext context,
|
||||
ref ContinuationPoint continuationPoint,
|
||||
IList<ReferenceDescription> references);
|
||||
|
||||
/// <summary>
|
||||
@@ -146,11 +159,11 @@ namespace Opc.Ua.Server
|
||||
/// </remarks>
|
||||
/// <exception cref="ArgumentNullException">Thrown if the sourceHandle, relativePath or targetIds parameters are null.</exception>
|
||||
void TranslateBrowsePath(
|
||||
OperationContext context,
|
||||
object sourceHandle,
|
||||
RelativePathElement relativePath,
|
||||
OperationContext context,
|
||||
object sourceHandle,
|
||||
RelativePathElement relativePath,
|
||||
IList<ExpandedNodeId> targetIds,
|
||||
IList<NodeId> unresolvedTargetIds);
|
||||
IList<NodeId> unresolvedTargetIds);
|
||||
|
||||
/// <summary>
|
||||
/// Reads the attribute values for a set of nodes.
|
||||
@@ -170,23 +183,23 @@ namespace Opc.Ua.Server
|
||||
/// The node manager must set the Processed flag for any ReadValueId that it processes.
|
||||
/// </remarks>
|
||||
void Read(
|
||||
OperationContext context,
|
||||
double maxAge,
|
||||
IList<ReadValueId> nodesToRead,
|
||||
IList<DataValue> values,
|
||||
OperationContext context,
|
||||
double maxAge,
|
||||
IList<ReadValueId> nodesToRead,
|
||||
IList<DataValue> values,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reads the history of a set of items.
|
||||
/// </summary>
|
||||
void HistoryRead(
|
||||
OperationContext context,
|
||||
HistoryReadDetails details,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
bool releaseContinuationPoints,
|
||||
IList<HistoryReadValueId> nodesToRead,
|
||||
IList<HistoryReadResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
OperationContext context,
|
||||
HistoryReadDetails details,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
bool releaseContinuationPoints,
|
||||
IList<HistoryReadValueId> nodesToRead,
|
||||
IList<HistoryReadResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
/// <summary>
|
||||
/// Writes a set of values.
|
||||
@@ -196,28 +209,28 @@ namespace Opc.Ua.Server
|
||||
/// must set the Processed flag in the WriteValue structure.
|
||||
/// </remarks>
|
||||
void Write(
|
||||
OperationContext context,
|
||||
IList<WriteValue> nodesToWrite,
|
||||
OperationContext context,
|
||||
IList<WriteValue> nodesToWrite,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates the history for a set of nodes.
|
||||
/// </summary>
|
||||
void HistoryUpdate(
|
||||
OperationContext context,
|
||||
Type detailsType,
|
||||
IList<HistoryUpdateDetails> nodesToUpdate,
|
||||
IList<HistoryUpdateResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
OperationContext context,
|
||||
Type detailsType,
|
||||
IList<HistoryUpdateDetails> nodesToUpdate,
|
||||
IList<HistoryUpdateResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
/// <summary>
|
||||
/// Calls a method defined on a object.
|
||||
/// </summary>
|
||||
void Call(
|
||||
OperationContext context,
|
||||
OperationContext context,
|
||||
IList<CallMethodRequest> methodsToCall,
|
||||
IList<CallMethodResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
IList<CallMethodResult> results,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
/// <summary>
|
||||
/// Tells the NodeManager to report events from the specified notifier.
|
||||
@@ -226,13 +239,13 @@ namespace Opc.Ua.Server
|
||||
/// This method may be called multiple times for the name monitoredItemId if the
|
||||
/// context for that MonitoredItem changes (i.e. UserIdentity and/or Locales).
|
||||
/// </remarks>
|
||||
ServiceResult SubscribeToEvents(
|
||||
OperationContext context,
|
||||
object sourceId,
|
||||
uint subscriptionId,
|
||||
ServiceResult SubscribeToEvents(
|
||||
OperationContext context,
|
||||
object sourceId,
|
||||
uint subscriptionId,
|
||||
IEventMonitoredItem monitoredItem,
|
||||
bool unsubscribe);
|
||||
|
||||
bool unsubscribe);
|
||||
|
||||
/// <summary>
|
||||
/// Tells the NodeManager to report events all events from all sources.
|
||||
/// </summary>
|
||||
@@ -240,64 +253,64 @@ namespace Opc.Ua.Server
|
||||
/// This method may be called multiple times for the name monitoredItemId if the
|
||||
/// context for that MonitoredItem changes (i.e. UserIdentity and/or Locales).
|
||||
/// </remarks>
|
||||
ServiceResult SubscribeToAllEvents(
|
||||
OperationContext context,
|
||||
uint subscriptionId,
|
||||
ServiceResult SubscribeToAllEvents(
|
||||
OperationContext context,
|
||||
uint subscriptionId,
|
||||
IEventMonitoredItem monitoredItem,
|
||||
bool unsubscribe);
|
||||
|
||||
bool unsubscribe);
|
||||
|
||||
/// <summary>
|
||||
/// Tells the NodeManager to refresh any conditions.
|
||||
/// </summary>
|
||||
ServiceResult ConditionRefresh(
|
||||
OperationContext context,
|
||||
ServiceResult ConditionRefresh(
|
||||
OperationContext context,
|
||||
IList<IEventMonitoredItem> monitoredItems);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a set of monitored items.
|
||||
/// </summary>
|
||||
void CreateMonitoredItems(
|
||||
OperationContext context,
|
||||
uint subscriptionId,
|
||||
double publishingInterval,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
OperationContext context,
|
||||
uint subscriptionId,
|
||||
double publishingInterval,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
IList<MonitoredItemCreateRequest> itemsToCreate,
|
||||
IList<ServiceResult> errors,
|
||||
IList<MonitoringFilterResult> filterErrors,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
ref long globalIdCounter);
|
||||
|
||||
IList<ServiceResult> errors,
|
||||
IList<MonitoringFilterResult> filterErrors,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
ref long globalIdCounter);
|
||||
|
||||
/// <summary>
|
||||
/// Modifies a set of monitored items.
|
||||
/// </summary>
|
||||
void ModifyMonitoredItems(
|
||||
OperationContext context,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
OperationContext context,
|
||||
TimestampsToReturn timestampsToReturn,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
IList<MonitoredItemModifyRequest> itemsToModify,
|
||||
IList<ServiceResult> errors,
|
||||
IList<MonitoringFilterResult> filterErrors);
|
||||
IList<ServiceResult> errors,
|
||||
IList<MonitoringFilterResult> filterErrors);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a set of monitored items.
|
||||
/// </summary>
|
||||
void DeleteMonitoredItems(
|
||||
OperationContext context,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
IList<bool> processedItems,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
OperationContext context,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
IList<bool> processedItems,
|
||||
IList<ServiceResult> errors);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the monitoring mode for a set of monitored items.
|
||||
/// </summary>
|
||||
void SetMonitoringMode(
|
||||
OperationContext context,
|
||||
MonitoringMode monitoringMode,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
IList<bool> processedItems,
|
||||
IList<ServiceResult> errors);
|
||||
OperationContext context,
|
||||
MonitoringMode monitoringMode,
|
||||
IList<IMonitoredItem> monitoredItems,
|
||||
IList<bool> processedItems,
|
||||
IList<ServiceResult> errors);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// An interface to an object that manages a set of nodes in the address space.
|
||||
/// </summary>
|
||||
@@ -328,7 +341,7 @@ namespace Opc.Ua.Server
|
||||
Dictionary<NodeId, List<object>> uniqueNodesServiceAttributesCache,
|
||||
bool permissionsOnly);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stores metadata required to process requests related to a node.
|
||||
/// </summary>
|
||||
@@ -344,7 +357,7 @@ namespace Opc.Ua.Server
|
||||
m_nodeId = nodeId;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// The handle assigned by the NodeManager that owns the Node.
|
||||
@@ -360,14 +373,14 @@ namespace Opc.Ua.Server
|
||||
public NodeId NodeId
|
||||
{
|
||||
get { return m_nodeId; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The NodeClass for the Node.
|
||||
/// </summary>
|
||||
public NodeClass NodeClass
|
||||
{
|
||||
get { return m_nodeClass; }
|
||||
get { return m_nodeClass; }
|
||||
set { m_nodeClass = value; }
|
||||
}
|
||||
|
||||
@@ -376,7 +389,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public QualifiedName BrowseName
|
||||
{
|
||||
get { return m_browseName; }
|
||||
get { return m_browseName; }
|
||||
set { m_browseName = value; }
|
||||
}
|
||||
|
||||
@@ -385,7 +398,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public LocalizedText DisplayName
|
||||
{
|
||||
get { return m_displayName; }
|
||||
get { return m_displayName; }
|
||||
set { m_displayName = value; }
|
||||
}
|
||||
|
||||
@@ -394,7 +407,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public ExpandedNodeId TypeDefinition
|
||||
{
|
||||
get { return m_typeDefinition; }
|
||||
get { return m_typeDefinition; }
|
||||
set { m_typeDefinition = value; }
|
||||
}
|
||||
|
||||
@@ -403,7 +416,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public NodeId ModellingRule
|
||||
{
|
||||
get { return m_modellingRule; }
|
||||
get { return m_modellingRule; }
|
||||
set { m_modellingRule = value; }
|
||||
}
|
||||
|
||||
@@ -412,7 +425,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public AttributeWriteMask WriteMask
|
||||
{
|
||||
get { return m_writeMask; }
|
||||
get { return m_writeMask; }
|
||||
set { m_writeMask = value; }
|
||||
}
|
||||
|
||||
@@ -421,16 +434,16 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public byte EventNotifier
|
||||
{
|
||||
get { return m_eventNotifier; }
|
||||
get { return m_eventNotifier; }
|
||||
set { m_eventNotifier = value; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Whether the Node can be use to read or write current or historical values.
|
||||
/// </summary>
|
||||
public byte AccessLevel
|
||||
{
|
||||
get { return m_accessLevel; }
|
||||
get { return m_accessLevel; }
|
||||
set { m_accessLevel = value; }
|
||||
}
|
||||
|
||||
@@ -439,7 +452,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public bool Executable
|
||||
{
|
||||
get { return m_executable; }
|
||||
get { return m_executable; }
|
||||
set { m_executable = value; }
|
||||
}
|
||||
|
||||
@@ -448,7 +461,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public NodeId DataType
|
||||
{
|
||||
get { return m_dataType; }
|
||||
get { return m_dataType; }
|
||||
set { m_dataType = value; }
|
||||
}
|
||||
|
||||
@@ -457,7 +470,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public int ValueRank
|
||||
{
|
||||
get { return m_valueRank; }
|
||||
get { return m_valueRank; }
|
||||
set { m_valueRank = value; }
|
||||
}
|
||||
|
||||
@@ -466,7 +479,7 @@ namespace Opc.Ua.Server
|
||||
/// </summary>
|
||||
public IList<uint> ArrayDimensions
|
||||
{
|
||||
get { return m_arrayDimensions; }
|
||||
get { return m_arrayDimensions; }
|
||||
set { m_arrayDimensions = value; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user