blob: 47d1e8fd90ed0f387879c95471f75d0c368b266f [file] [log] [blame]
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
namespace BaSys40.Models.Connectivity
{
public class OpcUaEndpoint : IEndpoint
{
public string Address { get; }
[IgnoreDataMember]
public string BrowsePath { get; }
[IgnoreDataMember]
public string Authority { get; }
public string Type => EndpointType.OPC_UA;
public IEndpointSecurity Security { get; set; }
[JsonConstructor]
public OpcUaEndpoint(string address)
{
Address = address ?? throw new ArgumentNullException("address");
var uri = new Uri(address);
BrowsePath = uri.AbsolutePath;
Authority = uri.Authority;
}
}
}