Old SDK removed
New dotnet SDK added - Release
diff --git a/sdks/csnet/.gitignore b/sdks/csnet/.gitignore
deleted file mode 100644
index 339795b..0000000
--- a/sdks/csnet/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-## Visual Studio user settings
-.vs/
-
-## Visual Studio build artifacts
-bin/
-obj/
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedAssetAdministrationShell.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedAssetAdministrationShell.cs
deleted file mode 100644
index a994a2a..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedAssetAdministrationShell.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.API.Platform.Agents;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.API.ServiceProvider;
-using System.Collections.Generic;
-using System.Linq;
-using BaSys40.Models.Connectivity;
-
-namespace BaSys40.API.AssetAdministrationShell.Connectables
-{
- public class ConnectedAssetAdministrationShell : IConnectableAssetAdministrationShell
- {
- public IAssetAdministrationShell AssetAdministrationShell { get; private set; }
-
- public IServiceDescriptor ServiceDescriptor { get; private set; }
-
- private readonly IAssetAdministrationShellAgent serviceImpl;
- private Dictionary<string, ISubmodelServiceProvider> submodelServiceProviders;
-
- public ConnectedAssetAdministrationShell(IAssetAdministrationShellAgent service)
- {
- serviceImpl = service;
- submodelServiceProviders = new Dictionary<string, ISubmodelServiceProvider>();
- }
-
- public void BindTo(IAssetAdministrationShell element)
- {
- AssetAdministrationShell = element;
- }
-
- public IAssetAdministrationShell GetBinding()
- {
- return AssetAdministrationShell;
- }
-
- public IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
- {
- return serviceImpl.CreateSubmodel(AssetAdministrationShell.IdShort, submodel);
- }
-
- public IResult DeleteSubmodel(string submodelId)
- {
- return serviceImpl.DeleteSubmodel(AssetAdministrationShell.IdShort, submodelId);
- }
-
- public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
- {
- return serviceImpl.RetrieveSubmodel(AssetAdministrationShell.IdShort, submodelId);
- }
-
- public IResult<ElementContainer<ISubmodel>> RetrieveSubmodels()
- {
- return serviceImpl.RetrieveSubmodels(AssetAdministrationShell.IdShort);
- }
-
- public void RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider)
- {
- submodelServiceProviders.Add(id, submodelServiceProvider);
- }
-
- public ISubmodelServiceProvider GetSubmodelServiceProvider(string id)
- {
- if (submodelServiceProviders.TryGetValue(id, out ISubmodelServiceProvider submodelServiceProvider))
- return submodelServiceProvider;
- else
- return null;
- }
-
- public IEnumerable<ISubmodelServiceProvider> GetSubmodelServiceProviders()
- {
- return submodelServiceProviders.Values?.ToList();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedDataElement.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedDataElement.cs
deleted file mode 100644
index bafdcb9..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedDataElement.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using BaSys40.API.Platform.Agents;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-
-namespace BaSys40.API.AssetAdministrationShell.Connectables
-{
- public class ConnectedDataElement : IConnectableDataElement
- {
- public IDataElement DataElement { get; }
- public IAssetAdministrationShell AssetAdministrationShell { get; }
- public ISubmodel Submodel { get; }
-
- public event SetDataElementValueEventHandler SetDataElementValueHandler;
- public event GetDataElementValueEventHandler GetDataElementValueHandler;
-
- private readonly ISubmodelAgent serviceImpl;
-
- public ConnectedDataElement(ISubmodelAgent service, IAssetAdministrationShell aas, ISubmodel submodel, IDataElement dataElement)
- {
- AssetAdministrationShell = aas;
- Submodel = submodel;
- DataElement = dataElement;
-
- serviceImpl = service;
- }
-
- public IValue GetLocalValue()
- {
- var result = GetDataElementValueHandler?.Invoke(this);
- return result;
- }
-
- public void SetLocalValue(IValue value)
- {
- SetDataElementValueHandler?.Invoke(this, value);
- }
-
- public IValue GetRemoteValue()
- {
- var result = serviceImpl.RetrieveDataElementValue(AssetAdministrationShell.IdShort, Submodel.IdShort, DataElement.IdShort);
- return result.Entity;
- }
-
- public void SetRemoteValue(IValue value)
- {
- serviceImpl.UpdateDataElementValue(AssetAdministrationShell.IdShort, Submodel.IdShort, DataElement.IdShort, value);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedEvent.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedEvent.cs
deleted file mode 100644
index f2e2012..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedEvent.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-using BaSys40.API.Platform.Agents;
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-
-namespace BaSys40.API.AssetAdministrationShell.Connectables
-{
- public class ConnectedEvent : IConnectableEvent
- {
- public IEvent Event { get; }
- public IAssetAdministrationShell AssetAdministrationShell { get; }
- public ISubmodel Submodel { get; }
-
- public event EventHandler EventHandler;
-
- private readonly ISubmodelAgent serviceImpl;
-
- public ConnectedEvent(ISubmodelAgent service, IAssetAdministrationShell aas, ISubmodel submodel, IEvent eventDescription)
- {
- AssetAdministrationShell = aas;
- Submodel = submodel;
- Event = eventDescription;
- serviceImpl = service;
- }
-
- public void Invoke(IPublishableEvent publishableEvent)
- {
- EventHandler?.Invoke(this, publishableEvent);
- }
-
- public void Publish(IPublishableEvent publishableEvent, byte qosLevel)
- {
- EventHandler?.Invoke(this, publishableEvent);
- }
-
- public void Subscribe(string subscriberId, string subscriberEndpoint, EventHandler eventHandler, byte qosLevel)
- {
- if(EventHandler == null)
- EventHandler += eventHandler;
- }
-
- public void Unsubscribe(string subscriberId)
- {
- EventHandler = null;
- }
-
- public bool Validate(IPublishableEvent eventToValidate)
- {
- if (!string.IsNullOrEmpty(Event.DataType.Schema))
- {
- if (Event.DataType.SchemaType.HasValue && Event.DataType.SchemaType.Value == SchemaType.XSD)
- {
- using (var stream = GenerateStreamFromString(Event.DataType.Schema))
- {
- XmlSchema schema = XmlSchema.Read(stream, SchemaValidationEventHandler);
- XmlDocument message = new XmlDocument();
- message.Schemas.Add(schema);
- message.LoadXml(eventToValidate.Message);
- try
- {
- message.Validate(SchemaValidationEventHandler);
- return true;
- }
- catch
- {
- return false;
- }
- }
- }
- return false;
- }
- else
- return true;
- }
-
- private void SchemaValidationEventHandler(object sender, ValidationEventArgs e)
- {
- if (e.Severity == XmlSeverityType.Error)
- throw new XmlSchemaValidationException(e.Message);
- }
-
- public static Stream GenerateStreamFromString(string s)
- {
- var stream = new MemoryStream();
- var writer = new StreamWriter(stream);
- writer.Write(s);
- writer.Flush();
- stream.Position = 0;
- return stream;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedOperation.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedOperation.cs
deleted file mode 100644
index 0503374..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedOperation.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using BaSys40.API.Platform.Agents;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.AssetAdministrationShell.Connectables
-{
- public class ConnectedOperation : IConnectableOperation
- {
- public IOperation Operation { get; }
- public IAssetAdministrationShell AssetAdministrationShell { get; }
- public ISubmodel Submodel { get; }
-
- public event MethodCalledEventHandler OnCallMethod;
-
- private readonly ISubmodelAgent serviceImpl;
-
- public ConnectedOperation(ISubmodelAgent service, IAssetAdministrationShell aas, ISubmodel submodel, IOperation operation)
- {
- AssetAdministrationShell = aas;
- Submodel = submodel;
- Operation = operation;
-
- serviceImpl = service;
- }
-
- public IResult InvokeLocal(List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- object result;
- if (OnCallMethod != null)
- result = OnCallMethod.Invoke(this, inputArguments, outputArguments);
- else
- {
- result = null;
- outputArguments = null;
- }
- return new Result(result != null, result, result?.GetType());
- }
-
- public IResult InvokeRemote(List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- var result = serviceImpl.InvokeOperation(AssetAdministrationShell.IdShort, Submodel.IdShort, Operation.IdShort, inputArguments, outputArguments, timeout);
- return result;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedSubModel.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedSubModel.cs
deleted file mode 100644
index dc57a54..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/Connectables/ConnectedSubModel.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.API.Platform.Agents;
-using System.Collections.Generic;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.Client;
-using System;
-using System.Reflection;
-using System.Linq.Expressions;
-using System.Linq;
-using Newtonsoft.Json;
-using BaSys40.Models.Connectivity;
-
-namespace BaSys40.API.AssetAdministrationShell.Connectables
-{
- public class ConnectedSubmodel : IConnectableSubmodel
- {
- public ISubmodel Submodel { get; private set; }
- private IAssetAdministrationShell AssetAdministrationShell { get; }
- private IMessageClient messageClient;
-
- private readonly ISubmodelAgent submodelServiceImpl;
- private Dictionary<string, Delegate> methodCalledHandler;
- private Dictionary<string, DataElementHandler> dataElementHandler;
- private Dictionary<string, Action<IValue>> updateFunctions;
-
- public IServiceDescriptor ServiceDescriptor { get; private set; }
-
- public ConnectedSubmodel(ISubmodelAgent submodelService, IAssetAdministrationShell aas)
- {
- AssetAdministrationShell = aas;
- submodelServiceImpl = submodelService;
- methodCalledHandler = new Dictionary<string, Delegate>();
- dataElementHandler = new Dictionary<string, DataElementHandler>();
- updateFunctions = new Dictionary<string, Action<IValue>>();
- }
-
- public void BindTo(ISubmodel element)
- {
- Submodel = element;
- }
-
- public ISubmodel GetBinding()
- {
- return Submodel;
- }
-
- public IResult<IEvent> CreateEvent(IEvent eventable)
- {
- return submodelServiceImpl.CreateEvent(AssetAdministrationShell.IdShort, Submodel.IdShort, eventable);
- }
-
- public IResult<IOperation> CreateOperation(IOperation operation)
- {
- return submodelServiceImpl.CreateOperation(AssetAdministrationShell.IdShort, Submodel.IdShort, operation);
- }
-
- public IResult<IDataElement> CreateDataElement(IDataElement property)
- {
- return submodelServiceImpl.CreateDataElement(AssetAdministrationShell.IdShort, Submodel.IdShort, property);
- }
-
- public IResult DeleteEvent(string eventId)
- {
- return submodelServiceImpl.DeleteEvent(AssetAdministrationShell.IdShort, Submodel.IdShort, eventId);
- }
-
- public IResult DeleteOperation(string operationId)
- {
- return submodelServiceImpl.DeleteOperation(AssetAdministrationShell.IdShort, Submodel.IdShort, operationId);
- }
-
- public IResult DeleteDataElement(string dataElementId)
- {
- return submodelServiceImpl.DeleteDataElement(AssetAdministrationShell.IdShort, Submodel.IdShort, dataElementId);
- }
-
- public IResult<IEvent> RetrieveEvent(string eventId)
- {
- return submodelServiceImpl.RetrieveEvent(AssetAdministrationShell.IdShort, Submodel.IdShort, eventId);
- }
-
- public IResult<ElementContainer<IEvent>> RetrieveEvents()
- {
- return submodelServiceImpl.RetrieveEvents(AssetAdministrationShell.IdShort, Submodel.IdShort);
- }
-
- public IResult<IOperation> RetrieveOperation(string operationId)
- {
- return submodelServiceImpl.RetrieveOperation(AssetAdministrationShell.IdShort, Submodel.IdShort, operationId);
- }
-
- public IResult<ElementContainer<IOperation>> RetrieveOperations()
- {
- return submodelServiceImpl.RetrieveOperations(AssetAdministrationShell.IdShort, Submodel.IdShort);
- }
-
- public IResult<ElementContainer<IDataElement>> RetrieveDataElements()
- {
- return submodelServiceImpl.RetrieveDataElements(AssetAdministrationShell.IdShort, Submodel.IdShort);
- }
-
- public IResult<IDataElement> RetrieveDataElement(string dataElementId)
- {
- return submodelServiceImpl.RetrieveDataElement(AssetAdministrationShell.IdShort, Submodel.IdShort, dataElementId);
- }
-
- public IResult<IValue> RetrieveDataElementValue(string dataElementId)
- {
- return submodelServiceImpl.RetrieveDataElementValue(AssetAdministrationShell.IdShort, Submodel.IdShort, dataElementId);
- }
-
- public IResult UpdateDataElementValue(string dataElementId, IValue value)
- {
- return submodelServiceImpl.UpdateDataElementValue(AssetAdministrationShell.IdShort, Submodel.IdShort, dataElementId, value);
- }
-
- public IResult InvokeOperation(string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- return submodelServiceImpl.InvokeOperation(AssetAdministrationShell.IdShort, Submodel.IdShort, operationId, inputArguments, outputArguments, timeout);
- }
- public DataElementHandler RetrieveDataElementHandler(string dataElementId)
- {
- if (dataElementHandler.TryGetValue(dataElementId, out DataElementHandler handler))
- return handler;
- else
- return null;
- }
-
- public void RegisterDataElementHandler(string dataElementId, DataElementHandler handler)
- {
- if (!dataElementHandler.ContainsKey(dataElementId))
- dataElementHandler.Add(dataElementId, handler);
- else
- dataElementHandler[dataElementId] = handler;
- }
-
- public void RegisterMethodCalledHandler(string operationId, MethodCalledHandler handler)
- {
- if (!methodCalledHandler.ContainsKey(operationId))
- methodCalledHandler.Add(operationId, handler);
- else
- methodCalledHandler[operationId] = handler;
- }
- public void RegisterMethodCalledHandler(string operationId, Delegate handler)
- {
- if (!methodCalledHandler.ContainsKey(operationId))
- methodCalledHandler.Add(operationId, handler);
- else
- methodCalledHandler[operationId] = handler;
- }
-
- public void RegisterMethodCalledHandler(string operationId, MethodInfo methodInfo, object target)
- {
- var parameters = from parameter in methodInfo.GetParameters() select parameter.ParameterType;
- Delegate del = methodInfo.CreateDelegate(Expression.GetDelegateType(parameters.Concat(new[] { methodInfo.ReturnType }).ToArray()), target);
- RegisterMethodCalledHandler(operationId, del);
- }
-
- public IResult ThrowEvent(IPublishableEvent publishableEvent, string topic, Action<IMessagePublishedEventArgs> MessagePublished, byte qosLevel)
- {
- var settings = new JsonSerializerSettings()
- {
- Formatting = Formatting.Indented,
- NullValueHandling = NullValueHandling.Ignore,
- };
- settings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
-
- string message = JsonConvert.SerializeObject(publishableEvent, settings);
- return messageClient.Publish(topic, message, MessagePublished, qosLevel);
- }
-
- public void ConfigureEventHandler(IMessageClient messageClient)
- {
- this.messageClient = messageClient;
- }
- public Delegate RetrieveMethodDelegate(string operationId)
- {
- if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
- return handler;
- else
- return null;
- }
- public MethodCalledHandler RetrieveMethodCalledHandler(string operationId)
- {
- if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
- return (MethodCalledHandler)handler;
- else
- return null;
- }
- public virtual void SubscribeUpdates(string dataElementId, Action<IValue> updateFunction)
- {
- if (!updateFunctions.ContainsKey(dataElementId))
- updateFunctions.Add(dataElementId, updateFunction);
- else
- updateFunctions[dataElementId] = updateFunction;
- }
-
- public virtual void PublishUpdate(string dataElementId, IValue value)
- {
- if (updateFunctions.TryGetValue(dataElementId, out Action<IValue> updateFunction))
- updateFunction.Invoke(value);
-
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/DataElementHandler.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/DataElementHandler.cs
deleted file mode 100644
index 05538a2..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/DataElementHandler.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public delegate IValue GetDataElementValueEventHandler(IConnectableDataElement dataElement);
- public delegate void SetDataElementValueEventHandler(IConnectableDataElement dataElement, IValue value);
-
- public delegate IValue GetDataElementValueHandler(IDataElement dataElement);
- public delegate void SetDataElementValueHandler(IDataElement dataElement, IValue value);
-
- public class DataElementHandler
- {
- public string IdShort { get; }
- public GetDataElementValueHandler GetHandler { get; }
- public SetDataElementValueHandler SetHandler { get; private set; }
- public DataElementHandler(string idShort, GetDataElementValueHandler getHandler, SetDataElementValueHandler setHandler)
- {
- IdShort = idShort;
- GetHandler = getHandler;
- SetHandler = setHandler;
- }
- }
-
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/EventHandler.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/EventHandler.cs
deleted file mode 100644
index 8332359..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/EventHandler.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public delegate void EventHandler(IConnectableEvent connectableEvent, IPublishableEvent publishableEvent);
-
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableAssetAdministrationShell.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableAssetAdministrationShell.cs
deleted file mode 100644
index d635646..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableAssetAdministrationShell.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using BaSys40.API.ServiceProvider;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public interface IConnectableAssetAdministrationShell : IAssetAdministrationShellServiceProvider
- { }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableDataElement.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableDataElement.cs
deleted file mode 100644
index 4346f15..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableDataElement.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public interface IConnectableDataElement
- {
- IAssetAdministrationShell AssetAdministrationShell { get; }
- ISubmodel Submodel { get; }
- IDataElement DataElement { get; }
-
- event SetDataElementValueEventHandler SetDataElementValueHandler;
- event GetDataElementValueEventHandler GetDataElementValueHandler;
-
- IValue GetLocalValue();
- void SetLocalValue(IValue value);
- IValue GetRemoteValue();
- void SetRemoteValue(IValue value);
-
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableEvent.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableEvent.cs
deleted file mode 100644
index 8ee910a..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableEvent.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public interface IConnectableEvent
- {
- IAssetAdministrationShell AssetAdministrationShell { get; }
- ISubmodel Submodel { get; }
- IEvent Event { get; }
-
- event EventHandler EventHandler;
-
- void Invoke(IPublishableEvent publishableEvent);
-
- void Publish(IPublishableEvent publishableEvent, byte qosLevel);
-
- void Subscribe(string subscriberId, string subscriberEndpoint, EventHandler eventHandler, byte qosLevel);
-
- void Unsubscribe(string subscriberId);
-
- bool Validate(IPublishableEvent eventToValidate);
-
- string ToString();
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableOperation.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableOperation.cs
deleted file mode 100644
index 7b1d0c3..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableOperation.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public interface IConnectableOperation
- {
- IAssetAdministrationShell AssetAdministrationShell { get; }
- ISubmodel Submodel { get; }
- IOperation Operation { get; }
-
- event MethodCalledEventHandler OnCallMethod;
-
- IResult InvokeLocal(List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout);
- IResult InvokeRemote(List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout);
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableSubModel.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableSubModel.cs
deleted file mode 100644
index 7b58891..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/IConnectableSubModel.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using BaSys40.API.ServiceProvider;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public interface IConnectableSubmodel : ISubmodelServiceProvider
- {
-
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/MethodCalledEventHandler.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/MethodCalledEventHandler.cs
deleted file mode 100644
index 0c9f813..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/MethodCalledEventHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using System;
-using System.Collections.Generic;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public delegate OperationResult MethodCalledEventHandler(IConnectableOperation operation, List<IArgument> inputArguments, List<IArgument> outputArguments);
-
- public delegate OperationResult MethodCalledHandler(IOperation operation, List<IArgument> inputArguments, List<IArgument> outputArguments);
-
- public class OperationResult : Result
- {
- public OperationResult(bool success) : this(success, null)
- {}
- public OperationResult(Exception e) : base(e)
- { }
- public OperationResult(bool success, List<IMessage> messages) : base(success, messages)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/AssetAdministrationShell/PublishableEvent.cs b/sdks/csnet/BaSys40.API/AssetAdministrationShell/PublishableEvent.cs
deleted file mode 100644
index 411ab09..0000000
--- a/sdks/csnet/BaSys40.API/AssetAdministrationShell/PublishableEvent.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using BaSys40.Models.Core;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-
-namespace BaSys40.API.AssetAdministrationShell
-{
- public class PublishableEvent : IPublishableEvent
- {
- public string TimeStamp { get; set; }
-
- public string Message { get; set; }
-
- public string Originator { get; set; }
-
- public Identifier Identification { get; set; }
-
- public Reference<IEvent> EventDescriptionReference { get; set; }
-
- public List<Description> Descriptions { get; set; }
-
- public string DisplayName { get; set; }
- public IReference Parent { get; set; }
-
- public Dictionary<string, string> MetaData { get; set; }
-
- public AdministrativeInformation Administration { get; set; }
- public string IdShort { get; set; }
-
- public string Category { get; set; }
-
- public ModelType ModelElementType => ModelType.Event;
-
- }
-}
diff --git a/sdks/csnet/BaSys40.API/BaSys40.API.csproj b/sdks/csnet/BaSys40.API/BaSys40.API.csproj
deleted file mode 100644
index 194c741..0000000
--- a/sdks/csnet/BaSys40.API/BaSys40.API.csproj
+++ /dev/null
@@ -1,18 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>Full</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.Models\BaSys40.Models.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.API/Components/ComponentAggregatorServiceProvider.cs b/sdks/csnet/BaSys40.API/Components/ComponentAggregatorServiceProvider.cs
deleted file mode 100644
index 252a34a..0000000
--- a/sdks/csnet/BaSys40.API/Components/ComponentAggregatorServiceProvider.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace BaSys40.API.Components
-{
- public class ComponentAggregatorServiceProvider : IAssetAdministrationShellAggregatorServiceProvider
- {
- public IEnumerable<IAssetAdministrationShell> AssetAdministrationShells { get; protected set; }
-
- private Dictionary<string, IAssetAdministrationShellServiceProvider> AssetAdministrationShellServiceProviders { get; } = new Dictionary<string, IAssetAdministrationShellServiceProvider>();
-
- public IServiceDescriptor ServiceDescriptor { get; private set; }
-
- public ComponentAggregatorServiceProvider()
- {
- AssetAdministrationShells = new List<IAssetAdministrationShell>();
- }
-
- public void BindTo(IEnumerable<IAssetAdministrationShell> element)
- {
- AssetAdministrationShells = element;
- }
- public IEnumerable<IAssetAdministrationShell> GetBinding()
- {
- return AssetAdministrationShells;
- }
-
- public IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas)
- {
- AssetAdministrationShells.ToList().Add(aas);
- return new Result<IAssetAdministrationShell>(true, aas);
- }
-
- public IResult DeleteAssetAdministrationShell(string aasId)
- {
- AssetAdministrationShells.ToList().RemoveAll(a => a.IdShort == aasId);
- return new Result(true);
- }
-
- public IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id)
- {
- if (AssetAdministrationShellServiceProviders.TryGetValue(id, out IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider))
- return assetAdministrationShellServiceProvider;
- else
- return null;
- }
-
- public IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders()
- {
- return AssetAdministrationShellServiceProviders?.Values.ToList();
- }
-
- public void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
- {
- AssetAdministrationShellServiceProviders.Add(id, assetAdministrationShellServiceProvider);
- }
-
- public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId)
- {
- var aas = AssetAdministrationShells.ToList().Find(a => a.IdShort == aasId);
- if (aas != null)
- return new Result<IAssetAdministrationShell>(true, aas);
- else
- return new Result<IAssetAdministrationShell>(false, new Message(MessageType.Error, "Not found"));
- }
-
- public IResult<List<IAssetAdministrationShell>> RetrieveAssetAdministrationShells()
- {
- return new Result<List<IAssetAdministrationShell>>(true, AssetAdministrationShells.ToList());
- }
-
- public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas)
- {
- int i = AssetAdministrationShells.ToList().FindIndex(a => a.IdShort == aas.IdShort);
- if (i >= 0)
- {
- AssetAdministrationShells.ToList()[i] = aas;
- return new Result<List<IAssetAdministrationShell>>(true);
- }
- return new Result(false, new Message(MessageType.Error, "Not found"));
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Components/ComponentAssetAdministrationShellServiceProvider.cs b/sdks/csnet/BaSys40.API/Components/ComponentAssetAdministrationShellServiceProvider.cs
deleted file mode 100644
index 32ebb52..0000000
--- a/sdks/csnet/BaSys40.API/Components/ComponentAssetAdministrationShellServiceProvider.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace BaSys40.API.Components
-{
- public abstract class ComponentAssetAdministrationShellServiceProvider : IAssetAdministrationShellServiceProvider
- {
- public abstract IAssetAdministrationShell AssetAdministrationShell { get; protected set; }
- private Dictionary<string, ISubmodelServiceProvider> SubmodelServiceProviders { get; } = new Dictionary<string, ISubmodelServiceProvider>();
- public IServiceDescriptor ServiceDescriptor { get; private set; }
-
- public ComponentAssetAdministrationShellServiceProvider(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) : this()
- {
- ServiceDescriptor = assetAdministrationShellDescriptor;
- }
- public ComponentAssetAdministrationShellServiceProvider(IAssetAdministrationShell assetAdministrationShell)
- {
- BindTo(assetAdministrationShell);
- }
-
- public ComponentAssetAdministrationShellServiceProvider()
- {
- AssetAdministrationShell = GenerateAssetAdministrationShell();
- BindTo(AssetAdministrationShell);
- }
-
- public virtual void RegisterSubmodelServiceProvider(string submodelId, ISubmodelServiceProvider submodelServiceProvider)
- {
- SubmodelServiceProviders.Add(submodelId, submodelServiceProvider);
- }
- public virtual ISubmodelServiceProvider GetSubmodelServiceProvider(string submodelId)
- {
- if (SubmodelServiceProviders.TryGetValue(submodelId, out ISubmodelServiceProvider submodelServiceProvider))
- return submodelServiceProvider;
- else
- return null;
- }
-
- public abstract IAssetAdministrationShell GenerateAssetAdministrationShell();
-
- public virtual void BindTo(IAssetAdministrationShell element)
- {
- AssetAdministrationShell = element;
- }
- public virtual IAssetAdministrationShell GetBinding()
- {
- return AssetAdministrationShell;
- }
-
- public virtual IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
- {
- return AssetAdministrationShell.Submodels.Create(submodel);
- }
-
- public virtual IResult DeleteSubmodel(string submodelId)
- {
- return AssetAdministrationShell.Submodels.Delete(submodelId);
- }
-
- public virtual IResult<ISubmodel> RetrieveSubmodel(string submodelId)
- {
- return AssetAdministrationShell.Submodels.Retrieve(submodelId);
- }
-
- public virtual IResult<ElementContainer<ISubmodel>> RetrieveSubmodels()
- {
- return AssetAdministrationShell.Submodels.RetrieveAll();
- }
-
- public virtual IEnumerable<ISubmodelServiceProvider> GetSubmodelServiceProviders()
- {
- return SubmodelServiceProviders.Values?.ToList();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Components/ComponentSubModelServiceProvider.cs b/sdks/csnet/BaSys40.API/Components/ComponentSubModelServiceProvider.cs
deleted file mode 100644
index 79ac92f..0000000
--- a/sdks/csnet/BaSys40.API/Components/ComponentSubModelServiceProvider.cs
+++ /dev/null
@@ -1,259 +0,0 @@
-using BaSys40.API.AssetAdministrationShell;
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.Utils.Client;
-using System.Collections.Generic;
-using System;
-using Newtonsoft.Json;
-using System.Reflection;
-using System.Linq.Expressions;
-using System.Linq;
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell;
-
-namespace BaSys40.API.Components
-{
- public class ComponentSubmodelServiceProvider : ISubmodelServiceProvider
- {
-
- static ComponentSubmodelServiceProvider()
- {
- JsonSerializerSettings = new JsonSerializerSettings()
- {
- Formatting = Formatting.Indented,
- NullValueHandling = NullValueHandling.Ignore,
- };
- JsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
- }
- public static JsonSerializerSettings JsonSerializerSettings { get; set; }
-
- public ISubmodel Submodel { get; protected set; }
-
- public IServiceDescriptor ServiceDescriptor { get; internal set; }
-
- private Dictionary<string, Delegate> methodCalledHandler;
- private Dictionary<string, DataElementHandler> dataElementHandler;
- private Dictionary<string, Action<IValue>> updateFunctions;
- private IMessageClient messageClient;
-
- public ComponentSubmodelServiceProvider(SubmodelDescriptor submodelDescriptor) : this()
- {
- ServiceDescriptor = submodelDescriptor;
- }
-
- public ComponentSubmodelServiceProvider()
- {
- methodCalledHandler = new Dictionary<string, Delegate>();
- dataElementHandler = new Dictionary<string, DataElementHandler>();
- updateFunctions = new Dictionary<string, Action<IValue>>();
- }
-
- public ComponentSubmodelServiceProvider(ISubmodel submodel) : this()
- {
- BindTo(submodel);
- }
-
- public void BindTo(ISubmodel element)
- {
- Submodel = element;
- }
- public ISubmodel GetBinding()
- {
- return Submodel;
- }
-
- public IResult<IEvent> CreateEvent(IEvent eventable)
- {
- return Submodel.Events.Create(eventable);
- }
-
- public IResult<IOperation> CreateOperation(IOperation operation)
- {
- return Submodel.Operations.Create(operation);
- }
-
- public IResult<IDataElement> CreateDataElement(IDataElement property)
- {
- return Submodel.DataElements.Create(property);
- }
-
- public IResult DeleteEvent(string eventId)
- {
- return Submodel.Events.Delete(eventId);
- }
-
- public IResult DeleteOperation(string operationId)
- {
- return Submodel.Operations.Delete(operationId);
- }
-
- public IResult DeleteDataElement(string dataElementId)
- {
- return Submodel.DataElements.Delete(dataElementId);
- }
-
- public MethodCalledHandler RetrieveMethodCalledHandler(string operationId)
- {
- if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
- return (MethodCalledHandler)handler;
- else
- return null;
- }
-
- public Delegate RetrieveMethodDelegate(string operationId)
- {
- if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
- return handler;
- else
- return null;
- }
-
- public DataElementHandler RetrieveDataElementHandler(string dataElementId)
- {
- if (dataElementHandler.TryGetValue(dataElementId, out DataElementHandler handler))
- return handler;
- else
- return null;
- }
-
- public void RegisterDataElementHandler(string dataElementId, DataElementHandler handler)
- {
- if (!dataElementHandler.ContainsKey(dataElementId))
- dataElementHandler.Add(dataElementId, handler);
- else
- dataElementHandler[dataElementId] = handler;
- }
-
- public void RegisterMethodCalledHandler(string operationId, MethodCalledHandler handler)
- {
- if (!methodCalledHandler.ContainsKey(operationId))
- methodCalledHandler.Add(operationId, handler);
- else
- methodCalledHandler[operationId] = handler;
- }
-
- public void RegisterMethodCalledHandler(string operationId, Delegate handler)
- {
- if (!methodCalledHandler.ContainsKey(operationId))
- methodCalledHandler.Add(operationId, handler);
- else
- methodCalledHandler[operationId] = handler;
- }
-
- public void RegisterMethodCalledHandler(string operationId, MethodInfo methodInfo, object target)
- {
- var parameters = from parameter in methodInfo.GetParameters() select parameter.ParameterType;
- Delegate del = methodInfo.CreateDelegate(Expression.GetDelegateType(parameters.Concat(new[] { methodInfo.ReturnType }).ToArray()), target);
- RegisterMethodCalledHandler(operationId, del);
- }
-
- public IResult InvokeOperation(string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- var operation_Retrieved = RetrieveOperation(operationId);
- if (methodCalledHandler.TryGetValue(operationId, out Delegate handler) && operation_Retrieved.Success && operation_Retrieved.Entity != null)
- {
- var result = (IResult)handler.DynamicInvoke(operation_Retrieved.Entity, inputArguments, outputArguments);
- return result;
- }
- outputArguments = null;
- return operation_Retrieved;
- }
-
- public IResult ThrowEvent(IPublishableEvent publishableEvent, string topic = "/", Action<IMessagePublishedEventArgs> MessagePublished = null, byte qosLevel = 2)
- {
- if (messageClient == null || !messageClient.IsConnected)
- return new Result(false, new Message(MessageType.Warning, "MessageClient is not initialized or not connected"));
-
- if (publishableEvent == null)
- return new Result(new ArgumentNullException("publishableEvent"));
-
- string message = JsonConvert.SerializeObject(publishableEvent, JsonSerializerSettings);
- return messageClient.Publish(topic, message, MessagePublished, qosLevel);
- }
-
- public IResult<IEvent> RetrieveEvent(string eventId)
- {
- return Submodel.Events.Retrieve(eventId);
- }
-
- public IResult<ElementContainer<IEvent>> RetrieveEvents()
- {
- return Submodel.Events.RetrieveAll();
- }
-
- public IResult<IOperation> RetrieveOperation(string operationId)
- {
- return Submodel.Operations.Retrieve(operationId);
- }
-
- public IResult<ElementContainer<IOperation>> RetrieveOperations()
- {
- return Submodel.Operations.RetrieveAll();
- }
-
- public IResult<ElementContainer<IDataElement>> RetrieveDataElements()
- {
- return Submodel.DataElements.RetrieveAll();
- }
-
- public IResult<IDataElement> RetrieveDataElement(string dataElementId)
- {
- return Submodel.DataElements.Retrieve(dataElementId);
- }
-
- public IResult<IValue> RetrieveDataElementValue(string dataElementId)
- {
- if (dataElementHandler.TryGetValue(dataElementId, out DataElementHandler handler) && handler.GetHandler != null)
- {
- var dataElement = RetrieveDataElement(dataElementId);
- if(dataElement.Success && dataElement.Entity != null)
- return new Result<IValue>(true, handler.GetHandler.Invoke(dataElement.Entity));
- else
- return new Result<IValue>(false, new Message(MessageType.Error, "DataElement not found"));
- }
- else
- return new Result<IValue>(false, new Message(MessageType.Error, "DataElementHandler or GetHandler not found"));
- }
-
-
- public IResult UpdateDataElementValue(string dataElementId, IValue value)
- {
- if (dataElementHandler.TryGetValue(dataElementId, out DataElementHandler handler) && handler.SetHandler != null)
- {
- var dataElement = RetrieveDataElement(dataElementId);
- if (dataElement.Success && dataElement.Entity != null)
- {
- handler.SetHandler.Invoke(dataElement.Entity, value);
- return new Result(true);
- }
- else
- return new Result<IValue>(false, new Message(MessageType.Error, "DataElement not found"));
- }
- else
- return new Result<IValue>(false, new Message(MessageType.Error, "DataElementHandler or SetHandler not found"));
- }
-
- public virtual void ConfigureEventHandler(IMessageClient messageClient)
- {
- this.messageClient = messageClient;
- }
-
- public virtual void SubscribeUpdates(string dataElementId, Action<IValue> updateFunction)
- {
- if (!updateFunctions.ContainsKey(dataElementId))
- updateFunctions.Add(dataElementId, updateFunction);
- else
- updateFunctions[dataElementId] = updateFunction;
- }
-
- public virtual void PublishUpdate(string dataElementId, IValue value)
- {
- if (updateFunctions.TryGetValue(dataElementId, out Action<IValue> updateFunction))
- updateFunction.Invoke(value);
-
- }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/Agents/IAssetAdministrationShellAgent.cs b/sdks/csnet/BaSys40.API/Platform/Agents/IAssetAdministrationShellAgent.cs
deleted file mode 100644
index bc8b986..0000000
--- a/sdks/csnet/BaSys40.API/Platform/Agents/IAssetAdministrationShellAgent.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-
-namespace BaSys40.API.Platform.Agents
-{
- public interface IAssetAdministrationShellAgent
- {
-
- #region Submodel - CRUD-Operations
-
- IResult<ISubmodel> CreateSubmodel(string aasId, ISubmodel submodel);
-
- IResult<ElementContainer<ISubmodel>> RetrieveSubmodels(string aasId);
-
- IResult<ISubmodel> RetrieveSubmodel(string aasId, string submodelId);
-
- IResult DeleteSubmodel(string aasId, string submodelId);
-
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/Agents/ISubModelAgent.cs b/sdks/csnet/BaSys40.API/Platform/Agents/ISubModelAgent.cs
deleted file mode 100644
index 488888d..0000000
--- a/sdks/csnet/BaSys40.API/Platform/Agents/ISubModelAgent.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.Platform.Agents
-{
- public interface ISubmodelAgent
- {
-
- #region Operation - CRUD-Operations
- IResult<IOperation> CreateOperation(string aasId, string submodelId, IOperation operation);
-
- IResult<ElementContainer<IOperation>> RetrieveOperations(string aasId, string submodelId);
-
- IResult<IOperation> RetrieveOperation(string aasId, string submodelId, string operationId);
-
- IResult DeleteOperation(string aasId, string submodelId, string operationId);
-
- IResult InvokeOperation(string aasId, string submodelId, string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout);
- #endregion
-
- #region DataElement - CRUD-Operations
- IResult<IDataElement> CreateDataElement(string aasId, string submodelId, IDataElement dataElement);
-
- IResult<ElementContainer<IDataElement>> RetrieveDataElements(string aasId, string submodelId);
-
- IResult<IDataElement> RetrieveDataElement(string aasId, string submodelId, string dataElementId);
-
- IResult UpdateDataElementValue(string aasId, string submodelId, string dataElementId, IValue value);
-
- IResult<IValue> RetrieveDataElementValue(string aasId, string submodelId, string dataElementId);
-
- IResult DeleteDataElement(string aasId, string submodelId, string dataElementId);
- #endregion
-
- #region Event - CRUD-Operations
- IResult<IEvent> CreateEvent(string aasId, string submodelId, IEvent eventable);
-
- IResult<ElementContainer<IEvent>> RetrieveEvents(string aasId, string submodelId);
-
- IResult<IEvent> RetrieveEvent(string aasId, string submodelId, string eventId);
-
- IResult DeleteEvent(string aasId, string submodelId, string eventId);
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellAggregator.cs b/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellAggregator.cs
deleted file mode 100644
index 967ff1f..0000000
--- a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellAggregator.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.Platform
-{
- public interface IAssetAdministrationShellAggregator
- {
- IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas);
-
- IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId);
-
- IResult<List<IAssetAdministrationShell>> RetrieveAssetAdministrationShells();
-
- IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas);
-
- IResult DeleteAssetAdministrationShell(string aasId);
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellHandler.cs b/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellHandler.cs
deleted file mode 100644
index 7bce300..0000000
--- a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellHandler.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using BaSys40.API.AssetAdministrationShell;
-
-namespace BaSys40.API.Platform
-{
- public interface IAssetAdministrationShellHandler
- {
- void RegisterSetPropertyValueHandler(IConnectableSubmodel connectableSubmodel, IConnectableDataElement connectableProperty, SetDataElementValueEventHandler setPropertyValueHandler);
- void RegisterGetPropertyValueHandler(IConnectableSubmodel connectableSubmodel, IConnectableDataElement connectableProperty, GetDataElementValueEventHandler getPropertyValueHandler);
- void RegisterMethodCalledEventHandler(IConnectableSubmodel connectableSubmodel, IConnectableOperation connectableOperation, MethodCalledEventHandler handler);
- void RegisterEventHandler(IConnectableSubmodel connectableSubmodel, IConnectableEvent connectableEvent, EventHandler handler);
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellManager.cs b/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellManager.cs
deleted file mode 100644
index 78d349e..0000000
--- a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellManager.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using BaSys40.API.Platform.Agents;
-
-namespace BaSys40.API.Platform
-{
- public interface IAssetAdministrationShellManager : IAssetAdministrationShellAggregator, IAssetAdministrationShellAgent, ISubmodelAgent
- {
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellRegistry.cs b/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellRegistry.cs
deleted file mode 100644
index 9645b77..0000000
--- a/sdks/csnet/BaSys40.API/Platform/IAssetAdministrationShellRegistry.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.Platform
-{
- public interface IAssetAdministrationShellRegistry
- {
- IResult<AssetAdministrationShellDescriptor> CreateAssetAdministrationShell(AssetAdministrationShellDescriptor aas);
- IResult<AssetAdministrationShellDescriptor> RetrieveAssetAdministrationShell(string aasId);
- IResult<List<AssetAdministrationShellDescriptor>> RetrieveAssetAdministrationShells();
- IResult UpdateAssetAdministrationShell(string aasId, Dictionary<string, string> metaData);
- IResult DeleteAssetAdministrationShell(string aasId);
-
- IResult<SubmodelDescriptor> CreateSubmodel(string aasId, SubmodelDescriptor submodel);
- IResult<List<SubmodelDescriptor>> RetrieveSubmodels(string aasId);
- IResult<SubmodelDescriptor> RetrieveSubmodel(string aasId, string submodelId);
- IResult DeleteSubmodel(string aasId, string submodelId);
- }
-}
diff --git a/sdks/csnet/BaSys40.API/Platform/IPlatformConnector.cs b/sdks/csnet/BaSys40.API/Platform/IPlatformConnector.cs
deleted file mode 100644
index a7e81ff..0000000
--- a/sdks/csnet/BaSys40.API/Platform/IPlatformConnector.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.API.Platform;
-using BaSys40.Models.Core.AssetAdministrationShell;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-
-namespace BaSys40.API.Platform
-{
- public interface IPlatformConnector
- {
- IAssetAdministrationShell GenerateAssetAdministrationShell();
-
- IResult Register(IAssetAdministrationShellRegistry registry, AssetAdministrationShellDescriptor aas);
-
- IResult CreateStructure(IAssetAdministrationShellManager manager, IAssetAdministrationShellHandler handler, IAssetAdministrationShell aas);
-
- IResult Unregister(IAssetAdministrationShellRegistry registry, string aasId);
-
- }
-}
diff --git a/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellAggregatorServiceProvider.cs b/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellAggregatorServiceProvider.cs
deleted file mode 100644
index 841209f..0000000
--- a/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellAggregatorServiceProvider.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.API.Platform;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using System.Collections.Generic;
-
-namespace BaSys40.API.ServiceProvider
-{
- public interface IAssetAdministrationShellAggregatorServiceProvider : IServiceProvider<IEnumerable<IAssetAdministrationShell>>, IAssetAdministrationShellAggregator
- {
- IEnumerable<IAssetAdministrationShell> AssetAdministrationShells { get; }
- void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider);
- IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id);
- IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders();
- }
-}
diff --git a/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellServiceProvider.cs b/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellServiceProvider.cs
deleted file mode 100644
index 9329bca..0000000
--- a/sdks/csnet/BaSys40.API/ServiceProvider/IAssetAdministrationShellServiceProvider.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.API.ServiceProvider
-{
- public interface IAssetAdministrationShellServiceProvider : IServiceProvider<IAssetAdministrationShell>
- {
- IAssetAdministrationShell AssetAdministrationShell { get; }
-
-
- #region Submodel - CRUD-Operations
-
- IResult<ISubmodel> CreateSubmodel(ISubmodel submodel);
-
- IResult<ElementContainer<ISubmodel>> RetrieveSubmodels();
-
- IResult<ISubmodel> RetrieveSubmodel(string submodelId);
-
- IResult DeleteSubmodel(string submodelId);
-
- #endregion
-
- void RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider);
- ISubmodelServiceProvider GetSubmodelServiceProvider(string id);
- IEnumerable<ISubmodelServiceProvider> GetSubmodelServiceProviders();
- }
-}
diff --git a/sdks/csnet/BaSys40.API/ServiceProvider/IServiceProvider.cs b/sdks/csnet/BaSys40.API/ServiceProvider/IServiceProvider.cs
deleted file mode 100644
index fcc596a..0000000
--- a/sdks/csnet/BaSys40.API/ServiceProvider/IServiceProvider.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using BaSys40.Models.Connectivity;
-
-namespace BaSys40.API.ServiceProvider
-{
- public interface IServiceProvider<T>
- {
- IServiceDescriptor ServiceDescriptor { get; }
- void BindTo(T element);
- T GetBinding();
- }
-}
diff --git a/sdks/csnet/BaSys40.API/ServiceProvider/ISubModelServiceProvider.cs b/sdks/csnet/BaSys40.API/ServiceProvider/ISubModelServiceProvider.cs
deleted file mode 100644
index 37aaf56..0000000
--- a/sdks/csnet/BaSys40.API/ServiceProvider/ISubModelServiceProvider.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using BaSys40.Utils.Client;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-using System;
-using BaSys40.API.AssetAdministrationShell;
-
-namespace BaSys40.API.ServiceProvider
-{
- public interface ISubmodelServiceProvider : IServiceProvider<ISubmodel>
- {
- ISubmodel Submodel { get; }
-
- #region Operation - CRUD-Operations
- IResult<IOperation> CreateOperation(IOperation operation);
-
- IResult<ElementContainer<IOperation>> RetrieveOperations();
-
- IResult<IOperation> RetrieveOperation(string operationId);
-
- IResult DeleteOperation(string operationId);
-
- IResult InvokeOperation(string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout);
- #endregion
-
- #region DataElement - CRUD-Operations
- IResult<IDataElement> CreateDataElement(IDataElement dataElement);
-
- IResult<ElementContainer<IDataElement>> RetrieveDataElements();
-
- IResult<IDataElement> RetrieveDataElement(string dataElementId);
-
- IResult<IValue> RetrieveDataElementValue(string dataElementId);
-
- IResult UpdateDataElementValue(string dataElementId, IValue value);
-
- IResult DeleteDataElement(string dataElementId);
-
- void SubscribeUpdates(string dataElementId, Action<IValue> updateFunction);
- void PublishUpdate(string dataElementId, IValue value);
- #endregion
-
- #region Event - CRUD-Operations
- IResult<IEvent> CreateEvent(IEvent eventable);
-
- IResult<ElementContainer<IEvent>> RetrieveEvents();
-
- IResult<IEvent> RetrieveEvent(string eventId);
-
- IResult ThrowEvent(IPublishableEvent publishableEvent, string topic, Action<IMessagePublishedEventArgs> MessagePublished, byte qosLevel);
-
- IResult DeleteEvent(string eventId);
- #endregion
-
- DataElementHandler RetrieveDataElementHandler(string dataElementId);
- void RegisterDataElementHandler(string dataElementId, DataElementHandler handler);
- Delegate RetrieveMethodDelegate(string operationId);
- void RegisterMethodCalledHandler(string operationId, Delegate handler);
- void ConfigureEventHandler(IMessageClient messageClient);
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST.Client/BaSys40.Component.REST.Client.csproj b/sdks/csnet/BaSys40.Component.REST.Client/BaSys40.Component.REST.Client.csproj
deleted file mode 100644
index fc7c6f7..0000000
--- a/sdks/csnet/BaSys40.Component.REST.Client/BaSys40.Component.REST.Client.csproj
+++ /dev/null
@@ -1,23 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <TargetFramework>netstandard2.0</TargetFramework>
- <ApplicationIcon />
- <StartupObject />
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>full</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="NLog" Version="4.5.11" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.API\BaSys40.API.csproj" />
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.Component.REST.Client/RestClient.cs b/sdks/csnet/BaSys40.Component.REST.Client/RestClient.cs
deleted file mode 100644
index 9b6b1c6..0000000
--- a/sdks/csnet/BaSys40.Component.REST.Client/RestClient.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-using BaSys40.API.Platform.Agents;
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Extensions;
-using BaSys40.Utils.Client.Http;
-using BaSys40.Utils.ResultHandling;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Http;
-using System.Text;
-
-namespace BaSys40.Component.REST.Client
-{
- public class RestClient : SimpleHttpClient
- {
- private const string AAS = "aas";
- private const string SUBMODELS = "submodels";
- private const string DATAELEMENTS = "dataElements";
- private const string OPERATIONS = "operations";
- private const string EVENTS = "events";
- private const string VALUE = "value";
-
- private const string SEPERATOR = "/";
- private const int TIMEOUT = 30000;
-
- public IPEndPoint Endpoint { get; }
-
- public RestClient(IPEndPoint endPoint)
- {
- Endpoint = endPoint;
- JsonSerializerSettings = new JsonStandardSettings();
- }
-
- public Uri GetUri(params string[] pathElements)
- {
- string path = "http://" + Endpoint.Address + ":" + Endpoint.Port + SEPERATOR + AAS;
-
- if (pathElements?.Length > 0)
- foreach (var pathElement in pathElements)
- {
- if (!pathElement.EndsWith("/") && !pathElement.StartsWith("/"))
- path = path + SEPERATOR + pathElement;
- else
- path = path + pathElement;
- }
- return new Uri(path);
- }
-
- public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell()
- {
- var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IAssetAdministrationShell>(response, response.Entity);
- }
-
- public IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS), HttpMethod.Post, submodel);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ISubmodel>(response, response.Entity);
- }
-
- public IResult<ElementContainer<ISubmodel>> RetrieveSubmodels()
- {
- var request = base.CreateRequest(GetUri(SUBMODELS), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ElementContainer<ISubmodel>>(response, response.Entity);
- }
-
- public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ISubmodel>(response, response.Entity);
- }
-
- public IResult DeleteSubmodel(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId), HttpMethod.Delete);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<IOperation> CreateOperation(string submodelId, IOperation operation)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, OPERATIONS), HttpMethod.Post, operation);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IOperation>(response, response.Entity);
- }
-
- public IResult<ElementContainer<IOperation>> RetrieveOperations(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, OPERATIONS), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IOperation>>(response, response.Entity);
- }
-
- public IResult<IOperation> RetrieveOperation(string submodelId, string operationId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, OPERATIONS, operationId), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IOperation>(response, response.Entity);
- }
-
- public IResult DeleteOperation(string submodelId, string operationId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, OPERATIONS, operationId), HttpMethod.Delete);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult InvokeOperation(string submodelId, string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- var uri = GetUri(SUBMODELS, submodelId, OPERATIONS, operationId);
- var requestUri = new Uri(uri.OriginalString + "?timeout=" + timeout);
- var request = base.CreateJsonContentRequest(requestUri, HttpMethod.Post, inputArguments);
- var response = base.SendRequest(request, TIMEOUT);
- var evaluatedResponse = base.EvaluateResponse(response, response.Entity);
- outputArguments = evaluatedResponse.GetEntity<List<IArgument>>();
- return evaluatedResponse;
- }
-
- public IResult<IDataElement> CreateDataElement(string submodelId, IDataElement dataElement)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS), HttpMethod.Post, dataElement);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IDataElement>(response, response.Entity);
- }
-
- public IResult<ElementContainer<IDataElement>> RetrieveDataElements(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IDataElement>>(response, response.Entity);
- }
-
- public IResult<IDataElement> RetrieveDataElement(string submodelId, string dataElementId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS, dataElementId), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IDataElement>(response, response.Entity);
- }
-
- public IResult UpdateDataElementValue(string submodelId, string dataElementId, IValue value)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS, dataElementId, VALUE), HttpMethod.Put, value);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<IValue> RetrieveDataElementValue(string submodelId, string dataElementId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS, dataElementId, VALUE), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IValue>(response, response.Entity);
- }
-
- public IResult DeleteDataElement(string submodelId, string dataElementId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, DATAELEMENTS, dataElementId), HttpMethod.Delete);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<IEvent> CreateEvent(string submodelId, IEvent eventable)
- {
- var request = base.CreateJsonContentRequest(GetUri(SUBMODELS, submodelId, EVENTS), HttpMethod.Post, eventable);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IEvent>(response, response.Entity);
- }
-
- public IResult<ElementContainer<IEvent>> RetrieveEvents(string submodelId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, EVENTS), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<ElementContainer<IEvent>>(response, response.Entity);
- }
-
- public IResult<IEvent> RetrieveEvent(string submodelId, string eventId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, EVENTS, eventId), HttpMethod.Get);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse<IEvent>(response, response.Entity);
- }
-
- public IResult DeleteEvent(string submodelId, string eventId)
- {
- var request = base.CreateRequest(GetUri(SUBMODELS, submodelId, EVENTS, eventId), HttpMethod.Delete);
- var response = base.SendRequest(request, TIMEOUT);
- return base.EvaluateResponse(response, response.Entity);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/BaSys40.Component.REST.csproj b/sdks/csnet/BaSys40.Component.REST/BaSys40.Component.REST.csproj
deleted file mode 100644
index 0dcf1a3..0000000
--- a/sdks/csnet/BaSys40.Component.REST/BaSys40.Component.REST.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
- <PropertyGroup>
- <TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
- <ApplicationIcon>AAS_Icon.ico</ApplicationIcon>
- <OutputType>Exe</OutputType>
- <StartupObject />
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
- <DocumentationFile>bin\Release\netcoreapp2.2\BaSys40.Component.REST.xml</DocumentationFile>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
- <DocumentationFile>bin\Debug\netcoreapp2.2\BaSys40.Component.REST.xml</DocumentationFile>
- <DefineConstants>TRACE;DEBUG</DefineConstants>
- <OutputPath>bin\Debug\</OutputPath>
- </PropertyGroup>
-
-
- <ItemGroup>
- <None Remove="ServerSettings.xml" />
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
- <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
- <PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
- <PackageReference Include="Microsoft.AspNetCore.Server.HttpSys" Version="2.2.0" />
- <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.0" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.1" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0">
- <PrivateAssets>all</PrivateAssets>
- <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
- </PackageReference>
- <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.1.0" />
- <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0" />
- <PackageReference Include="NLog.Config" Version="4.5.11" />
- <PackageReference Include="NLog.Web.AspNetCore" Version="4.8.0" />
- <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
- <PackageReference Include="System.IO.Ports" Version="4.5.0" />
- </ItemGroup>
-
- <ItemGroup>
- <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Include="ServerSettings.xml">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </EmbeddedResource>
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.API\BaSys40.API.csproj" />
- <ProjectReference Include="..\BaSys40.Models\BaSys40.Models.csproj" />
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="wwwroot\" />
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs b/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs
deleted file mode 100644
index 9b9eb5d..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.AspNetCore.Mvc;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using static BaSys40.Utils.ResultHandling.Utils;
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Connectivity;
-
-namespace BaSys40.Component.REST.Controllers
-{
- /// <summary>
- /// All Asset Administration Shell Services provided by the component
- /// </summary>
- public class AssetAdministrationShellAggregatorServices : Controller, IAssetAdministrationShellAggregatorServiceProvider
- {
-
- private readonly IAssetAdministrationShellAggregatorServiceProvider aggregator;
-
- public IEnumerable<IAssetAdministrationShell> AssetAdministrationShells => aggregator.AssetAdministrationShells;
- public IServiceDescriptor ServiceDescriptor { get; }
-
-
- public AssetAdministrationShellAggregatorServices(IAssetAdministrationShellAggregatorServiceProvider assetAdministrationShellAggregatorServiceProvider)
- {
- aggregator = assetAdministrationShellAggregatorServiceProvider;
- ServiceDescriptor = assetAdministrationShellAggregatorServiceProvider.ServiceDescriptor;
- }
-
- #region REST-Interface AssetAdministrationShellAggregator
-
- /// <summary>
- /// Retrieves all Asset Administration Shells from the endpoint
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Returns a list of found Asset Administration Shells</response>
- /// <response code="404">No Asset Administration Shells found</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("aasList", Name = "RetrieveAASList")]
- [ProducesResponseType(typeof(IResult<List<IAssetAdministrationShell>>), 200)]
- public IActionResult RetrieveAASList()
- {
- var result = RetrieveAssetAdministrationShells();
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
- /// <summary>
- /// Retrieves a specific Asset Administration Shell
- /// </summary>
- /// <param name="aasId">The AAS's unique id</param>
- /// <returns></returns>
- /// <response code="200">Returns the requested Asset Administration Shell</response>
- /// <response code="404">No Asset Administration Shell found</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("aasList/{aasId}", Name = "RetrieveAAS")]
- [ProducesResponseType(typeof(IResult<IAssetAdministrationShell>), 200)]
- public IActionResult RetrieveAAS(string aasId)
- {
- var result = RetrieveAssetAdministrationShell(aasId);
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
- /// <summary>
- /// Updates a specific Asset Administration Shell
- /// </summary>
- /// <param name="aasId">The AAS's unique id</param>
- /// <param name="aas">The updated AAS</param>
- /// <returns></returns>
- /// <response code="204">Asset Administration Shell updated successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPut("aasList/{aasId}", Name = "UpdateAAS")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult UpdateAAS(string aasId, [FromBody] IAssetAdministrationShell aas)
- {
- var result = UpdateAssetAdministrationShell(aasId, aas);
- return EvaluateResult(result, CrudOperation.Update);
- }
- /// <summary>
- /// Creates a new Asset Administration Shell at the endpoint
- /// </summary>
- /// <param name="aas">The AAS's description object</param>
- /// <returns></returns>
- /// <response code="201">Asset Administration Shell created successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("aasList", Name = "CreateAAS")]
- [ProducesResponseType(typeof(IResult<IAssetAdministrationShell>), 201)]
- public IActionResult CreateAAS([FromBody] IAssetAdministrationShell aas)
- {
- var result = CreateAssetAdministrationShell(aas);
- return EvaluateResult(result, CrudOperation.Create);
- }
- /// <summary>
- /// Deletes a specific Asset Administration Shell
- /// </summary>
- /// <param name="aasId">The AAS's unique id</param>
- /// <returns></returns>
- /// <response code="204">Asset Administration Shell deleted successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpDelete("aasList/{aasId}", Name = "DeleteAAS")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DeleteAAS(string aasId)
- {
- var result = DeleteAssetAdministrationShell(aasId);
- return EvaluateResult(result, CrudOperation.Delete);
- }
-
- #endregion
-
-
- #region Interface Implementation AssetAdministrationShellAggregator
-
- #endregion
- #region Helper Methods
-
- private static IActionResult AggregateResultHandling(IResult result)
- {
- if (result != null)
- {
- var objResult = new ObjectResult(result);
-
- if (result.Success)
- {
- if (result.Entity == null)
- objResult.StatusCode = 404;
- else
- objResult.StatusCode = 200;
- }
- else if (Utils.ResultHandling.Utils.TryParseStatusCode(result, out int httpStatusCode))
- objResult.StatusCode = httpStatusCode;
- else
- objResult.StatusCode = 502;
-
- return objResult;
- }
- return new BadRequestResult();
- }
-
- public void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
- {
- aggregator.RegisterAssetAdministrationShellServiceProvider(id, assetAdministrationShellServiceProvider);
- }
-
- public IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id)
- {
- return aggregator.GetAssetAdministrationShellServiceProvider(id);
- }
-
- public IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders()
- {
- return aggregator.GetAssetAdministrationShellServiceProviders();
- }
-
- public void BindTo(IEnumerable<IAssetAdministrationShell> element)
- {
- aggregator.BindTo(element);
- }
-
- public IEnumerable<IAssetAdministrationShell> GetBinding()
- {
- return aggregator.GetBinding();
- }
-
- public IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas)
- {
- return aggregator.CreateAssetAdministrationShell(aas);
- }
-
- public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId)
- {
- return aggregator.RetrieveAssetAdministrationShell(aasId);
- }
-
- public IResult<List<IAssetAdministrationShell>> RetrieveAssetAdministrationShells()
- {
- return aggregator.RetrieveAssetAdministrationShells();
- }
-
- public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas)
- {
- return aggregator.UpdateAssetAdministrationShell(aasId, aas);
- }
-
- public IResult DeleteAssetAdministrationShell(string aasId)
- {
- return aggregator.DeleteAssetAdministrationShell(aasId);
- }
-
-
-
-
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs b/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs
deleted file mode 100644
index 929541b..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.AspNetCore.Mvc;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.AssetAdministrationShell;
-using BaSys40.Models.Connectivity;
-using static BaSys40.Utils.ResultHandling.Utils;
-using System.Linq;
-
-namespace BaSys40.Component.REST.Controllers
-{
- /// <summary>
- /// All Asset Administration Shell Services provided by the component
- /// </summary>
- public class AssetAdministrationShellServices : Controller, IAssetAdministrationShellServiceProvider
- {
- private readonly IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider;
-
- public IServiceDescriptor ServiceDescriptor { get; }
-
- public IAssetAdministrationShell AssetAdministrationShell => assetAdministrationShellServiceProvider.GetBinding();
-
- public AssetAdministrationShellServices(IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
- {
- this.assetAdministrationShellServiceProvider = assetAdministrationShellServiceProvider;
- ServiceDescriptor = assetAdministrationShellServiceProvider.ServiceDescriptor;
- }
-
- public void BindTo(IAssetAdministrationShell element)
- {
- assetAdministrationShellServiceProvider.BindTo(element);
- }
- public IAssetAdministrationShell GetBinding()
- {
- return assetAdministrationShellServiceProvider.GetBinding();
- }
-
-
- #region REST-Interface AssetAdministrationShell
-
- /// <summary>
- /// Retrieves the Asset Administration Shell
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="502">Bad Gateway - Asset Administration Shell not available</response>
- [HttpGet("aas", Name = "GetAAS")]
- [ProducesResponseType(typeof(Result<AssetAdministrationShellDescriptor>), 200)]
- public IActionResult GetAAS()
- {
- var result = GetBinding();
- if (result != null)
- {
- var objResult = new ObjectResult(new Result<AssetAdministrationShellDescriptor>(true, new AssetAdministrationShellDescriptor(result, GetEndpoint())));
- return objResult;
- }
- return StatusCode(502);
- }
-
- public HttpEndpoint GetEndpoint()
- {
- var host = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host}{HttpContext.Request.Path}";
- return new HttpEndpoint(host);
- }
-
- #region Submodel - REST-Calls
- /// <summary>
- /// Adds a new Submodel to an existing Asset Administration Shell
- /// </summary>
- /// <param name="submodel">The Submodel's description object</param>
- /// <returns></returns>
- /// <response code="201">Submodel created successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("aas/submodels", Name = "PostSubmodel")]
- [ProducesResponseType(typeof(IResult<ISubmodel>), 201)]
- public IActionResult PostSubmodel([FromBody] ISubmodel submodel)
- {
- var result = CreateSubmodel(submodel);
- return EvaluateResult(result, CrudOperation.Create);
- }
- /// <summary>
- /// Retrieves a specific Submodel from a specific Asset Administration Shell
- /// </summary>
- /// <param name="submodelId">The Submodel's unique id</param>
- /// <returns></returns>
- /// <response code="200">Submodel retrieved successfully</response>
- /// <response code="404">No Submodel found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("aas/submodels/{submodelId}", Name = "GetSubmodelServiceProviderBinding")]
- [ProducesResponseType(typeof(IResult<ISubmodel>), 200)]
- public IActionResult GetSubmodelServiceProviderBinding(string submodelId)
- {
- var submodelProvider = GetSubmodelServiceProvider(submodelId);
-
- if (submodelProvider == null)
- return NotFound(new Result(false, new Message(MessageType.Information, "Submodel not found", "404")));
-
- return new OkObjectResult(new Result<ISubmodel>(true, submodelProvider.GetBinding()));
- }
- /// <summary>
- /// Deletes a specific Submodel from the Asset Administration Shell
- /// </summary>
- /// <param name="submodelId">The Submodel's idShort</param>
- /// <returns></returns>
- /// <response code="204">Submodel deleted successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="502">Bad Gateway</response>
- [HttpDelete("aas/submodels/{submodelId}", Name = "DelSubmodel")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DelSubmodel(string submodelId)
- {
- var result = DeleteSubmodel(submodelId);
- return EvaluateResult(result, CrudOperation.Delete);
- }
- /// <summary>
- /// Retrieves all Submodels from the current Asset Administration Shell
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Returns a list of found Submodels</response>
- /// <response code="404">No Submodels found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("aas/submodels", Name = "GetSubmodels")]
- [ProducesResponseType(typeof(IResult<ElementContainer<ISubmodel>>), 200)]
- public IActionResult GetSubmodels()
- {
- var submodelProviders = GetSubmodelServiceProviders();
-
- if (submodelProviders?.Count() == 0)
- return NotFound(new Result(false, new Message(MessageType.Information, "No Submodels found", "404")));
-
- ElementContainer<ISubmodel> submodels = new ElementContainer<ISubmodel>();
- foreach (var provider in submodelProviders)
- {
- var submodel = provider.GetBinding();
- submodels.Add(submodel);
- }
- return new OkObjectResult(new Result<ElementContainer<ISubmodel>>(true, submodels));
- }
-
- #endregion
-
- #endregion
-
- #region Interface Implementation AssetAdministrationShellServiceProvider
-
- public void RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider)
- {
- assetAdministrationShellServiceProvider.RegisterSubmodelServiceProvider(id, submodelServiceProvider);
- }
-
- public ISubmodelServiceProvider GetSubmodelServiceProvider(string id)
- {
- return assetAdministrationShellServiceProvider.GetSubmodelServiceProvider(id);
- }
-
- public IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
- {
- return assetAdministrationShellServiceProvider.CreateSubmodel(submodel);
- }
-
- public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
- {
- return assetAdministrationShellServiceProvider.RetrieveSubmodel(submodelId);
- }
-
- public IResult<ElementContainer<ISubmodel>> RetrieveSubmodels()
- {
- return assetAdministrationShellServiceProvider.RetrieveSubmodels();
- }
-
- public IResult DeleteSubmodel(string submodelId)
- {
- return assetAdministrationShellServiceProvider.DeleteSubmodel(submodelId);
- }
-
- public IEnumerable<ISubmodelServiceProvider> GetSubmodelServiceProviders()
- {
- return assetAdministrationShellServiceProvider.GetSubmodelServiceProviders();
- }
-
- #endregion
-
- #region Helper Methods
-
-
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/SubmodelServices.cs b/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/SubmodelServices.cs
deleted file mode 100644
index 14ac130..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Controllers/AssetAdministrationShell/SubmodelServices.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.AspNetCore.Mvc;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.API.ServiceProvider;
-using static BaSys40.Utils.ResultHandling.Utils;
-using BaSys40.Utils.Client;
-using System;
-using BaSys40.API.AssetAdministrationShell;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Connectivity;
-
-namespace BaSys40.Component.REST.Controllers
-{
- /// <summary>
- /// All Asset Administration Shell Services provided by the component
- /// </summary>
- public class SubmodelServices : Controller, ISubmodelServiceProvider
- {
- private readonly ISubmodelServiceProvider submodelServiceProvider;
-
- public ISubmodel Submodel => submodelServiceProvider.GetBinding();
- public IServiceDescriptor ServiceDescriptor { get; }
-
- public SubmodelServices(ISubmodelServiceProvider submodelServiceProvider)
- {
- this.submodelServiceProvider = submodelServiceProvider;
- ServiceDescriptor = submodelServiceProvider.ServiceDescriptor;
- }
-
- public void BindTo(ISubmodel element)
- {
- submodelServiceProvider.BindTo(element);
- }
- public ISubmodel GetBinding()
- {
- return submodelServiceProvider.GetBinding();
- }
-
-
- #region REST-Interface Submodel
-
- /// <summary>
- /// Retrieves the Submodel
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="502">Bad Gateway - Submodel not available</response>
- [HttpGet("submodel", Name = "GetSubmodel")]
- [ProducesResponseType(typeof(IResult<ISubmodel>), 200)]
- public IActionResult GetSubmodel()
- {
- var result = submodelServiceProvider.GetBinding();
- if (result != null)
- return new OkObjectResult(new Result<ISubmodel>(true, result));
-
- return StatusCode(502);
- }
-
- /// <summary>
- /// Retrieves all DataElements from the current Submodel
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Returns a list of found DataElements</response>
- /// <response code="404">Submodel not found / No DataElements found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/dataElements", Name = "GetDataElements")]
- [ProducesResponseType(typeof(IResult<ElementContainer<IDataElement>>), 200)]
- public IActionResult GetDataElements(string submodelId)
- {
- var result = RetrieveDataElements();
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
-
- /// <summary>
- /// Retrieves all Operations from the current Submodel
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="404">Submodel not found / No Operations found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/operations", Name = "GetOperations")]
- [ProducesResponseType(typeof(IResult<ElementContainer<IOperation>>), 200)]
- public IActionResult GetOperations(string submodelId)
- {
- var result = RetrieveOperations();
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
-
- /// <summary>
- /// Retrieves all Events from the current Submodel
- /// </summary>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="404">Submodel not found / No Events found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/events", Name = "GetEvents")]
- [ProducesResponseType(typeof(IResult<ElementContainer<IEvent>>), 200)]
- public IActionResult GetEvents(string submodelId)
- {
- var result = RetrieveEvents();
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
-
-
-
- #region DataElement - REST-Calls
- /// <summary>
- /// Adds a new DataElement to the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="dataElement">The DataElement's description object</param>
- /// <returns></returns>
- /// <response code="201">DataElement created successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("submodel/dataElements", Name = "PostDataElement")]
- [ProducesResponseType(typeof(IResult<IDataElement>), 201)]
- public IActionResult PostDataElement(string submodelId, [FromBody] IDataElement dataElement)
- {
- var result = CreateDataElement(dataElement);
- return EvaluateResult(result, CrudOperation.Create);
- }
- /// <summary>
- /// Retrieves a specific DataElement from the Asset Administrations's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="dataElementId">The DataElement's short id</param>
- /// <returns></returns>
- /// <response code="200">Returns the requested DataElement</response>
- /// <response code="404">Submodel/DataElement not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/dataElements/{dataElementId}", Name = "GetDataElement")]
- [ProducesResponseType(typeof(IResult<IDataElement>), 200)]
- public IActionResult GetDataElement(string submodelId, string dataElementId)
- {
- var result = RetrieveDataElement(dataElementId);
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
-
- /// <summary>
- /// Retrieves the value of a specific DataElement from the Asset Administrations Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="dataElementId">The DataElement's short id</param>
- /// <returns></returns>
- /// <response code="200">Returns the requested DataElement's value</response>
- /// <response code="404">Submodel/DataElement not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/dataElements/{dataElementId}/value", Name = "GetDataElementValue")]
- [ProducesResponseType(typeof(IResult<IValue>), 200)]
- public IActionResult GetDataElementValue(string submodelId, string dataElementId)
- {
- var result = RetrieveDataElementValue(dataElementId);
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
-
- /// <summary>
- /// Updates the Asset Administration Shell's Submodel's DataElement
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="dataElementId">The DataElement's short id</param>
- /// <param name="value">The new value</param>
- /// <returns></returns>
- /// <response code="204">DataElement's value changed successfully</response>
- /// <response code="404">Submodel/DataElement not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPut("submodel/dataElements/{dataElementId}/value", Name = "PutDataElementValue")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult PutDataElementValue(string submodelId, string dataElementId, [FromBody] IValue value)
- {
- var result = UpdateDataElementValue(dataElementId, value);
- return EvaluateResult(result, CrudOperation.Update);
- }
- /// <summary>
- /// Deletes a specific DataElement from the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="dataElementId">The DataElement's short id</param>
- /// <returns></returns>
- /// <response code="204">DataElement deleted successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpDelete("submodel/dataElements/{dataElementId}", Name = "DelDataElement")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DelDataElement(string submodelId, string dataElementId)
- {
- var result = DeleteDataElement(dataElementId);
- return EvaluateResult(result, CrudOperation.Delete);
- }
- #endregion
- #region Operation - REST-Calls
- /// <summary>
- /// Adds a new operation to the Asset Administraiton Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="operation">The operation description object</param>
- /// <returns></returns>
- /// <response code="201">Operation created successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("submodel/operations", Name = "PostOperation")]
- [ProducesResponseType(typeof(IResult<IOperation>), 201)]
- public IActionResult PostOperation(string submodelId, [FromBody] IOperation operation)
- {
- var result = CreateOperation(operation);
- return EvaluateResult(result, CrudOperation.Create);
- }
- /// <summary>
- /// Retrieves a specific Operation from the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="operationId">The Operation's short id</param>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="404">Submodel/Operation not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/operations/{operationId}", Name = "GetOperation")]
- [ProducesResponseType(typeof(IResult<IOperation>), 200)]
- public IActionResult GetOperation(string submodelId, string operationId)
- {
- var result = RetrieveOperation(operationId);
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
- /// <summary>
- /// Deletes a specific Operation from the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="operationId">The Operation's short id</param>
- /// <returns></returns>
- /// <response code="204">Operation deleted successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpDelete("submodel/operations/{operationId}", Name = "DelOperation")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DelOperation(string submodelId, string operationId)
- {
- var result = DeleteOperation(operationId);
- return EvaluateResult(result, CrudOperation.Delete);
- }
- /// <summary>
- /// Invokes a specific operation from the Asset Administration Shell' Submodel with a list of input parameters
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="operationId">The operation's short id</param>
- /// <param name="timeout">Timeout for the operation to finish</param>
- /// <param name="inputArguments">List of input arguments</param>
- /// <returns></returns>
- /// <response code="200">Operation invoked successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("submodel/operations/{operationId}", Name = "InvokeOperationRest")]
- [ProducesResponseType(typeof(IResult<List<IArgument>>), 200)]
- public IActionResult InvokeOperationRest(string submodelId, string operationId, [FromQuery] int timeout, [FromBody] List<IArgument> inputArguments)
- {
- List<IArgument> outputArguments = new List<IArgument>();
- IResult result = InvokeOperation(operationId, inputArguments, outputArguments, timeout);
-
- if (result != null)
- {
- var objResult = new ObjectResult(new Result<List<IArgument>>(result.Success, outputArguments, result.Messages));
-
- if (result.Success)
- objResult.StatusCode = 200;
- else if (Utils.ResultHandling.Utils.TryParseStatusCode(result, out int httpStatusCode))
- objResult.StatusCode = httpStatusCode;
- else
- objResult.StatusCode = 502;
-
- return objResult;
- }
- return StatusCode(502);
- }
-
- #endregion
- #region Event - REST-Calls
- /// <summary>
- /// Adds a new event to the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="eventable">The Event description object</param>
- /// <returns></returns>
- /// <response code="201">Event created successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpPost("submodel/events", Name = "PostEvent")]
- [ProducesResponseType(typeof(IResult<IEvent>), 201)]
- public IActionResult PostEvent(string submodelId, [FromBody] IEvent eventable)
- {
- var result = CreateEvent(eventable);
- return EvaluateResult(result, CrudOperation.Create);
- }
- /// <summary>
- /// Retrieves a specific event from the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="eventId">The Event's short id</param>
- /// <returns></returns>
- /// <response code="200">Success</response>
- /// <response code="404">Submodel/Event not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpGet("submodel/events/{eventId}", Name = "GetEvent")]
- [ProducesResponseType(typeof(IResult<IEvent>), 200)]
- public IActionResult GetEvent(string submodelId, string eventId)
- {
- var result = RetrieveEvent(eventId);
- return EvaluateResult(result, CrudOperation.Retrieve);
- }
- /// <summary>
- /// Deletes a specific event from the Asset Administration Shell's Submodel
- /// </summary>
- /// <param name="submodelId">The Submodel's short id</param>
- /// <param name="eventId">The Event's short id</param>
- /// <returns></returns>
- /// <response code="204">Event deleted successfully</response>
- /// <response code="400">Bad Request</response>
- /// <response code="404">Submodel not found</response>
- /// <response code="502">Bad Gateway</response>
- [HttpDelete("submodel/events/{eventId}", Name = "DelEvent")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DelEvent(string submodelId, string eventId)
- {
- var result = DeleteEvent(eventId);
- return EvaluateResult(result, CrudOperation.Delete);
- }
-
-
- #endregion
-
- #endregion
-
- #region Interface Implementation SubmodelServiceProvider
-
- public IResult<IOperation> CreateOperation(IOperation operation)
- {
- return submodelServiceProvider.CreateOperation(operation);
- }
-
- public IResult<ElementContainer<IOperation>> RetrieveOperations()
- {
- return submodelServiceProvider.RetrieveOperations();
- }
-
- public IResult<IOperation> RetrieveOperation(string operationId)
- {
- return submodelServiceProvider.RetrieveOperation(operationId);
- }
-
- public IResult DeleteOperation(string operationId)
- {
- return submodelServiceProvider.DeleteOperation(operationId);
- }
-
- public IResult InvokeOperation(string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- return submodelServiceProvider.InvokeOperation(operationId, inputArguments, outputArguments, timeout);
- }
-
- public IResult<IDataElement> CreateDataElement(IDataElement dataElement)
- {
- return submodelServiceProvider.CreateDataElement(dataElement);
- }
-
- public IResult<ElementContainer<IDataElement>> RetrieveDataElements()
- {
- return submodelServiceProvider.RetrieveDataElements();
- }
-
- public IResult<IDataElement> RetrieveDataElement(string dataElementId)
- {
- return submodelServiceProvider.RetrieveDataElement(dataElementId);
- }
-
- public IResult UpdateDataElementValue(string dataElementId, IValue value)
- {
- return submodelServiceProvider.UpdateDataElementValue(dataElementId, value);
- }
-
- public IResult DeleteDataElement(string dataElementId)
- {
- return submodelServiceProvider.DeleteDataElement(dataElementId);
- }
-
- public IResult<IEvent> CreateEvent(IEvent eventable)
- {
- return submodelServiceProvider.CreateEvent(eventable);
- }
-
- public IResult<ElementContainer<IEvent>> RetrieveEvents()
- {
- return submodelServiceProvider.RetrieveEvents();
- }
-
- public IResult<IEvent> RetrieveEvent(string eventId)
- {
- return submodelServiceProvider.RetrieveEvent(eventId);
- }
-
- public IResult ThrowEvent(IPublishableEvent publishableEvent, string topic, Action<IMessagePublishedEventArgs> MessagePublished, byte qosLevel)
- {
- return submodelServiceProvider.ThrowEvent(publishableEvent, topic, MessagePublished, qosLevel);
- }
-
- public IResult DeleteEvent(string eventId)
- {
- return submodelServiceProvider.DeleteEvent(eventId);
- }
-
- public Delegate RetrieveMethodDelegate(string operationId)
- {
- return submodelServiceProvider.RetrieveMethodDelegate(operationId);
- }
-
- public void RegisterMethodCalledHandler(string operationId, Delegate handler)
- {
- submodelServiceProvider.RegisterMethodCalledHandler(operationId, handler);
- }
-
- public void ConfigureEventHandler(IMessageClient messageClient)
- {
- submodelServiceProvider.ConfigureEventHandler(messageClient);
- }
-
- public IResult<IValue> RetrieveDataElementValue(string dataElementId)
- {
- return submodelServiceProvider.RetrieveDataElementValue(dataElementId);
- }
-
- public DataElementHandler RetrieveDataElementHandler(string dataElementId)
- {
- return submodelServiceProvider.RetrieveDataElementHandler(dataElementId);
- }
-
- public void RegisterDataElementHandler(string dataElementId, DataElementHandler handler)
- {
- submodelServiceProvider.RegisterDataElementHandler(dataElementId, handler);
- }
-
- public void SubscribeUpdates(string dataElementId, Action<IValue> updateFunction)
- {
- submodelServiceProvider.SubscribeUpdates(dataElementId, updateFunction);
- }
-
- public void PublishUpdate(string dataElementId, IValue value)
- {
- submodelServiceProvider.PublishUpdate(dataElementId, value);
- }
-
- #endregion
-
- #region Helper Methods
-
-
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml b/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml
deleted file mode 100644
index 164b5c2..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml
+++ /dev/null
@@ -1,331 +0,0 @@
-@page "ui"
-@model BaSys40.Component.REST.Pages.IndexModel
-@{
- ViewData["Title"] = "Index";
-}
-
-<!doctype html>
-<html>
-<head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.3.1/cerulean/bootstrap.min.css">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/popper.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
-
- <style>
- .bd-placeholder-img {
- font-size: 1.125rem;
- text-anchor: middle;
- }
-
- @@media (min-width: 768px) {
- .bd-placeholder-img-lg {
- font-size: 3.5rem;
- }
- }
- </style>
-
-</head>
-<body>
- @{ var aas = Model.ServiceProvider.AssetAdministrationShell; }
-
- <nav class="navbar navbar-inverse">
- <div class="container-fluid">
- <div class="navbar-header">
- <img src="~/images/BaSys-Logo-transparent-1080x250.png" width="103" height="25" style="margin-top:15px" />
- <!-- <a class="navbar-brand" href="#">@aas.IdShort</a>-->
- </div>
- <ul class="nav navbar-nav">
- <li><a href="#">Main</a></li>
- </ul>
- <div class="navbar-right"></div>
- </div>
- </nav>
-
- <main role="main" class="container">
-
- <div class="starter-template">
- <h1>@aas.IdShort - Asset Administration Shell UI</h1>
- <p class="lead">Generic UI to discover the Asset Administration Shell </p>
- </div>
- </main>
-
-
- <div class="container">
- <div class="panel panel-default">
- <div class="panel-heading" style="background:#7ca1ce"><h4 style="color:white">Asset Administration Shell</h4></div>
- <div class="list-group">
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>Identifier</b></div>
- <div class="col-sm-10">@aas.Identification.Id</div>
- </div>
- </div>
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>IdShort</b></div>
- <div class="col-sm-10">@aas.IdShort</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @{ var asset = Model.ServiceProvider.AssetAdministrationShell.Asset; }
- <div class="container">
- <div class="panel panel-default">
- <div class="panel-heading" style="background:#b90276"><h4 style="color:white">Asset</h4></div>
- <div class="list-group">
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>Identifier</b></div>
- <div class="col-sm-10">@asset.Identification.Id</div>
- </div>
- </div>
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>IdShort</b></div>
- <div class="col-sm-10">@asset.IdShort</div>
- </div>
- </div>
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>Semantic-Id</b></div>
- <div class="col-sm-10">@asset.SemanticId?.First?.Value</div>
- </div>
- </div>
-
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-2"><b>Kind</b></div>
- <div class="col-sm-10">@asset.Kind?.ToString()</div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- @foreach (var submodel in Model.ServiceProvider.AssetAdministrationShell.Submodels)
- {
- <div class="container">
- <div class="panel panel-default">
- <div class="panel-heading" style="background:darkgreen">
- <h4>
- <a style="color:white" data-toggle="collapse" href="#@submodel.IdShort">@submodel.IdShort</a>
- </h4>
- </div>
- <div id="@submodel.IdShort" class="panel-collapse collapse">
- <div class="panel-body">
- <div class="panel-group">
- @if (submodel.DataElements?.Count > 0)
- {
- <div class="panel panel-default">
- <div class="panel-heading" style="background:#005691"><h4 style="color:white">DataElements</h4></div>
- <div class="panel-body">
- <div class="panel-group">
- @for (int i = 0; i < submodel.DataElements.Count; i++)
- {
- var dataElement = submodel.DataElements[i];
- <div class="panel panel-warning">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" href="#@dataElement.IdShort">@dataElement.IdShort</a>
- </h4>
- </div>
- <div id="@dataElement.IdShort" class="panel-collapse collapse">
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-2"><b>Data-Type</b></div>
- <div class="col-sm-10">@dataElement.ValueType?.DataObjectType?.Name?.ToUpper()</div>
- </div>
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-2"><b>Semantic-Id</b></div>
- <div class="col-sm-10">@dataElement.SemanticId?.First?.Value</div>
- </div>
- </div>
-
- <div class="panel-footer">
- <div class="row">
- <div class="col-sm-8">
- <div class="input-group">
- <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
- <input id="Input_@dataElement.IdShort" type="text" class="form-control" placeholder="Value" value="@dataElement.Value?.ToString()">
- </div>
- </div>
- <div class="col-sm-1"><button onclick="@("GetDataElementValue('" + submodel.IdShort + "', '" + dataElement.IdShort + "')")" id="@dataElement.IdShort;Retrieve" type="button" class="btn btn-primary">Retrieve</button></div>
- <div class="col-sm-1"><button onclick="@("SetDataElementValue('" + submodel.IdShort + "', '" + dataElement.IdShort + "', '" + dataElement.ValueType?.DataObjectType?.Name + "', $('#Input_" + dataElement.IdShort + "').val() )")" id="@dataElement.IdShort;Update" type="button" class="btn btn-success">Update</button></div>
- </div>
- </div>
- </div>
- </div>
- }
- </div>
- </div>
- </div>
- }
- </div>
- <div class="panel-group">
- @if (submodel.Operations?.Count > 0)
- {
- <div class="panel panel-default">
- <div class="panel-heading" style="background:#78be20"><h4 style="color:white">Operations</h4></div>
- <div class="panel-body">
- <div class="panel-group">
-
- @for (int i = 0; i < submodel.Operations.Count; i++)
- {
- var operation = submodel.Operations[i];
- <div class="panel panel-warning">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" href="#@operation.IdShort">@operation.IdShort</a>
- </h4>
- </div>
- <div id="@operation.IdShort" class="panel-collapse collapse">
- @if (operation.In?.Count > 0)
- {
- foreach (var argument in operation.In)
- {
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-2 argInName @submodel.IdShort @operation.IdShort"><b>@argument.IdShort (IN)</b></div>
- <div class="col-sm-2 argInType @submodel.IdShort @operation.IdShort">@argument.DataType.DataObjectType.Name.ToUpper()</div>
- <div class="col-sm-8">
- <div class="input-group">
- <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
- <input id="msg" type="text" class="form-control argInValue @submodel.IdShort @operation.IdShort" name="msg" placeholder="Argument Value">
- </div>
- </div>
- </div>
- </div>
- }
- }
- @if (operation.Out?.Count > 0)
- {
- foreach (var argument in operation.Out)
- {
- <div class="panel-body">
- <div class="row">
- <div class="col-sm-2 argOutName @submodel.IdShort @operation.IdShort"><b>@argument.IdShort (OUT)</b></div>
- <div class="col-sm-2 argOutType @submodel.IdShort @operation.IdShort">@argument.DataType.DataObjectType.Name.ToUpper()</div>
- <div class="col-sm-8">
- <div class="input-group">
- <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
- <input id="argOutValue_@submodel.IdShort@operation.IdShort" type="text" class="form-control argOutValue @submodel.IdShort @operation.IdShort" name="msg" placeholder="Return Value">
- </div>
- </div>
- </div>
- </div>
- }
- }
- <div class="panel-footer"><button onclick="@("ExecuteOperation('" + submodel.IdShort + "', '" + operation.IdShort + "')")" type="button" class="btn btn-success">Execute</button></div>
- </div>
- </div>
- }
- </div>
- </div>
- </div>
-
- }
- </div>
- <div class="panel-group">
- @if (submodel.Events?.Count > 0)
- {
- <div class="panel panel-default">
- <div class="panel-heading" style="background:#00a8b0"><h4 style="color:white">Events</h4></div>
- <div class="panel-body">
- <div class="panel-group">
-
- @for (int i = 0; i < submodel.Events.Count; i++)
- {
- var eventable = submodel.Events[i];
- <div class="panel panel-warning">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" href="#@eventable.IdShort">@eventable.IdShort</a>
- </h4>
- </div>
- <div id="@eventable.IdShort" class="panel-collapse collapse">
-
- </div>
- </div>
- }
-
- </div>
- </div>
- </div>
- }
- </div>
- </div>
- </div>
- </div>
- </div>
- }
-
- <script>
- function ExecuteOperation(submodelId, operationId) {
- var argNames = document.getElementsByClassName("argInName " + submodelId + " " + operationId);
- var argTypes = document.getElementsByClassName("argInType " + submodelId + " " + operationId);
- var argValues = document.getElementsByClassName("argInValue " + submodelId + " " + operationId);
- var argOutValues = document.getElementsByClassName("argOutValue " + submodelId + " " + operationId);
-
- var args = [];
- for (var i = 0; i < argNames.length; i++) {
- var arg = { index: i, idShort: argNames.item(i).innerText, valueType: { dataObjectType: { name: argTypes.item(i).innerText.toLowerCase() } }, value: argValues.item(i).value };
- args.push(arg);
- }
-
-
- $.ajax({
- type: 'POST',
- url: '/aas/submodels/' + submodelId + '/operations/' + operationId,
- contentType: 'application/json',
- data: JSON.stringify(args),
- error: function () {
- alert("Failed to exectute with args: " + JSON.stringify(args));
- },
- success: function (data) {
- $('#argOutValue_' + submodelId + operationId).val(data.entity[0].value);
- }
- });
- }
- </script>
- <script>
- function GetDataElementValue(submodelId, dataElementId) {
- $.ajax({
- type: 'GET',
- url: '/aas/submodels/' + submodelId + '/dataElements/' + dataElementId + '/value',
- success: function (data) {
- $('#Input_' + dataElementId).val(data.entity.value);
- }
- });
- }
- </script>
-
- <script>
- function SetDataElementValue(submodelId, dataElementId, dataObjectTypeName, val) {
- var value = {
- valueType: { dataObjectType: { name: dataObjectTypeName } }, value: val
- };
- $.ajax({
- type: 'PUT',
- url: '/aas/submodels/' + submodelId + '/dataElements/' + dataElementId + '/value',
- contentType: 'application/json',
- data: JSON.stringify(value),
- error: function () {
- $('#Input_' + dataElementId).val('Error updating Data-Element-Value');
- },
- statusCode: {
- 204: function () {
- //alert("Successfully updated '" + dataElementId + "' to new value '" + val + "'");
- }
- },
- success: function () { }
- });
- }
- </script>
-
-</body>
-</html>
diff --git a/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml.cs b/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml.cs
deleted file mode 100644
index f63ba89..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Pages/Index.cshtml.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using Microsoft.AspNetCore.Mvc.RazorPages;
-
-namespace BaSys40.Component.REST.Pages
-{
- public class IndexModel : PageModel
- {
- public IAssetAdministrationShellServiceProvider ServiceProvider { get; }
-
- public IndexModel(IAssetAdministrationShellServiceProvider provider)
- {
- ServiceProvider = provider;
- }
-
- public void OnGet()
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Component.REST/Program.cs b/sdks/csnet/BaSys40.Component.REST/Program.cs
deleted file mode 100644
index 70f7fa1..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Program.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Hosting;
-using NLog.Web;
-using Microsoft.Extensions.Logging;
-using System.IO;
-
-namespace BaSys40.Component.REST
-{
- public class Program
- {
- public static ServerSettings Settings;
- public static void Main(string[] args)
- {
- var logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
- logger.Debug("Starting main method...");
-
- Settings = ServerSettings.LoadSettings();
-
- BuildWebHost(args).Run();
- }
-
- public static IWebHost BuildWebHost(string[] args)
- {
- var webHost = WebHost.CreateDefaultBuilder(args)
- .UseStartup<Startup>()
- .ConfigureLogging(logging =>
- {
- logging.ClearProviders();
- logging.SetMinimumLevel(LogLevel.Warning);
- })
- .UseNLog()
- .UseContentRoot(Directory.GetCurrentDirectory());
-
- if (Settings?.Hosting?.Urls?.Count > 0)
- webHost.UseUrls(Settings.Hosting.Urls.ToArray());
-
- return webHost.Build();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/BaSysComponent - Web Deploy.pubxml b/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/BaSysComponent - Web Deploy.pubxml
deleted file mode 100644
index 636f809..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/BaSysComponent - Web Deploy.pubxml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-This file is used by the publish/package process of your Web project. You can customize the behavior of this process
-by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <WebPublishMethod>MSDeploy</WebPublishMethod>
- <ResourceId>/subscriptions/473d17a5-47ec-4d8c-b273-8308beb30f0f/resourcegroups/BaSys/providers/Microsoft.Web/sites/BaSysComponent</ResourceId>
- <ResourceGroup>BaSys</ResourceGroup>
- <PublishProvider>AzureWebSite</PublishProvider>
- <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
- <LastUsedPlatform>Any CPU</LastUsedPlatform>
- <SiteUrlToLaunchAfterPublish>http://basyscomponent.azurewebsites.net</SiteUrlToLaunchAfterPublish>
- <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
- <ExcludeApp_Data>False</ExcludeApp_Data>
- <ProjectGuid>57cad1eb-cf7a-4063-aff0-b9a9b870a42e</ProjectGuid>
- <MSDeployServiceURL>basyscomponent.scm.azurewebsites.net:443</MSDeployServiceURL>
- <DeployIisAppPath>BaSysComponent</DeployIisAppPath>
- <RemoteSitePhysicalPath />
- <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
- <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
- <EnableMSDeployBackup>True</EnableMSDeployBackup>
- <UserName>$BaSysComponent</UserName>
- <_SavePWD>True</_SavePWD>
- <_DestinationType>AzureWebSite</_DestinationType>
- <InstallAspNetCoreSiteExtension>False</InstallAspNetCoreSiteExtension>
- </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/FolderProfile.pubxml b/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/FolderProfile.pubxml
deleted file mode 100644
index ee59b19..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Properties/PublishProfiles/FolderProfile.pubxml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-This file is used by the publish/package process of your Web project. You can customize the behavior of this process
-by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <WebPublishMethod>FileSystem</WebPublishMethod>
- <PublishProvider>FileSystem</PublishProvider>
- <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
- <LastUsedPlatform>Any CPU</LastUsedPlatform>
- <SiteUrlToLaunchAfterPublish />
- <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
- <ExcludeApp_Data>False</ExcludeApp_Data>
- <ProjectGuid>655a0dc1-7b6b-43ac-afdd-701f6c5a20d8</ProjectGuid>
- <publishUrl>bin\Release\PublishOutput</publishUrl>
- <DeleteExistingFiles>False</DeleteExistingFiles>
- </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Component.REST/ServerSettings.cs b/sdks/csnet/BaSys40.Component.REST/ServerSettings.cs
deleted file mode 100644
index 79c386f..0000000
--- a/sdks/csnet/BaSys40.Component.REST/ServerSettings.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using BaSys40.Utils.Settings;
-using System;
-using System.Collections.Generic;
-using System.Xml.Serialization;
-
-namespace BaSys40.Component.REST
-{
- public class ServerSettings : Settings<ServerSettings>
- {
- [XmlElement]
- public HostingConfiguration Hosting { get; set; }
-
- }
- [Serializable]
- public class HostingConfiguration
- {
- [XmlArrayItem("Url")]
- public List<string> Urls { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/ServerSettings.xml b/sdks/csnet/BaSys40.Component.REST/ServerSettings.xml
deleted file mode 100644
index b447e26..0000000
--- a/sdks/csnet/BaSys40.Component.REST/ServerSettings.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ServerSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <Hosting>
- <Urls>
- <Url>http://+:5080</Url>
- </Urls>
- </Hosting>
- <Miscellaneous/>
-</ServerSettings>
diff --git a/sdks/csnet/BaSys40.Component.REST/Startup.cs b/sdks/csnet/BaSys40.Component.REST/Startup.cs
deleted file mode 100644
index a7220a1..0000000
--- a/sdks/csnet/BaSys40.Component.REST/Startup.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-using BaSys40.API.ServiceProvider;
-using BaSys40.Component.REST.Controllers;
-using BaSys40.Models.Extensions;
-using BaSys40.Utils.DIExtensions;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using NLog;
-using NLog.Web;
-using Swashbuckle.AspNetCore.Swagger;
-using System;
-using System.IO;
-
-namespace BaSys40.Component.REST
-{
- public class Startup
- {
- private static Logger logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
-
- private string submodelId;
- private string aasId;
-
- private IAssetAdministrationShellServiceProvider shellService;
-
- public IConfiguration Configuration { get; }
-
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- // This method gets called by the runtime. Use this method to add services to the container.
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddMvc().AddControllersAsServices();
-
- services.ConfigureStandardImplementation();
- services.ConfigureStandardDI();
-
- /* If more than one Asset Administration Shell is accessible via this HTTP-Server uncomment the following lines *//*
- services.AddTransient(ctx =>
- {
- var smsp = ctx.GetRequiredService<IAssetAdministrationShellAggregatorServiceProvider>().GetAssetAdministrationShellServiceProvider(aasId);
- return new AssetAdministrationShellServices(smsp);
- });
- */
-
- /* Initialize IAssetAdministrationShellService Provider */
- //shellService = new ...;
-
- services.AddSingleton<IAssetAdministrationShellServiceProvider>(ctx =>
- {
- return shellService;
- });
-
-
- services.AddTransient(ctx =>
- {
- var smsp = ctx.GetRequiredService<IAssetAdministrationShellServiceProvider>().GetSubmodelServiceProvider(submodelId);
- return new SubmodelServices(smsp);
- });
-
-
- // Register the Swagger generator, defining one or more Swagger documents
- services.AddSwaggerGen(c =>
- {
- c.SwaggerDoc("v1", new Info
- {
- Version = "v1",
- Title = "BaSys 4.0 Asset Administration Shell REST-API",
- Description = "The full description of the generic BaSys 4.0 Asset Administration Shell REST-API",
- TermsOfService = "None",
- Contact = new Contact { Name = "Constantin Ziesche", Email = "constantin.ziesche@bosch.com", Url = "https://www.bosch.com/de/" },
- License = new License { Name = "Use under Eclipse Public License 2.0", Url = "https://www.eclipse.org/legal/epl-2.0/" }
- });
-
- // Set the comments path for the Swagger JSON and UI.
- var basePath = AppContext.BaseDirectory;
- var xmlPath = Path.Combine(basePath, "BaSys40.Component.REST.xml");
- c.IncludeXmlComments(xmlPath);
- c.SchemaFilter<SchemaFilter>();
- //c.DocumentFilter<DocumentFilter>();
- });
- }
-
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime applicationLifetime)
- {
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
- app.UseStaticFiles();
-
- applicationLifetime.ApplicationStopping.Register(OnShutdown);
-
- // Enable middleware to serve generated Swagger as a JSON endpoint.
- app.UseSwagger();
-
- // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
- app.UseSwaggerUI(c =>
- {
- c.SwaggerEndpoint("/swagger/v1/swagger.json", "BaSys 4.0 Asset Administration Shell REST-API");
- });
-
- app.AddStandardRewriterOptions();
-
- app.Use((context, next) =>
- {
- var pathElements = context.Request.Path.ToUriComponent().Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
-
- if (context.Request.Query?.Count > 0)
- {
- if (context.Request.Query.ContainsKey("aasId"))
- aasId = context.Request.Query["aasId"].ToString();
-
- if (context.Request.Query.ContainsKey("submodelId"))
- submodelId = context.Request.Query["submodelId"].ToString();
- }
- return next();
- });
-
- app.UseMvc();
- }
-
- private void OnShutdown()
- {
- logger.Info("Shutdown completed!");
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/SwaggerSettings.cs b/sdks/csnet/BaSys40.Component.REST/SwaggerSettings.cs
deleted file mode 100644
index 51dba7a..0000000
--- a/sdks/csnet/BaSys40.Component.REST/SwaggerSettings.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using Swashbuckle.AspNetCore.Swagger;
-using Swashbuckle.AspNetCore.SwaggerGen;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Component.REST
-{
- internal class SchemaFilter : ISchemaFilter
- {
- public void Apply(Schema model, SchemaFilterContext context)
- {
- if (context.SystemType.IsInterface)
- {
- string newName = context.SystemType.Name.Substring(1, context.SystemType.Name.Length - 1);
- model.Title = newName;
- }
- }
- }
-
- internal class DocumentFilter : IDocumentFilter
- {
- public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context)
- {
- var models = typeof(IAssetAdministrationShell).Assembly;
- var types = models.GetTypes().Where(t => Attribute.IsDefined(t, typeof(DataContractAttribute)) && !t.IsGenericType);
- foreach (var type in types)
- {
- context.SchemaRegistry.GetOrRegister(type);
- }
-
- List<string> modelRemoveList = new List<string>();
- foreach (var model in context.SchemaRegistry.Definitions)
- {
- if (model.Key.StartsWith("I") && models.GetTypes().Any(t => t.Name == model.Key && t.IsInterface))
- modelRemoveList.Add(model.Key);
- }
-
- foreach (var model in modelRemoveList)
- {
- //context.SchemaRegistry.Definitions.Remove(model);
- foreach (var schema in context.SchemaRegistry.Definitions)
- {
- ReplaceRefInSchema(schema.Value, model);
- }
- }
-
- }
-
- public void ReplaceRefInSchema(Schema schema, string modelName)
- {
- if (!string.IsNullOrEmpty(schema.Ref))
- {
- if (modelName == "IValue")
- schema.Ref = schema.Ref.Replace("IValue", "ElementValue");
- else
- schema.Ref = schema.Ref.Replace(modelName, modelName.Substring(1));
- }
- if (schema.Properties != null)
- {
- foreach (var prop in schema.Properties)
- {
- ReplaceRefInSchema(prop.Value, modelName);
- }
-
- }
- if (schema.Items != null)
- ReplaceRefInSchema(schema.Items, modelName);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Component.REST/wwwroot/images/BaSys-Logo-transparent-1080x250.png b/sdks/csnet/BaSys40.Component.REST/wwwroot/images/BaSys-Logo-transparent-1080x250.png
deleted file mode 100644
index 866b6b3..0000000
--- a/sdks/csnet/BaSys40.Component.REST/wwwroot/images/BaSys-Logo-transparent-1080x250.png
+++ /dev/null
Binary files differ
diff --git a/sdks/csnet/BaSys40.Models/BaSys40.Models.csproj b/sdks/csnet/BaSys40.Models/BaSys40.Models.csproj
deleted file mode 100644
index 9f1ec72..0000000
--- a/sdks/csnet/BaSys40.Models/BaSys40.Models.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
- <ApplicationIcon />
- <OutputType>Library</OutputType>
- <StartupObject />
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>Full</DebugType>
- </PropertyGroup>
-
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="Security\" />
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/EndpointConverter.cs b/sdks/csnet/BaSys40.Models/Connectivity/EndpointConverter.cs
deleted file mode 100644
index 9aaf6c9..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/EndpointConverter.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-
-namespace BaSys40.Models.Connectivity
-{
- public class EndpointConverter : JsonConverter<IEndpoint>
- {
- public override bool CanWrite => false;
- public override bool CanRead => true;
-
- public override IEndpoint ReadJson(JsonReader reader, Type objectType, IEndpoint existingValue, bool hasExistingValue, JsonSerializer serializer)
- {
- JObject jObject;
-
- try
- {
- jObject = JObject.Load(reader);
- }
- catch (Exception)
- {
- return null;
- }
-
- var endpointType = jObject.SelectToken("type")?.ToObject<string>();
- var address = jObject.SelectToken("address")?.ToObject<string>();
-
-
- IEndpoint endpoint = null;
- if (!string.IsNullOrEmpty(endpointType) && !string.IsNullOrEmpty(address))
- {
- endpoint = EndpointFactory.CreateEndpoint(endpointType, address, null);
- serializer.Populate(jObject.CreateReader(), endpoint);
- }
-
- return endpoint;
- }
-
- public override void WriteJson(JsonWriter writer, IEndpoint value, JsonSerializer serializer)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/EndpointFactory.cs b/sdks/csnet/BaSys40.Models/Connectivity/EndpointFactory.cs
deleted file mode 100644
index 1018f95..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/EndpointFactory.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-namespace BaSys40.Models.Connectivity
-{
- public static partial class EndpointFactory
- {
- public static IEndpoint CreateEndpoint(string endpointType, string address, IEndpointSecurity security)
- {
- switch (endpointType.ToLower())
- {
- case EndpointType.HTTP: return new HttpEndpoint(address);
- case EndpointType.MQTT:
- {
- Uri uri = new Uri(address);
- var brokerUri = uri.AbsoluteUri;
- var topic = uri.AbsolutePath;
-
- return new MqttEndpoint(brokerUri, topic);
- }
- case EndpointType.OPC_UA: return new OpcUaEndpoint(address);
- default:
- return null;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/EndpointType.cs b/sdks/csnet/BaSys40.Models/Connectivity/EndpointType.cs
deleted file mode 100644
index ae96961..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/EndpointType.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace BaSys40.Models.Connectivity
-{
- public static class EndpointType
- {
- public const string HTTP = "http";
- public const string TCP = "tcp";
- public const string MQTT = "mqtt";
- public const string OPC_UA = "opc-ua";
- public const string COAP = "coap";
- public const string WEBSOCKET = "websocket";
- }
-}
-
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/HttpEndpoint.cs b/sdks/csnet/BaSys40.Models/Connectivity/HttpEndpoint.cs
deleted file mode 100644
index 1a00ada..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/HttpEndpoint.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Connectivity
-{
- public class HttpEndpoint : IEndpoint
- {
- public string Address { get; }
-
- [IgnoreDataMember]
- public Uri Url { get; }
-
- public string Type => EndpointType.HTTP;
-
- public IEndpointSecurity Security { get; set;}
-
- [JsonConstructor]
- public HttpEndpoint(string address)
- {
- address = address ?? throw new ArgumentNullException("url");
- Url = new Uri(address);
- Address = Url.ToString();
- }
-
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/IAddressable.cs b/sdks/csnet/BaSys40.Models/Connectivity/IAddressable.cs
deleted file mode 100644
index c099e29..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/IAddressable.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Connectivity
-{
- public interface IAddressable
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "endpoints")]
- List<IEndpoint> Endpoints { get; }
- }
-
- [JsonConverter(typeof(EndpointConverter))]
- public interface IEndpoint
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "address")]
- string Address { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")]
- string Type { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "security")]
- IEndpointSecurity Security { get; }
- }
-
- public interface IEndpointSecurity
- {
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/IServiceDescriptor.cs b/sdks/csnet/BaSys40.Models/Connectivity/IServiceDescriptor.cs
deleted file mode 100644
index 9bb015c..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/IServiceDescriptor.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using BaSys40.Models.Core.Identification;
-
-namespace BaSys40.Models.Connectivity
-{
- public interface IServiceDescriptor : IAddressable, IIdentifiable
- {
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/MqttEndpoint.cs b/sdks/csnet/BaSys40.Models/Connectivity/MqttEndpoint.cs
deleted file mode 100644
index 70f7e62..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/MqttEndpoint.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-
-namespace BaSys40.Models.Connectivity
-{
- public class MqttEndpoint : IEndpoint
- {
- public string Address { get; }
-
- public Uri BrokerUri { get; }
-
- public string Topic { get; }
-
- public string Type => EndpointType.MQTT;
-
- public IEndpointSecurity Security { get; set; }
-
- public MqttEndpoint(string brokerUri, string topic)
- {
- brokerUri = brokerUri ?? throw new ArgumentNullException("url");
- BrokerUri = new Uri(brokerUri);
- Topic = topic ?? "/";
- Address = brokerUri + topic;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Connectivity/OpcUaEndpoint.cs b/sdks/csnet/BaSys40.Models/Connectivity/OpcUaEndpoint.cs
deleted file mode 100644
index 47d1e8f..0000000
--- a/sdks/csnet/BaSys40.Models/Connectivity/OpcUaEndpoint.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-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;
- }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/AssetAdministrationShellDescriptor.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/AssetAdministrationShellDescriptor.cs
deleted file mode 100644
index e72fb83..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/AssetAdministrationShellDescriptor.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell
-{
- [DataContract]
- public class AssetAdministrationShellDescriptor : IServiceDescriptor
- {
- public Identifier Identification { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string IdShort { get; set; }
- public string Category { get; set; }
- public List<Description> Descriptions { get; set; }
- public List<IEndpoint> Endpoints { get; }
- [IgnoreDataMember]
- public IReference Parent => null;
-
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "asset")]
- public IAsset Asset { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodels")]
- public List<SubmodelDescriptor> Submodels { get; set; }
-
- public AssetAdministrationShellDescriptor(params IEndpoint[] endpoints)
- {
- Endpoints = endpoints?.ToList();
- }
-
- [JsonConstructor]
- public AssetAdministrationShellDescriptor(List<IEndpoint> endpoints)
- {
- Endpoints = endpoints;
- }
-
- public AssetAdministrationShellDescriptor(IAssetAdministrationShell aas, params IEndpoint[] endpoints) : this(endpoints)
- {
- this.Identification = aas.Identification;
- this.MetaData = aas.MetaData;
- this.Administration = aas.Administration;
- this.IdShort = aas.IdShort;
- this.Category = aas.Category;
- this.Descriptions = aas.Descriptions;
- this.Asset = aas.Asset;
-
- if (aas.Submodels?.Count > 0)
- {
- this.Submodels = new List<SubmodelDescriptor>();
- foreach (var submodel in aas.Submodels)
- {
- this.Submodels.Add(new SubmodelDescriptor(submodel, endpoints));
- }
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/EntityType.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/EntityType.cs
deleted file mode 100644
index 76b0d33..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/EntityType.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Enums
-{
- [DataContract]
- public enum EntityType : int
- {
- None = 0,
- Primitive = 1,
- Object = 2
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/Kind.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/Kind.cs
deleted file mode 100644
index f7c74ff..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/Kind.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Enums
-{
- [DataContract]
- public enum Kind : int
- {
- Type = 0,
- Instance = 1
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs
deleted file mode 100644
index 6cf3f42..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Enums
-{
- [DataContract]
- public enum SchemaType : int
- {
- None = 0,
- XSD = 1,
- RDFS = 2,
- JSchema = 3
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ConceptDictionary.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ConceptDictionary.cs
deleted file mode 100644
index 0028947..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ConceptDictionary.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public class ConceptDictionary : IReferable
- {
- public string IdShort { get; set; }
-
- public string Category { get; set; }
-
- public List<Description> Descriptions { get; set; }
-
- public IReference Parent { get; set; }
-
- public Dictionary<string, string> MetaData { get; set; }
-
- public List<IReference<IConceptDescription>> ConceptDescriptions { get; set; }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IBlob.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IBlob.cs
deleted file mode 100644
index 61b7799..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IBlob.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes
-{
- public interface IBlob : IDataElement<byte[]>
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "mimeType")]
- string MimeType { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IDataElementCollection.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IDataElementCollection.cs
deleted file mode 100644
index 9052c04..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IDataElementCollection.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes
-{
- public interface IDataElementCollection : IDataElement<ElementContainer<IDataElement>>
- { }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IFile.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IFile.cs
deleted file mode 100644
index 6dc3f6b..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IFile.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes
-{
- public interface IFile : IDataElement<string>
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "mimeType")]
- string MimeType { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IProperty.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IProperty.cs
deleted file mode 100644
index 8aa5446..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IProperty.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Extensions;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes
-{
- public interface IProperty : IDataElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueId")]
- IReference ValueId { get; set; }
- }
-
- public interface IProperty<T> : IProperty, IValue<T>
- { }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IReferenceElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IReferenceElement.cs
deleted file mode 100644
index 7592b7b..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/DataElementSubtypes/IReferenceElement.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes
-{
- public interface IReferenceElement<out T> : IDataElement<T> where T : IReference
- { }
-}
-
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IArgument.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IArgument.cs
deleted file mode 100644
index 4e2b465..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IArgument.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.Constraints;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IArgument : IQualifiable, IValue
- {
- [DataMember]
- int? Index { get; set; }
- [DataMember]
- string IdShort { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAsset.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAsset.cs
deleted file mode 100644
index 695c2f5..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAsset.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- [ExportAsReference(KeyElements.Asset, JsonSchemaIgnore = true)]
- public interface IAsset : IIdentifiable, ITypeable, IHasSemantics, IModelElement, IHasDataSpecification
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "assetIdentificationModel")]
- IReference<ISubmodel> AssetIdentificationModel { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs
deleted file mode 100644
index 047a914..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Core.Views;
-using BaSys40.Models.Export;
-using BaSys40.Models.Semantics;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
-
- public interface IAssetAdministrationShell : IIdentifiable, IModelElement, IHasDataSpecification
- {
- [JsonProperty, DataMember(EmitDefaultValue = false, IsRequired = false, Name = "derivedFrom")]
- IReference<IAssetAdministrationShell> DerivedFrom { get; }
-
- [ExportAsReference(KeyElements.Asset), DataMember(EmitDefaultValue = false, IsRequired = false, Name = "asset")]
- IAsset Asset { get; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodels")]
- ElementContainer<ISubmodel> Submodels { get; set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "views")]
- ElementContainer<IView> Views { get; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "conceptDictionaries")]
- List<ConceptDictionary> ConceptDictionaries { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IConceptDescription.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IConceptDescription.cs
deleted file mode 100644
index c82b859..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IConceptDescription.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IConceptDescription : IIdentifiable, IHasDataSpecification, IModelElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "isCaseOf")]
- List<IReference> IsCaseOf { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataElement.cs
deleted file mode 100644
index fca6d47..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataElement.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IDataElement : ISubmodelElement, IValue
- {
- }
- public interface IDataElement<out TValue> : IDataElement, IValue<TValue>
- { }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataSpecificationContent.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataSpecificationContent.cs
deleted file mode 100644
index f549576..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IDataSpecificationContent.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IDataSpecificationContent
- {
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IElementContainer.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IElementContainer.cs
deleted file mode 100644
index 95095e5..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IElementContainer.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IElementContainer<Identifier, Elements> : IList<Elements>
- {
- Elements this[Identifier id] { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEmbeddedDataSpecification.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEmbeddedDataSpecification.cs
deleted file mode 100644
index 2ccf072..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEmbeddedDataSpecification.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IEmbeddedDataSpecification
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "hasDataSpecification")]
- IReference HasDataSpecification { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "dataSpecificationContent")]
- IDataSpecificationContent DataSpecificationContent { get; }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEvent.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEvent.cs
deleted file mode 100644
index abd4d06..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IEvent.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IEvent : ISubmodelElement
- {
- [DataMember]
- DataType DataType { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperation.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperation.cs
deleted file mode 100644
index 042c675..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperation.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IOperation : ISubmodelElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "in")]
- List<IOperationVariable> In { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "out")]
- List<IOperationVariable> Out { get; set; }
- }
-
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs
deleted file mode 100644
index 9b3fa3e..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IOperationVariable : ISubmodelElement
- {
- [DataMember]
- int? Index { get; set; }
- [DataMember]
- DataType DataType { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IPublishableEvent.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IPublishableEvent.cs
deleted file mode 100644
index 7b7981b..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IPublishableEvent.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using System.Runtime.Serialization;
-using BaSys40.Models.Core.Extensions.References;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IPublishableEvent : IIdentifiable
- {
- [DataMember]
- string Originator { get; }
-
- [DataMember]
- Reference<IEvent> EventDescriptionReference { get; }
-
- [DataMember]
- string TimeStamp { get; }
-
- [DataMember]
- string Message { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IRelationshipElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IRelationshipElement.cs
deleted file mode 100644
index e9944bf..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IRelationshipElement.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IRelationshipElement : ISubmodelElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "first")]
- Reference<IReferable> First { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "second")]
- Reference<IReferable> Second { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModel.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModel.cs
deleted file mode 100644
index fe25c88..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModel.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- [ExportAsReference(KeyElements.Submodel, JsonSchemaIgnore = true)]
- public interface ISubmodel : IIdentifiable, ITypeable, IHasSemantics, IModelElement, IHasDataSpecification
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "dataElements")]
- ElementContainer<IDataElement> DataElements { get; set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "operations")]
- ElementContainer<IOperation> Operations { get; set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "events")]
- ElementContainer<IEvent> Events { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodelElements")]
- ElementContainer<ISubmodelElement> SubmodelElements { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModelElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModelElement.cs
deleted file mode 100644
index f77e501..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/ISubModelElement.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Core.Constraints;
-using BaSys40.Models.Semantics;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface ISubmodelElement : IHasSemantics, IQualifiable, IReferable, ITypeable, IModelElement, IHasDataSpecification
- { }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IValue.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IValue.cs
deleted file mode 100644
index 29f77ef..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Generics/IValue.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Generics
-{
- public interface IValue
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
- object Value { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueType")]
- DataType ValueType { get; }
- T ToObject<T>();
- }
-
- public interface IValue<out T> : IValue
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
- new T Value { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Argument.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Argument.cs
deleted file mode 100644
index b05f0b7..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Argument.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Constraints;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class Argument : IArgument
- {
- public virtual object Value { get; set; }
- public virtual DataType ValueType { get; set; }
- public int? Index { get; set; }
- public string IdShort { get; set; }
- public List<IConstraint> Constraints { get; set; }
- public IReference SemanticId { get; set; }
-
- public Argument()
- { }
-
- public Argument(IOperationVariable param, object value)
- {
- this.ValueType = param.DataType;
- this.IdShort = param.IdShort;
- this.Index = param.Index;
- this.Constraints = param.Constraints;
- this.SemanticId = param.SemanticId;
- this.Value = value;
- this.Constraints = param.Constraints;
- }
-
- public T ToObject<T>()
- {
- return new DataElementValue(Value, ValueType).ToObject<T>();
- }
- }
-
- [DataContract]
- public class Argument<TInnerType> : Argument, IValue<TInnerType>
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueType")]
- public override DataType ValueType => DataType.GetDataTypeFromSystemTypes(typeof(TInnerType));
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
- public virtual new TInnerType Value
- {
- get
- {
- if (base.Value != null)
- return (TInnerType)base.Value;
- else
- return default(TInnerType);
- }
- set => base.Value = value;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Asset.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Asset.cs
deleted file mode 100644
index 2809f3b..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Asset.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class Asset : IAsset
- {
- public string IdShort { get; set; }
- public Identifier Identification { get; set; }
- public Kind? Kind { get; set; }
- public List<Description> Descriptions { get; set; }
- public IReference Parent { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
- public IReference<ISubmodel> AssetIdentificationModel { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string Category { get; set; }
- public IReference SemanticId { get; set; }
- public List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; }
- public IConceptDescription ConceptDescription { get; set; }
- public ModelType ModelType => ModelType.Asset;
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs
deleted file mode 100644
index 0234a1c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Core.Views;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class AssetAdministrationShell : IAssetAdministrationShell
- {
- public string IdShort { get; set; }
- public Identifier Identification { get; set; }
- [ExportAsReference(KeyElements.Asset)]
- public IAsset Asset { get; set; }
- [ExportAsReference(KeyElements.Submodel)]
- public ElementContainer<ISubmodel> Submodels { get; set; }
- public IReference Parent { get; set; }
- public List<Description> Descriptions { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
- public IReference<IAssetAdministrationShell> DerivedFrom { get; set; }
- public ElementContainer<IView> Views { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string Category { get; set; }
- public ModelType ModelType => ModelType.AssetAdministationShell;
- public List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; }
- public List<ConceptDictionary> ConceptDictionaries { get; set; }
- public IConceptDescription ConceptDescription { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ConceptDescription.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ConceptDescription.cs
deleted file mode 100644
index b52ab4f..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ConceptDescription.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- public class ConceptDescription : IConceptDescription
- {
- public List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; set; }
-
- public List<IReference> IsCaseOf { get; set; }
-
- public Identifier Identification { get; set; }
-
- public AdministrativeInformation Administration { get; set; }
-
- public string IdShort { get; set; }
-
- public string Category { get; set; }
-
- public List<Description> Descriptions { get; set; }
-
- public IReference Parent { get; set; }
-
- public Dictionary<string, string> MetaData { get; set; }
-
- public ModelType ModelType => ModelType.ConceptDescription;
-
- IConceptDescription IHasDataSpecification.ConceptDescription => this;
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElement.cs
deleted file mode 100644
index d8fd13c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElement.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract, JsonConverter(typeof(DataElementValueConverter))]
- public class DataElement : SubmodelElement, IDataElement
- {
- public virtual object Value { get; set; }
- public virtual DataType ValueType { get; set; }
- public override ModelType ModelType => ModelType.DataElement;
-
- public DataElement(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
-
- public T ToObject<T>()
- {
- if (DataType.GetDataTypeFromSystemTypes(typeof(T)) == ValueType)
- return (T)Value;
- else
- throw new InvalidCastException("Cannot convert " + DataType.GetDataTypeFromSystemTypes(typeof(T)).DataObjectType + " to " + ValueType.DataObjectType);
- }
- }
- [DataContract]
- public class DataElement<TValue> : DataElement, IDataElement<TValue>
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
- public virtual new TValue Value
- {
- get
- {
- if (base.Value != null)
- return (TValue)base.Value;
- else
- return default(TValue);
- }
- set => base.Value = value;
- }
-
- public DataElement() : this(null) { }
-
- [JsonConstructor]
- public DataElement(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementFactory.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementFactory.cs
deleted file mode 100644
index 3192890..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementFactory.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes;
-using System.Collections.Generic;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- public static class DataElementFactory
- {
- public static IDataElement CreateDataElement(IConceptDescription conceptDescription, List<IEmbeddedDataSpecification> embeddedDataSpecifications, DataObjectType modelType, DataType valueType = null)
- {
- if (modelType == ModelType.Property || modelType == DataObjectType.DateTime)
- return new Property(valueType, conceptDescription, embeddedDataSpecifications.ToArray());
- else if (modelType == ModelType.Blob)
- return new Blob(conceptDescription, embeddedDataSpecifications.ToArray());
- else if (modelType == ModelType.File)
- return new File(conceptDescription, embeddedDataSpecifications.ToArray());
- else if (modelType == ModelType.ReferenceElement)
- return new ReferenceElement(conceptDescription, embeddedDataSpecifications.ToArray());
- else if (modelType == ModelType.DataElementCollection)
- return new DataElementCollection(conceptDescription, embeddedDataSpecifications.ToArray());
- else
- return null;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Blob.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Blob.cs
deleted file mode 100644
index ab7ec38..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Blob.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes
-{
- [DataContract]
- public class Blob : DataElement<byte[]>, IBlob
- {
- public override ModelType ModelType => ModelType.Blob;
- public string MimeType { get; set; }
- public Blob() : this(null) { }
- [JsonConstructor]
- public Blob(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications) { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/DataElementCollection.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/DataElementCollection.cs
deleted file mode 100644
index a28c6cd..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/DataElementCollection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes
-{
- [DataContract]
- public class DataElementCollection : DataElement<ElementContainer<IDataElement>>, IDataElementCollection
- {
- public override ModelType ModelType => ModelType.SubmodelElementCollection;
- public override ElementContainer<IDataElement> Value { get => base.Value; set => base.Value = value; }
-
- public DataElementCollection() : this(null) { }
-
- [JsonConstructor]
- public DataElementCollection(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications) { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/File.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/File.cs
deleted file mode 100644
index 550b4e3..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/File.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes
-{
- [DataContract]
- public class File : DataElement<string>, IFile
- {
- public override ModelType ModelType => ModelType.File;
- public string MimeType { get; set; }
- public File() : this(null) { }
- [JsonConstructor]
- public File(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications) { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Property.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Property.cs
deleted file mode 100644
index d7baffc..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/Property.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes;
-using BaSys40.Models.Core.Extensions.References;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes
-{
- [DataContract]
- public class Property : DataElement, IProperty
- {
- public override ModelType ModelType => ModelType.Property;
- public override object Value { get => base.Value; set => base.Value = value; }
- public IReference ValueId { get; set; }
-
- public Property(DataType valueType) : this(valueType, null, null) { }
-
- public Property(DataType valueType, IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications) : this(valueType, null, conceptDescription, embeddedDataSpecifications)
- { }
-
- [JsonConstructor]
- public Property(DataType valueType, object value, IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications) : base(conceptDescription, embeddedDataSpecifications)
- {
- ValueType = valueType;
- Value = value;
- }
- }
-
- [DataContract]
- public class Property<TInnerType> : DataElement<TInnerType>, IProperty<TInnerType>
- {
- public override ModelType ModelType => ModelType.Property;
- public override TInnerType Value { get => base.Value; set => base.Value = value; }
- public override DataType ValueType => DataType.GetDataTypeFromSystemTypes(typeof(TInnerType));
- public IReference ValueId { get; set; }
-
- public Property() : this(null) { }
-
- [JsonConstructor]
- public Property(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications) { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/ReferenceElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/ReferenceElement.cs
deleted file mode 100644
index 245cf98..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementSubtypes/ReferenceElement.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics.DataElementSubtypes;
-using BaSys40.Models.Core.Extensions.References;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes
-{
- [DataContract]
- public class ReferenceElement : DataElement<IReference>, IReferenceElement<IReference>
- {
- public override ModelType ModelType => ModelType.ReferenceElement;
-
- public ReferenceElement() : this(null) { }
- [JsonConstructor]
- public ReferenceElement(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications) { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValue.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValue.cs
deleted file mode 100644
index bbf9d1c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValue.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class DataElementValue : IValue
- {
- public object Value { get; set; }
- public DataType ValueType { get; protected set; }
-
- [JsonConstructor]
- public DataElementValue(object value, DataType dataType)
- {
- Value = value;
- ValueType = dataType;
- }
-
- public T ToObject<T>()
- {
- if (Value is T)
- return (T)Value;
- else
- {
- try
- {
- Value = Convert.ChangeType(Value, DataType.GetSystemTypeFromDataType(ValueType));
- return (T)Value;
- }
- catch (Exception e)
- {
- try
- {
- var jVal = JValue.Parse(Value.ToString());
- var convertedVal = jVal.ToObject<T>();
- return convertedVal;
- }
- catch (Exception)
- {
- throw new InvalidCastException("Cannot convert " + DataType.GetDataTypeFromSystemTypes(typeof(T)).DataObjectType + " to " + ValueType.DataObjectType + "- Exception: " + e.Message);
- }
- }
- }
- }
- }
- [DataContract]
- public class DataElementValue<TValue> : DataElementValue, IValue<TValue>
- {
- public new TValue Value { get; set; }
-
- public DataElementValue() : this(default(TValue), DataType.GetDataTypeFromSystemTypes(typeof(TValue)))
- { }
-
- public DataElementValue(TValue value) : this(value, DataType.GetDataTypeFromSystemTypes(typeof(TValue)))
- { }
-
- public DataElementValue(TValue value, DataType dataType) : base(value, dataType)
- {
- Value = value;
- ValueType = dataType;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValueConverter.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValueConverter.cs
deleted file mode 100644
index 08c32b2..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataElementValueConverter.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- public class DataElementValueConverter : JsonConverter<IDataElement>
- {
- static Dictionary<string, Type> DataElementInformationTypes;
- static DataElementValueConverter()
- {
- DataElementInformationTypes = new Dictionary<string, Type>();
- var types = typeof(DataElementValueConverter).Assembly.GetTypes();
- foreach (Type type in types)
- {
- var attrib = type.GetCustomAttribute(typeof(DataSpecificationAttribute), false);
- if(attrib != null && attrib is DataSpecificationAttribute dataSpecificationAttribute)
- {
- DataElementInformationTypes.Add(dataSpecificationAttribute.Reference.First.Value, type);
- }
- }
-
- }
-
- public override bool CanWrite => false;
- public override bool CanRead => true;
-
- public override IDataElement ReadJson(JsonReader reader, Type objectType, IDataElement existingValue, bool hasExistingValue, JsonSerializer serializer)
- {
- JObject jObject;
-
- try
- {
- jObject = JObject.Load(reader);
- }
- catch (Exception)
- {
- return null;
- }
-
- var modelTypeToken = jObject.SelectToken("modelType")?.ToObject<ModelType>();
- var valueTypeToken = jObject.SelectToken("valueType")?.ToObject<DataType>();
- var embeddedDataSpecificationsToken = jObject.SelectToken("embeddedDataSpecifications");
- var conceptDescriptionToken = jObject.SelectToken("conceptDescription");
-
- IDataElement dataElement;
- List<IEmbeddedDataSpecification> embeddedDataSpecifications = null;
- ConceptDescription conceptDescription = null;
- var embeddedDataSpecificationsTokenChildToken = embeddedDataSpecificationsToken?.Children();
- if (embeddedDataSpecificationsTokenChildToken != null) //
- {
- embeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
- foreach (var dataSpecificationToken in embeddedDataSpecificationsTokenChildToken)
- {
- var dataSpecReference = dataSpecificationToken.SelectToken("hasDataSpecification")?.ToObject<Reference>();
- if (dataSpecReference != null && DataElementInformationTypes.TryGetValue(dataSpecReference.First.Value, out Type type))
- {
- var content = dataSpecificationToken.SelectToken("dataSpecificationContent")?.ToObject(type);
- if (content != null)
- embeddedDataSpecifications.Add((IEmbeddedDataSpecification)content);
- }
- }
- jObject.Remove("embeddedDataSpecifications");
- }
- if(conceptDescriptionToken != null)
- {
- var dataSpecifications = conceptDescriptionToken.SelectToken("embeddedDataSpecifications")?.Children();
- if(dataSpecifications != null)
- {
- conceptDescription.EmbeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
- foreach (var dataSpecificationToken in dataSpecifications)
- {
- var dataSpecReference = dataSpecificationToken.SelectToken("hasDataSpecification")?.ToObject<Reference>();
- if (dataSpecReference != null && DataElementInformationTypes.TryGetValue(dataSpecReference.First.Value, out Type type))
- {
- var content = dataSpecificationToken.SelectToken("dataSpecificationContent")?.ToObject(type);
- if (content != null)
- conceptDescription.EmbeddedDataSpecifications.Add((IEmbeddedDataSpecification)content);
- }
- }
- }
- serializer.Populate(conceptDescriptionToken.CreateReader(), conceptDescription);
- }
-
- if (modelTypeToken != null)
- dataElement = DataElementFactory.CreateDataElement(conceptDescription, embeddedDataSpecifications, modelTypeToken, valueTypeToken);
- else
- return null;
-
- serializer.Populate(jObject.CreateReader(), dataElement);
-
- return dataElement;
- }
-
- public override void WriteJson(JsonWriter writer, IDataElement value, JsonSerializer serializer)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/DataSpecification_IEC61360.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/DataSpecification_IEC61360.cs
deleted file mode 100644
index 3985a55..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/DataSpecification_IEC61360.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataSpecifications
-{
- [DataContract, DataSpecification("www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360")]
- public class DataSpecification_IEC61360 : IEmbeddedDataSpecification
- {
- public IReference HasDataSpecification => new Reference(
- new GlobalKey(KeyElements.GlobalReference, KeyType.URI, "www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360"));
- public IDataSpecificationContent DataSpecificationContent { get; set; }
- }
-
- [DataContract]
- public class DataSpecification_IEC61360_Content : IDataSpecificationContent
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name ="dataType")]
- public string DataType { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "Definition")]
- public LangString Definition { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "preferredName")]
- public LangString PreferredName { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "shortName")]
- public string ShortName { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "sourceOfDefinition")]
- public LangString SourceOfDefinition { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "symbol")]
- public string Symbol { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "code")]
- public Code Code { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "unit")]
- public string Unit { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "unitId")]
- public IReference UnitId { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueFormat")]
- public string ValueFormat { get; set; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueList")]
- public List<object> ValueList { get; set; }
- }
-
- public enum Code
- {
-
- }
-
- public class LangString
- {
- public string Language { get; set; }
- public string Text { get; set; }
- public LangString(string language, string text)
- {
- Language = language;
- Text = text;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/EndpointSpecification.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/EndpointSpecification.cs
deleted file mode 100644
index 739d55c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/DataSpecifications/EndpointSpecification.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataSpecifications
-{
- [DataContract, DataSpecification("www.basys.org/DataSpecifications/EndpointSpecification")]
- public class EndpointSpecification : IEmbeddedDataSpecification
- {
- public IReference HasDataSpecification => new Reference(
- new GlobalKey(KeyElements.GlobalReference, KeyType.URI, "www.basys.org/DataSpecifications/EndpointSpecification"));
- public IDataSpecificationContent DataSpecificationContent { get; set; }
- }
-
- [DataContract]
- public class EndpointSpecificationContent : IDataSpecificationContent
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "endpoints")]
- public List<IEndpoint> Endpoints { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ElementContainer.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ElementContainer.cs
deleted file mode 100644
index c6b14ab..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/ElementContainer.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Utils.ResultHandling;
-using System.Collections.Generic;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- public class ElementContainer<T> : List<T>, IElementContainer<string, T> where T : IReferable
- {
- public Dictionary<string, string> MetaData { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string IdShort { get; set; }
- public string Category { get; set; }
- public List<Description> Descriptions { get; set; }
- public IReference Parent { get; set; }
- public ModelType ModelElementType => ModelType.DataElementCollection;
-
- public T this[string idShort] => this.Find(e => e.IdShort == idShort);
-
- public virtual IResult<T> Create(T element)
- {
- Add(element);
- return new Result<T>(true, element);
- }
- public virtual IResult<ElementContainer<T>> RetrieveAll()
- {
- if (Count == 0)
- return new Result<ElementContainer<T>>(true, new EmptyMessage());
- else
- return new Result<ElementContainer<T>>(true, this);
- }
-
-
- public virtual IResult<T> Retrieve(string id)
- {
- var element = this[id];
- if (element != null)
- return new Result<T>(true, element);
- else
- return new Result<T>(false, new NotFoundMessage());
- }
-
- public virtual IResult<T> Update(string id, T element)
- {
- var index = FindIndex(e => e.IdShort == id);
- if (index != -1)
- {
- this[index] = element;
- return new Result<T>(true, element);
- }
- return new Result<T>(false, new NotFoundMessage());
- }
-
- public virtual IResult Delete(string id)
- {
- var index = FindIndex(e => e.IdShort == id);
- if (index != -1)
- {
- RemoveAt(index);
- return new Result(true);
- }
- return new Result(false, new NotFoundMessage());
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Event.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Event.cs
deleted file mode 100644
index 4bdf2ca..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Event.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class Event : SubmodelElement, IEvent
- {
- public DataType DataType { get; set; }
-
- public override ModelType ModelType => ModelType.Event;
-
- public Event() : base()
- { }
- [JsonConstructor]
- public Event(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Operation.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Operation.cs
deleted file mode 100644
index 6037f8c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/Operation.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using Newtonsoft.Json;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class Operation : SubmodelElement, IOperation
- {
- public List<IOperationVariable> In { get; set; }
- public List<IOperationVariable> Out { get; set; }
-
- public override ModelType ModelType => ModelType.Operation;
-
- public Operation() : base()
- { }
-
- [JsonConstructor]
- public Operation(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs
deleted file mode 100644
index 2e81d5e..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class OperationVariable : SubmodelElement, IOperationVariable
- {
- public int? Index { get; set; }
- public virtual DataType DataType { get; set; }
- public override ModelType ModelType => ModelType.OperationVariable;
- public new Kind? Kind => Enums.Kind.Type;
-
- public OperationVariable() : base()
- { }
- public OperationVariable(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
- }
-
- [DataContract]
- public class OperationVariable<TInnerType> : OperationVariable
- {
- public override DataType DataType => DataType.GetDataTypeFromSystemTypes(typeof(TInnerType));
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/RelationshipElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/RelationshipElement.cs
deleted file mode 100644
index 58a4b7f..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/RelationshipElement.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- public class RelationshipElement : SubmodelElement, IRelationshipElement
- {
- public override ModelType ModelType => ModelType.RelationshipElement;
-
- public Reference<IReferable> First { get; set; }
-
- public Reference<IReferable> Second { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubModel.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubModel.cs
deleted file mode 100644
index fb6ffd8..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubModel.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class Submodel : ISubmodel
- {
- public string IdShort { get; set; }
- public Identifier Identification { get; set; }
- public IReference Parent { get; set; }
- public Kind? Kind { get; set; }
- public IReference SemanticId { get; set; }
- public List<Description> Descriptions { get; set; }
- public ElementContainer<IDataElement> DataElements { get; set; }
- public ElementContainer<IOperation> Operations { get; set; }
- public ElementContainer<IEvent> Events { get; set; }
- public ElementContainer<ISubmodelElement> SubmodelElements { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string Category { get; set; }
- public ModelType ModelType => ModelType.Submodel;
- public List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; set; }
- public IConceptDescription ConceptDescription { get; set; }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs
deleted file mode 100644
index b55c4d5..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Constraints;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public abstract class SubmodelElement : ISubmodelElement
- {
- public IReference SemanticId { get; set; }
-
- public List<IConstraint> Constraints { get; set; }
-
- public string IdShort { get; set; }
-
- public string Category { get; set; }
-
- public List<Description> Descriptions { get; set; }
-
- public IReference Parent { get; set; }
-
- public Dictionary<string, string> MetaData { get; set; }
-
- public Kind? Kind { get; set; }
-
- public abstract ModelType ModelType { get; }
-
- public List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; set; }
- public IConceptDescription ConceptDescription { get; set; }
-
- public SubmodelElement() : this(null)
- { }
-
- [JsonConstructor]
- public SubmodelElement(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- {
- ConceptDescription = conceptDescription;
- EmbeddedDataSpecifications = embeddedDataSpecifications?.ToList();
-
- if (ConceptDescription?.EmbeddedDataSpecifications?.Count > 0)
- EmbeddedDataSpecifications.AddRange(ConceptDescription.EmbeddedDataSpecifications);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementCollection.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementCollection.cs
deleted file mode 100644
index a916288..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementCollection.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell.Implementations
-{
- [DataContract]
- public class SubmodelElementCollection : DataElement<ElementContainer<ISubmodelElement>>
- {
- public override ModelType ModelType => ModelType.SubmodelElementCollection;
- public override ElementContainer<ISubmodelElement> Value { get => base.Value; set => base.Value = value; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "allowDuplicates")]
- public bool AllowDuplicates { get; set; } = false;
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "ordered")]
- public bool Ordered { get; set; } = false;
-
- public SubmodelElementCollection() : this(null) { }
-
- [JsonConstructor]
- public SubmodelElementCollection(IConceptDescription conceptDescription, params IEmbeddedDataSpecification[] embeddedDataSpecifications)
- : base(conceptDescription, embeddedDataSpecifications)
- { }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/SubModelDescriptor.cs b/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/SubModelDescriptor.cs
deleted file mode 100644
index 931993a..0000000
--- a/sdks/csnet/BaSys40.Models/Core/AssetAdministrationShell/SubModelDescriptor.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using BaSys40.Models.Connectivity;
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using BaSys40.Utils.PathHandling;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.AssetAdministrationShell
-{
- [DataContract]
- public class SubmodelDescriptor : IServiceDescriptor, IHasSemantics, ITypeable
- {
- public Identifier Identification { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
- public AdministrativeInformation Administration { get; set; }
- public string IdShort { get; set; }
- public string Category { get; set; }
- public List<Description> Descriptions { get; set; }
- public IReference SemanticId { get; set; }
- public Kind? Kind { get; set; }
- public List<IEndpoint> Endpoints { get; private set; }
- [IgnoreDataMember]
- public IReference Parent => null;
-
- public SubmodelDescriptor(string idShort, params IEndpoint[] endpoints)
- {
- IdShort = idShort;
- HandleEndpoints(endpoints);
- }
-
- [JsonConstructor]
- public SubmodelDescriptor(string idShort, List<IEndpoint> endpoints)
- {
- IdShort = idShort;
- if(endpoints != null)
- HandleEndpoints(endpoints.ToArray());
- }
-
- public SubmodelDescriptor(ISubmodel submodel, params IEndpoint[] endpoints)
- {
- Identification = submodel.Identification;
- MetaData = submodel.MetaData;
- Administration = submodel.Administration;
- IdShort = submodel.IdShort;
- Category = submodel.Category;
- Descriptions = submodel.Descriptions;
- SemanticId = submodel.SemanticId;
- Kind = submodel.Kind;
-
- HandleEndpoints(endpoints);
- }
-
- private void HandleEndpoints(IEndpoint[] endpoints)
- {
- if (endpoints == null)
- return;
-
- var newEndpoints = new List<IEndpoint>();
- foreach (var endpoint in endpoints)
- {
- if (!endpoint.Address.Contains("submodels"))
- {
- string address = Path.GetFormattedEndpoint(endpoint.Address, "submodels", IdShort);
- var newEndpoint = EndpointFactory.CreateEndpoint(endpoint.Type, address, endpoint.Security);
- newEndpoints.Add(newEndpoint);
- }
- else
- newEndpoints.Add(endpoint);
- }
- Endpoints = newEndpoints;
- }
-
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Attributes/DataSpecificationAttribute.cs b/sdks/csnet/BaSys40.Models/Core/Attributes/DataSpecificationAttribute.cs
deleted file mode 100644
index 4ca55a1..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Attributes/DataSpecificationAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System;
-
-namespace BaSys40.Models.Core.Attributes
-{
- [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
- sealed class DataSpecificationAttribute : Attribute
- {
- readonly IReference reference;
-
- public DataSpecificationAttribute(string dataSpecificationReference)
- {
- reference = new Reference(
- new GlobalKey(KeyElements.GlobalReference, KeyType.URI, dataSpecificationReference));
- }
-
- public IReference Reference
- {
- get { return reference; }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Attributes/ExportAsReferenceAttribute.cs b/sdks/csnet/BaSys40.Models/Core/Attributes/ExportAsReferenceAttribute.cs
deleted file mode 100644
index 9313695..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Attributes/ExportAsReferenceAttribute.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System;
-
-namespace BaSys40.Models.Core.Attributes
-{
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = true)]
- public sealed class ExportAsReferenceAttribute : Attribute
- {
- readonly KeyElements keyElement;
- public ExportAsReferenceAttribute(KeyElements keyElement)
- {
- this.keyElement = keyElement;
- }
-
- public KeyElements KeyElement
- {
- get { return keyElement; }
- }
-
- public bool JsonSchemaIgnore { get; set; } = false;
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/Constraint.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/Constraint.cs
deleted file mode 100644
index c73bca0..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/Constraint.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using Newtonsoft.Json;
-
-namespace BaSys40.Models.Core.Constraints
-{
- [JsonConverter(typeof(ConstraintConverter))]
- public interface IConstraint : IModelElement
- { }
-
- public abstract class Constraint : IConstraint
- {
- public abstract ModelType ModelType { get; }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/ConstraintConverter.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/ConstraintConverter.cs
deleted file mode 100644
index 635e5d7..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/ConstraintConverter.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-
-namespace BaSys40.Models.Core.Constraints
-{
- public class ConstraintConverter : JsonConverter<IConstraint>
- {
- public override bool CanWrite => false;
- public override bool CanRead => true;
-
- public override IConstraint ReadJson(JsonReader reader, Type objectType, IConstraint existingValue, bool hasExistingValue, JsonSerializer serializer)
- {
- JObject jObject;
-
- try
- {
- jObject = JObject.Load(reader);
- }
- catch (Exception)
- {
- return null;
- }
-
- var modelTypeToken = jObject.SelectToken("modelType")?.ToObject<ModelType>();
-
- IConstraint constraint;
-
- if (modelTypeToken != null)
- {
- if (modelTypeToken == ModelType.Qualifier)
- constraint = new Qualifier();
- else if (modelTypeToken == ModelType.Formula)
- constraint = new Formula();
- else
- return null;
- }
- else
- return null;
-
- serializer.Populate(jObject.CreateReader(), constraint);
-
- return constraint;
- }
-
- public override void WriteJson(JsonWriter writer, IConstraint value, JsonSerializer serializer)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionLogic.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionLogic.cs
deleted file mode 100644
index dcbc7f7..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionLogic.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- [DataContract]
- public enum ExpressionLogic : int
- {
- None = 0,
- Equal = 1,
- NotEqual = 2,
- GreaterThan = 3,
- GreaterEqual = 4,
- Less = 5,
- LessEqual = 6
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionSemantic.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionSemantic.cs
deleted file mode 100644
index 4f39f59..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/ExpressionSemantic.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- [DataContract]
- public enum ExpressionSemantic : int
- {
- None = 0,
- Requirement = 1,
- Assurance = 2,
- Confirmation = 3,
- Measurement = 4,
- Setting = 5
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/Formula.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/Formula.cs
deleted file mode 100644
index cd91ac7..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/Formula.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- public class Formula : IConstraint, IFormula
- {
- public List<IReference> DependsOn { get; set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "modelType")]
- public ModelType ModelType => ModelType.Formula;
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/IFormula.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/IFormula.cs
deleted file mode 100644
index 038a8f3..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/IFormula.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- public interface IFormula : IConstraint
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "dependsOn")]
- List<IReference> DependsOn { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifiable.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifiable.cs
deleted file mode 100644
index ff22bd9..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifiable.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- public interface IQualifiable
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "constraints")]
- List<IConstraint> Constraints { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifier.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifier.cs
deleted file mode 100644
index ca38f69..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/IQualifier.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Semantics;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- public interface IQualifier : IConstraint, IHasSemantics
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "qualifierType")]
- string QualifierType { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "qualifierValue")]
- object QualifierValue { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "qualifierValueId")]
- IReference QualifierValueId { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/Qualifier.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/Qualifier.cs
deleted file mode 100644
index 2879990..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/Qualifier.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- [DataContract]
- public class Qualifier : IConstraint, IQualifier
- {
- public string QualifierType { get; set; }
-
- public object QualifierValue { get; set; }
-
- public IReference SemanticId { get; set; }
- public ModelType ModelType => ModelType.Qualifier;
- public IReference QualifierValueId { get; set; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Constraints/QualifierType.cs b/sdks/csnet/BaSys40.Models/Core/Constraints/QualifierType.cs
deleted file mode 100644
index 8517d6a..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Constraints/QualifierType.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Constraints
-{
- [DataContract]
- public static class QualifierType
- {
- public const string ExpressionLogic = "ExpressionLogic";
- public const string ExpressionSemantic = "ExpressionSemantic";
- public const string Enumeration = "Enumeration";
- public const string Owner = "Owner";
- public const string Min = "Min";
- public const string Max = "Max";
- public const string StrLen = "StrLen";
- public const string MimeType = "MimeType";
- public const string RegEx = "RegEx";
- public const string Existence = "Existence";
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/DataObjectType.cs b/sdks/csnet/BaSys40.Models/Core/DataObjectType.cs
deleted file mode 100644
index 4481b55..0000000
--- a/sdks/csnet/BaSys40.Models/Core/DataObjectType.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core
-{
- [DataContract]
- public class DataObjectType : IEquatable<DataObjectType>
- {
- public static readonly DataObjectType None = new DataObjectType("none");
-
- public static readonly DataObjectType AnyType = new DataObjectType("anyType");
- public static readonly DataObjectType AnySimpleType = new DataObjectType("anySimpleType");
-
- public static readonly DataObjectType UInt8 = new DataObjectType("unsignedByte");
- public static readonly DataObjectType UInt16 = new DataObjectType("unsignedShort");
- public static readonly DataObjectType UInt32 = new DataObjectType("unsignedInt");
- public static readonly DataObjectType UInt64 = new DataObjectType("unsignedLong");
-
- public static readonly DataObjectType Int8 = new DataObjectType("byte");
- public static readonly DataObjectType Int16 = new DataObjectType("short");
- public static readonly DataObjectType Int32 = new DataObjectType("int");
- public static readonly DataObjectType Int64 = new DataObjectType("long");
-
- public static readonly DataObjectType String = new DataObjectType("string");
- public static readonly DataObjectType LangString = new DataObjectType("langString");
-
- public static readonly DataObjectType Integer = new DataObjectType("integer");
- public static readonly DataObjectType NonPositiveInteger = new DataObjectType("nonPositiveInteger");
- public static readonly DataObjectType NonNegativeInteger = new DataObjectType("nonNegativeInteger");
- public static readonly DataObjectType NegativeInteger = new DataObjectType("negativeInteger");
- public static readonly DataObjectType PositiveInteger = new DataObjectType("positiveInteger");
-
- public static readonly DataObjectType Decimal = new DataObjectType("decimal");
- public static readonly DataObjectType Double = new DataObjectType("double");
- public static readonly DataObjectType Float = new DataObjectType("float");
- public static readonly DataObjectType Bool = new DataObjectType("boolean");
-
- public static readonly DataObjectType Duration = new DataObjectType("duration");
- public static readonly DataObjectType DayTimeDuration = new DataObjectType("dayTimeDuration");
- public static readonly DataObjectType YearMonthDuration = new DataObjectType("yearMonthDuration");
-
- public static readonly DataObjectType DateTime = new DataObjectType("dateTime");
- public static readonly DataObjectType DateTimeStamp = new DataObjectType("dateTimeStamp");
-
- public static readonly DataObjectType AnyURI = new DataObjectType("anyURI");
- public static readonly DataObjectType Base64Binary = new DataObjectType("base64binary");
- public static readonly DataObjectType HexBinary = new DataObjectType("hexBinary");
-
- private static Dictionary<string, DataObjectType> DataObjectTypes;
- static DataObjectType()
- {
- var fields = typeof(DataObjectType).GetFields(BindingFlags.Public | BindingFlags.Static);
- DataObjectTypes = fields.ToDictionary(k => ((DataObjectType)k.GetValue(null)).Name, v => ((DataObjectType)v.GetValue(null)));
- }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "name")]
- public string Name { get; }
-
-
- [JsonConstructor]
- protected DataObjectType(string name)
- {
- Name = name ?? throw new ArgumentNullException("name");
- }
-
- public static bool TryParse(string s, out DataObjectType dataObjectType)
- {
- if (DataObjectTypes.TryGetValue(s, out dataObjectType))
- return true;
- else
- return false;
- }
-
- public override string ToString()
- {
- return Name;
- }
-
- public bool Equals(DataObjectType other)
- {
- if (ReferenceEquals(null, other))
- {
- return false;
- }
- if (ReferenceEquals(this, other))
- {
- return true;
- }
-
- return this.Name.Equals(other.Name);
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
-
- return obj.GetType() == GetType() && Equals((DataObjectType)obj);
- }
-
-
- public override int GetHashCode()
- {
- unchecked
- {
- var result = 0;
- result = (result * 397) ^ Name.GetHashCode();
- return result;
- }
- }
-
- public static bool operator ==(DataObjectType x, DataObjectType y)
- {
-
- if (ReferenceEquals(x, y))
- {
- return true;
- }
-
- if (ReferenceEquals(x, null))
- {
- return false;
- }
- if (ReferenceEquals(y, null))
- {
- return false;
- }
-
- return x.Name == y.Name;
- }
- public static bool operator !=(DataObjectType x, DataObjectType y)
- {
- return !(x == y);
- }
- }
-
-
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/DataType.cs b/sdks/csnet/BaSys40.Models/Core/DataType.cs
deleted file mode 100644
index 7891339..0000000
--- a/sdks/csnet/BaSys40.Models/Core/DataType.cs
+++ /dev/null
@@ -1,293 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Semantics;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core
-{
-
- [DataContract]
- public class DataType : IHasSemantics, IEquatable<DataType>
- {
- [IgnoreDataMember]
- public bool? IsCollection { get; internal set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "dataObjectType")]
- public DataObjectType DataObjectType { get; internal set; }
-
- [IgnoreDataMember]
- public Type SystemType { get; internal set; }
-
- public IReference SemanticId { get; internal set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "schemaType")]
- public SchemaType? SchemaType { get; internal set; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "schema")]
- public string Schema { get; internal set; }
-
-
- //[DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueRank")]
- //public ValueRank? ValueRank { get; }
-
- internal DataType() { }
-
- public DataType(DataObjectType dataObjectType) : this(dataObjectType, false, null)
- { }
-
- [JsonConstructor]
- public DataType(DataObjectType dataObjectType, bool? isCollection, IReference semanticId = null)
- {
- DataObjectType = dataObjectType;
- SemanticId = semanticId;
-
- SystemType = GetSystemTypeFromDataType(dataObjectType);
-
-
- if (isCollection.HasValue)
- IsCollection = isCollection;
- else
- IsCollection = false;
-
- }
- public DataType(IReference semanticId, SchemaType schemaType, string schema)
- :this(DataObjectType.AnyType, false, semanticId)
- {
- SchemaType = schemaType;
- Schema = schema;
- }
-
-
- /*
- public enum ValueRank : int
- {
- Scalar = -1,
- OneDimensional = 1,
- TwoDimensional = 2,
- ScalarOrOneDimensional = 3
- }
- */
- public static DataType GetDataTypeFromSystemTypes(Type type)
- {
- DataType dataType = new DataType();
- Type innerType = null;
-
- if (IsGenericList(type))
- {
- dataType.IsCollection = true;
- innerType = type.GetGenericArguments()[0];
- }
- else if (IsArray(type))
- {
- dataType.IsCollection = true;
- innerType = type.GetElementType();
- }
- else
- {
- dataType.IsCollection = false;
- innerType = type;
- }
- dataType.SystemType = innerType;
-
- switch (innerType.FullName)
- {
- case "System.Decimal": dataType.DataObjectType = DataObjectType.Decimal; break;
- case "System.String": dataType.DataObjectType = DataObjectType.String; break;
- case "System.SByte": dataType.DataObjectType = DataObjectType.Int8; break;
- case "System.Int16": dataType.DataObjectType = DataObjectType.Int16; break;
- case "System.Int32": dataType.DataObjectType = DataObjectType.Int32; break;
- case "System.Int64": dataType.DataObjectType = DataObjectType.Int64; break;
- case "System.Byte": dataType.DataObjectType = DataObjectType.UInt8; break;
- case "System.UInt16": dataType.DataObjectType = DataObjectType.UInt16; break;
- case "System.UInt32": dataType.DataObjectType = DataObjectType.UInt32; break;
- case "System.UInt64": dataType.DataObjectType = DataObjectType.UInt64; break;
- case "System.Boolean": dataType.DataObjectType = DataObjectType.Bool; break;
- case "System.Single": dataType.DataObjectType = DataObjectType.Float; break;
- case "System.Double": dataType.DataObjectType = DataObjectType.Double; break;
- case "System.DateTime": dataType.DataObjectType = DataObjectType.DateTime; break;
- case "System.Uri": dataType.DataObjectType = DataObjectType.AnyURI; break;
- default:
- if (!IsSimpleType(innerType))
- {
- dataType.DataObjectType = DataObjectType.AnyType;
- return dataType;
- }
- else
- return null;
- }
- return dataType;
- }
-
- public static bool IsGenericList(Type type)
- {
- return (type.IsGenericType && (
- type.GetGenericTypeDefinition() == typeof(List<>) ||
- type.GetGenericTypeDefinition() == typeof(IEnumerable<>)));
- }
-
- public static bool IsArray(Type type)
- {
- return type.IsArray;
- }
-
- public static Type GetSystemTypeFromDataType(DataObjectType dataObjectType)
- {
- if (dataObjectType == DataObjectType.String)
- return typeof(string);
- if (dataObjectType == DataObjectType.LangString)
- return typeof(string);
- else if (dataObjectType == DataObjectType.Bool)
- return typeof(bool);
- else if (dataObjectType == DataObjectType.Float)
- return typeof(float);
- else if (dataObjectType == DataObjectType.Double)
- return typeof(double);
- else if (dataObjectType == DataObjectType.UInt8)
- return typeof(byte);
- else if (dataObjectType == DataObjectType.UInt16)
- return typeof(UInt16);
- else if (dataObjectType == DataObjectType.UInt32)
- return typeof(UInt32);
- else if (dataObjectType == DataObjectType.UInt64)
- return typeof(UInt64);
- else if (dataObjectType == DataObjectType.Int8)
- return typeof(sbyte);
- else if (dataObjectType == DataObjectType.Int16)
- return typeof(Int16);
- else if (dataObjectType == DataObjectType.Int32)
- return typeof(Int32);
- else if (dataObjectType == DataObjectType.Int64)
- return typeof(Int64);
- else if (dataObjectType == DataObjectType.Integer)
- return typeof(decimal);
- else if (dataObjectType == DataObjectType.NegativeInteger)
- return typeof(decimal);
- else if (dataObjectType == DataObjectType.PositiveInteger)
- return typeof(decimal);
- else if (dataObjectType == DataObjectType.NonNegativeInteger)
- return typeof(decimal);
- else if (dataObjectType == DataObjectType.NonPositiveInteger)
- return typeof(decimal);
- else if (dataObjectType == DataObjectType.AnyType)
- return typeof(object);
- else if (dataObjectType == DataObjectType.AnySimpleType)
- return typeof(string);
- else if (dataObjectType == DataObjectType.DateTime)
- return typeof(DateTime);
- else if (dataObjectType == DataObjectType.DateTimeStamp)
- return typeof(DateTime);
- else if (dataObjectType == DataObjectType.AnyURI)
- return typeof(Uri);
- else if (dataObjectType == DataObjectType.Base64Binary)
- return typeof(byte[]);
- else if (dataObjectType == DataObjectType.HexBinary)
- return typeof(byte[]);
- else if (dataObjectType == DataObjectType.Duration)
- return typeof(TimeSpan);
- else if (dataObjectType == DataObjectType.DayTimeDuration)
- return typeof(TimeSpan);
- else if (dataObjectType == DataObjectType.YearMonthDuration)
- return typeof(TimeSpan);
- else if (dataObjectType == ModelType.Property)
- return typeof(Property);
- else if (dataObjectType == ModelType.Blob)
- return typeof(Blob);
- else if (dataObjectType == ModelType.File)
- return typeof(File);
- else if (dataObjectType == ModelType.ReferenceElement)
- return typeof(ReferenceElement);
- else if (dataObjectType == ModelType.DataElementCollection)
- return typeof(DataElementCollection);
- else
- return null;
- }
-
- public static Type GetSystemTypeFromDataType(DataType dataType)
- {
- return GetSystemTypeFromDataType(dataType.DataObjectType);
- }
-
- public static bool IsSimpleType(Type type)
- {
- TypeInfo typeInfo = type.GetTypeInfo();
- if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>))
- return IsSimpleType(typeInfo.GetGenericArguments()[0]);
-
- return typeInfo.IsEnum || typeInfo.IsPrimitive || type.Equals(typeof(string)) || type.Equals(typeof(decimal));
- }
- #region IEquatable Interface Implementation
- public bool Equals(DataType other)
- {
- if (ReferenceEquals(null, other))
- {
- return false;
- }
- if (ReferenceEquals(this, other))
- {
- return true;
- }
-
- return this.DataObjectType.Equals(other.DataObjectType)
- && this.IsCollection.Equals(other.IsCollection);
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
-
- return obj.GetType() == GetType() && Equals((DataType)obj);
- }
-
-
- public override int GetHashCode()
- {
- unchecked
- {
- var result = 0;
- result = (result * 397) ^ DataObjectType.GetHashCode();
- result = (result * 397) ^ (IsCollection.Value ? 1 : 0);
- return result;
- }
- }
-
- public static bool operator ==(DataType x, DataType y)
- {
-
- if (ReferenceEquals(x, y))
- {
- return true;
- }
-
- if (ReferenceEquals(x, null))
- {
- return false;
- }
- if (ReferenceEquals(y, null))
- {
- return false;
- }
-
- return x.DataObjectType == y.DataObjectType && x.IsCollection == y.IsCollection;
- }
- public static bool operator !=(DataType x, DataType y)
- {
- return !(x == y);
- }
- #endregion
-
- }
-
-
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/GlobalKey.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/GlobalKey.cs
deleted file mode 100644
index d578502..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/GlobalKey.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using BaSys40.Models.Core.Identification;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- public class GlobalKey : Key
- {
- public GlobalKey(KeyElements type, KeyType idType, string value) : base(type, idType, value, false)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/IKey.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/IKey.cs
deleted file mode 100644
index f6e88a9..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/IKey.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- public interface IKey
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")]
- KeyElements? Type { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "idType")]
- KeyType? IdType { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
- string Value { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "local")]
- bool? Local { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "index")]
- int? Index { get; set; }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/IReference.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/IReference.cs
deleted file mode 100644
index 1d3ca24..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/IReference.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- public interface IReference
- {
- [IgnoreDataMember]
- IKey First { get; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "keys")]
- List<IKey> Keys { get;}
- }
-
- public interface IReference<out T> : IReference where T : IReferable
- { }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/Key.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/Key.cs
deleted file mode 100644
index 37bf7de..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/Key.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Core.Views;
-using Newtonsoft.Json;
-using System;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- [DataContract]
- public class Key : IKey, IEquatable<Key>
- {
- public KeyElements? Type { get; }
- public KeyType? IdType { get; }
- public string Value { get; }
- public bool? Local { get; }
- public int? Index { get; set; }
-
- protected Key() { }
-
- [JsonConstructor]
- public Key(KeyElements type, KeyType idType, string value, bool local)
- {
- Type = type;
- IdType = idType;
- Value = value;
- Local = local;
- }
-
- public static KeyElements GetReferableElement(Type type)
- {
- if (typeof(IAsset).IsAssignableFrom(type))
- return KeyElements.Asset;
- else if (typeof(IAssetAdministrationShell).IsAssignableFrom(type))
- return KeyElements.AssetAdministrationShell;
- else if (typeof(ISubmodel).IsAssignableFrom(type))
- return KeyElements.Submodel;
- else if (typeof(IView).IsAssignableFrom(type))
- return KeyElements.View;
- else if (typeof(IDataElement).IsAssignableFrom(type))
- return KeyElements.Property;
- else if (typeof(IOperation).IsAssignableFrom(type))
- return KeyElements.Operation;
- else if (typeof(IEvent).IsAssignableFrom(type))
- return KeyElements.Event;
- else if (typeof(IConceptDescription).IsAssignableFrom(type))
- return KeyElements.ConceptDescription;
- else
- throw new InvalidOperationException("Cannot convert type " + type.FullName + "to referable element");
- }
-
- #region IEquatable
- public bool Equals(Key other)
- {
- if (ReferenceEquals(null, other))
- {
- return false;
- }
- if (ReferenceEquals(this, other))
- {
- return true;
- }
-
- return this.IdType.Equals(other.IdType)
- && this.Index.Equals(other.Index)
- && this.Local.Equals(other.Local)
- && this.Type.Equals(other.Type)
- && this.Value.Equals(other.Type);
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
-
- return obj.GetType() == GetType() && Equals((Key)obj);
- }
-
-
- public override int GetHashCode()
- {
- unchecked
- {
- var result = 0;
- result = (result * 397) ^ IdType.GetHashCode();
- result = (result * 397) ^ Index.GetHashCode();
- result = (result * 397) ^ Type.GetHashCode();
- result = (result * 397) ^ (Local.Value ? 1 : 0);
- return result;
- }
- }
-
- public static bool operator ==(Key x, Key y)
- {
-
- if (ReferenceEquals(x, y))
- {
- return true;
- }
-
- if (ReferenceEquals(x, null))
- {
- return false;
- }
- if (ReferenceEquals(y, null))
- {
- return false;
- }
-
- return x.IdType == y.IdType
- && x.Index == y.Index
- && x.Local == y.Local
- && x.Type == y.Type
- && x.Value == y.Value;
- }
- public static bool operator !=(Key x, Key y)
- {
- return !(x == y);
- }
- #endregion
- }
-
- [DataContract]
- public class Key<T> : Key
- {
- public Key(KeyType idType, string value, bool local) : base(GetReferableElement(typeof(T)), idType, value, local)
- { }
- }
-
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/KeyElements.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/KeyElements.cs
deleted file mode 100644
index e309dc0..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/KeyElements.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- [DataContract]
- public enum KeyElements : int
- {
- GlobalReference,
-
- ConceptDictionary,
- AccessPermissionRule,
- DataElement,
- View,
- Property,
- SubmodelElement,
- File,
- Blob,
- ReferenceElement,
- SubmodelElementCollection,
- RelationshipElement,
- Event,
- Operation,
- OperationParameter,
-
- AssetAdministrationShell,
- Submodel,
- ConceptDescription,
- Asset
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/ModelKey.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/ModelKey.cs
deleted file mode 100644
index 4b8cc2d..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/ModelKey.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using BaSys40.Models.Core.Identification;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- public class ModelKey : Key
- {
- public ModelKey(KeyElements type, KeyType idType, string value) : base(type, idType, value, true)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/References/Reference.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/References/Reference.cs
deleted file mode 100644
index 3e36baf..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/References/Reference.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using BaSys40.Models.Core.Identification;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions.References
-{
- [DataContract]
- public class Reference : IReference
- {
-
- [IgnoreDataMember]
- public IKey First
- {
- get
- {
- if (Keys?.Count > 0)
- return Keys.First();
- return null;
- }
- }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "keys")]
- public List<IKey> Keys { get; protected set; }
-
- [JsonConstructor]
- public Reference(params IKey[] keys)
- {
- if (keys == null)
- throw new ArgumentNullException("keys");
-
-
- for (int i = 0; i < keys.Count(); i++)
- keys[i].Index = i;
-
- if (Keys?.Count > 0)
- {
- foreach (var key in keys)
- if (!Keys.Contains(key))
- Keys.Add(key);
- }
- else
- Keys = keys.ToList();
- }
- }
-
- [DataContract]
- public class Reference<T> : Reference, IReference<T> where T : IReferable
- {
- [JsonConstructor]
- private Reference(params IKey[] keys) : base(keys)
- { }
-
- public Reference(T element)
- {
- if (element == null)
- throw new ArgumentNullException("element");
-
- var keys = new List<IKey>();
-
- if (element is IIdentifiable identifiable)
- {
- keys.Add(new ModelKey(Key.GetReferableElement(identifiable.GetType()), identifiable.Identification.IdType.Value, identifiable.Identification.Id));
- }
- else if (element is IReferable referable)
- {
- if (referable.Parent != null && referable.Parent is IIdentifiable parentIdentifiable)
- keys.Add(new ModelKey(Key.GetReferableElement(parentIdentifiable.GetType()), parentIdentifiable.Identification.IdType.Value, parentIdentifiable.Identification.Id));
-
- keys.Add(new ModelKey(Key.GetReferableElement(referable.GetType()), KeyType.IdShort, referable.IdShort));
- }
-
- for (int i = 0; i < keys.Count(); i++)
- keys[i].Index = i;
-
- Keys = keys.ToList();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Extensions/Topology.cs b/sdks/csnet/BaSys40.Models/Core/Extensions/Topology.cs
deleted file mode 100644
index 8fcf619..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Extensions/Topology.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Extensions
-{
- [DataContract]
- public class Topology : Submodel
- {
- [IgnoreDataMember]
- public List<TopologyElement> TopologyElements { get; private set; }
- [IgnoreDataMember]
- public List<TopologyRelation> TopologyRelations { get; private set; }
-
- public Topology()
- { }
-
- public void InitializeSubmodel()
- {
- Identification = Identification ?? new Identifier(Guid.NewGuid().ToString(), KeyType.Custom);
- IdShort = IdShort ?? "Topology";
- Descriptions = Descriptions ?? new List<Description>() { new Description("EN", "Topology Submodel") };
- Kind = Kind ?? AssetAdministrationShell.Enums.Kind.Instance;
- SemanticId = SemanticId ?? new Reference(new ModelKey(KeyElements.Submodel, KeyType.URI, "urn:basys:org.eclipse.basyx:submodels:Topology:1.0.0"));
- DataElements = DataElements ?? new ElementContainer<IDataElement>()
- {
- new DataElementCollection(null)
- {
- IdShort = "TopologyElements",
- Parent = new Reference(new ModelKey(KeyElements.Submodel, Identification.IdType.Value, Identification.Id)),
- Descriptions = new List<Description>() { new Description("EN", "Elements of Topology") },
- }
- };
- }
-
- public void AddTopologyElements(List<TopologyElement> topologyElements)
- {
- if (topologyElements != null)
- foreach (var topologyElement in topologyElements)
- {
- (this.DataElements["TopologyElements"] as DataElementCollection).Value.Add(
- new ReferenceElement(null)
- {
- Value = topologyElement.Reference
- });
- }
- TopologyElements = topologyElements;
- }
-
- [DataContract]
- public class TopologyElement
- {
- [DataMember]
- public Reference Reference { get; set; }
- }
-
- [DataContract]
- public class TopologyRelation
- {
- [DataMember]
- public TopologyElement Source { get; set; }
- [DataMember]
- public TopologyElement Target { get; set; }
- }
-
- public class BaSysRelationship : TopologyRelation
- { }
- public class ConnectedTo : BaSysRelationship
- { }
- public class RelativePositionFrom : BaSysRelationship
- { }
- public class ConsistsOf : BaSysRelationship
- { }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/AdministrativeInformation.cs b/sdks/csnet/BaSys40.Models/Core/Identification/AdministrativeInformation.cs
deleted file mode 100644
index 4ae4163..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/AdministrativeInformation.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- [DataContract]
- public class AdministrativeInformation
- {
- [DataMember]
- public string Version { get; set; }
- [DataMember]
- public string Revision { get; set; }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/Description.cs b/sdks/csnet/BaSys40.Models/Core/Identification/Description.cs
deleted file mode 100644
index d3a481f..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/Description.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- [DataContract]
- public class Description
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "language")]
- public string Language { get; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "text")]
- public string Text { get; }
-
- public Description(string language, string text)
- {
- Language = language;
- Text = text;
- }
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/IIdentifiable.cs b/sdks/csnet/BaSys40.Models/Core/Identification/IIdentifiable.cs
deleted file mode 100644
index 6675a76..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/IIdentifiable.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- public interface IIdentifiable : IReferable
- {
- [JsonProperty(Order = -1), DataMember(Order = 1, EmitDefaultValue = false, IsRequired = false, Name = "identification")]
- Identifier Identification { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "administration")]
- AdministrativeInformation Administration { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/IModelElement.cs b/sdks/csnet/BaSys40.Models/Core/Identification/IModelElement.cs
deleted file mode 100644
index 76f08a9..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/IModelElement.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- public interface IModelElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "modelType")]
- ModelType ModelType { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/IReferable.cs b/sdks/csnet/BaSys40.Models/Core/Identification/IReferable.cs
deleted file mode 100644
index 5843616..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/IReferable.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- public interface IReferable
- {
- [JsonProperty(Order = -2), DataMember(Order = 0, EmitDefaultValue = false, IsRequired = false, Name = "idShort")]
- string IdShort { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "category")]
- string Category { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "descriptions")]
- List<Description> Descriptions { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "parent")]
- IReference Parent { get; }
- [IgnoreDataMember]
- Dictionary<string, string> MetaData { get; }
-
- //Reference GetReference(IdentifierType identifiertType); ToDo
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/ITypeable.cs b/sdks/csnet/BaSys40.Models/Core/Identification/ITypeable.cs
deleted file mode 100644
index f8bbe3d..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/ITypeable.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- public interface ITypeable
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "kind")]
- Kind? Kind { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/Identifier.cs b/sdks/csnet/BaSys40.Models/Core/Identification/Identifier.cs
deleted file mode 100644
index 0254b3c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/Identifier.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- [DataContract]
- public class Identifier
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "id")]
- public string Id { get; }
-
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "idType")]
- public KeyType? IdType { get; }
-
- public Identifier(string id, KeyType idType)
- {
- Id = id;
- IdType = idType;
- }
-
-
- public class UniformResourceIdentifier : Identifier
- {
- public string Organisation { get; internal set; }
- public string SubUnit { get; internal set; }
- public string DomainId { get; internal set; }
- public string Version { get; internal set; }
- public string Revision { get; internal set; }
- public string ElementId { get; internal set; }
- public string InstanceNumber { get; internal set; }
-
- public UniformResourceIdentifier(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
- : base(ToUrn(organisation, subUnit, domainId, version, revision, elementId, instanceNumber), KeyType.URI)
- {
- Organisation = organisation;
- SubUnit = subUnit;
- DomainId = domainId;
- Version = version;
- Revision = revision;
- ElementId = elementId;
- InstanceNumber = instanceNumber;
- }
-
- public string ToUri() => ToUri(Organisation, SubUnit, DomainId, Version, Revision, ElementId, InstanceNumber);
- public string ToUrn() => ToUrn(Organisation, SubUnit, DomainId, Version, Revision, ElementId, InstanceNumber);
-
- public static string ToUri(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
- {
- string uri = "http://";
-
- uri += organisation + "/";
-
- if (!string.IsNullOrEmpty(subUnit))
- uri += subUnit + "/";
- if (!string.IsNullOrEmpty(domainId))
- uri += domainId + "/";
- if (!string.IsNullOrEmpty(version))
- uri += version + "/";
- if (!string.IsNullOrEmpty(revision))
- uri += revision + "/";
- if (!string.IsNullOrEmpty(elementId))
- uri += elementId + "/";
-
- if (!string.IsNullOrEmpty(instanceNumber))
- {
- uri = uri.Substring(0, uri.Length - 2);
- uri += "#" + instanceNumber;
- }
- return uri;
- }
- public static string ToUrn(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
- {
- string urn = "urn:";
-
- urn += organisation + ":";
-
- if (!string.IsNullOrEmpty(subUnit))
- urn += subUnit + ":";
- if (!string.IsNullOrEmpty(domainId))
- urn += domainId + ":";
- if (!string.IsNullOrEmpty(version))
- urn += version + ":";
- if (!string.IsNullOrEmpty(revision))
- urn += revision + ":";
- if (!string.IsNullOrEmpty(elementId))
- urn += elementId + ":";
-
- if (!string.IsNullOrEmpty(instanceNumber))
- {
- urn = urn.Substring(0, urn.Length - 2);
- urn += "#" + instanceNumber;
- }
- return urn;
- }
- }
-
- }
-
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Identification/KeyType.cs b/sdks/csnet/BaSys40.Models/Core/Identification/KeyType.cs
deleted file mode 100644
index 79f469f..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Identification/KeyType.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Identification
-{
- [DataContract]
- public enum KeyType : int
- {
- Custom = 0,
- URI = 1,
- IRDI = 2,
- IdShort = 3
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/ModelType.cs b/sdks/csnet/BaSys40.Models/Core/ModelType.cs
deleted file mode 100644
index 5211d80..0000000
--- a/sdks/csnet/BaSys40.Models/Core/ModelType.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Newtonsoft.Json;
-
-namespace BaSys40.Models.Core
-{
- public class ModelType : DataObjectType
- {
- public static readonly ModelType Asset = new ModelType("Asset");
- public static readonly ModelType AssetAdministationShell = new ModelType("AssetAdministationShell");
- public static readonly ModelType Submodel = new ModelType("Submodel");
- public static readonly ModelType SubmodelElement = new ModelType("SubmodelElement");
- public static readonly ModelType SubmodelElementCollection = new ModelType("SubmodelElementCollection");
- public static readonly ModelType Operation = new ModelType("Operation");
- public static readonly ModelType OperationVariable = new ModelType("OperationVariable");
- public static readonly ModelType Event = new ModelType("Event");
- public static readonly ModelType View = new ModelType("View");
- public static readonly ModelType RelationshipElement = new ModelType("RelationshipElement");
- public static readonly ModelType DataElement = new ModelType("DataElement");
- public static readonly ModelType Property = new ModelType("Property");
- public static readonly ModelType File = new ModelType("File");
- public static readonly ModelType Blob = new ModelType("Blob");
- public static readonly ModelType ReferenceElement = new ModelType("ReferenceElement");
- public static readonly ModelType DataElementCollection = new ModelType("DataElementCollection");
-
-
- public static readonly ModelType Constraint = new ModelType("Constraint");
- public static readonly ModelType Formula = new ModelType("Formula");
- public static readonly ModelType Qualifier = new ModelType("Qualifier");
-
- public static readonly ModelType ConceptDescription = new ModelType("ConceptDescription");
-
- [JsonConstructor]
- protected ModelType(string name) : base(name)
- { }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Views/IView.cs b/sdks/csnet/BaSys40.Models/Core/Views/IView.cs
deleted file mode 100644
index 2197f9c..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Views/IView.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Semantics;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Core.Views
-{
- public interface IView : IHasSemantics, IReferable, IModelElement
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "containedElements")]
- List<IReference> ContainedElements { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Core/Views/View.cs b/sdks/csnet/BaSys40.Models/Core/Views/View.cs
deleted file mode 100644
index cc422be..0000000
--- a/sdks/csnet/BaSys40.Models/Core/Views/View.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-
-namespace BaSys40.Models.Core.Views
-{
- [DataContract]
- public class View : IView
- {
- public List<IReference> ContainedElements { get; set; }
-
- public IReference SemanticId { get; set; }
-
- public string IdShort { get; set; }
-
- public string Category { get; set; }
-
- public List<Description> Descriptions { get; set; }
-
- public IReference Parent { get; set; }
- public Dictionary<string, string> MetaData { get; set; }
-
- public ModelType ModelType => ModelType.View;
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironment.cs b/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironment.cs
deleted file mode 100644
index f635415..0000000
--- a/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironment.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Export
-{
- [DataContract]
- public class AssetAdministrationShellEnvironment
- {
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assetAdministrationShells", Order = 0)]
- public List<IAssetAdministrationShell> AssetAdministrationShells { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "submodels", Order = 1)]
- public List<ISubmodel> Submodels { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assets", Order = 2)]
- public List<IAsset> Assets { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "conceptDescriptions", Order = 3)]
- public List<IConceptDescription> ConceptDescriptions { get; }
-
- [JsonConstructor]
- protected AssetAdministrationShellEnvironment()
- {
- AssetAdministrationShells = new List<IAssetAdministrationShell>();
- Submodels = new List<ISubmodel>();
- Assets = new List<IAsset>();
- ConceptDescriptions = new List<IConceptDescription>();
-
- }
-
- public AssetAdministrationShellEnvironment(params IAssetAdministrationShell[] assetAdministrationShells)
- {
- AssetAdministrationShells = new List<IAssetAdministrationShell>();
- Submodels = new List<ISubmodel>();
- Assets = new List<IAsset>();
- ConceptDescriptions = new List<IConceptDescription>();
-
- foreach (var aas in assetAdministrationShells)
- {
- AssetAdministrationShells.Add(aas);
- Assets.Add(aas.Asset);
- if (aas.Submodels?.Count > 0)
- {
- Submodels.AddRange(aas.Submodels);
- foreach (var submodel in aas.Submodels)
- if (submodel.SubmodelElements?.Count > 0)
- foreach (var submodelElement in submodel.SubmodelElements)
- if (submodelElement.ConceptDescription != null)
- {
- ConceptDescriptions.Add(submodelElement.ConceptDescription);
- (submodelElement as SubmodelElement).ConceptDescription = null;
- (submodelElement as SubmodelElement).EmbeddedDataSpecifications = null;
- }
- }
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironmentConverter.cs b/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironmentConverter.cs
deleted file mode 100644
index 0074a22..0000000
--- a/sdks/csnet/BaSys40.Models/Export/AssetAdministrationShellEnvironmentConverter.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using BaSys40.Models.Core;
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.Attributes;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Identification;
-using BaSys40.Models.Export;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace BaSys40.Models.Export
-{
- public class AssetAdministrationShellEnvironmentConverter : JsonConverter
- {
- //public override bool CanWrite => true;
- //public override bool CanRead => false;
-
- public override bool CanConvert(Type objectType)
- {
- if (typeof(IAssetAdministrationShell).IsAssignableFrom(objectType))
- return true;
- else
- return false;
- }
-
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- throw new NotImplementedException();
- }
-
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
- {
- JObject jObj = new JObject();
- Type type = value.GetType();
-
- foreach (PropertyInfo prop in type.GetProperties())
- {
- object propVal = prop.GetValue(value);
- if (propVal != null)
- {
- var attrib = prop.GetCustomAttribute(typeof(ExportAsReferenceAttribute), true);
- var propName = prop.Name.Substring(0, 1).ToLower() + prop.Name.Substring(1, prop.Name.Length - 1);
- if (attrib != null)
- {
- var exportAttrib = (ExportAsReferenceAttribute)attrib;
- if (propVal != null)
- {
- if (typeof(IIdentifiable).IsAssignableFrom(propVal.GetType()))
- {
- IIdentifiable identifiable = propVal as IIdentifiable;
- if (identifiable.Identification?.Id != null)
- {
- IReference reference = new Reference(new ModelKey(exportAttrib.KeyElement, identifiable.Identification.IdType.Value, identifiable.Identification.Id));
- jObj.Add(propName, JToken.FromObject(reference, serializer));
- }
- continue;
- }
- if(propVal is IEnumerable)
- {
- JArray jArray = new JArray();
- IEnumerable<IIdentifiable> identifiables = (IEnumerable<IIdentifiable>)propVal;
- foreach (var identifiable in identifiables)
- {
- if (identifiable.Identification?.Id != null)
- {
- IReference reference = new Reference(new ModelKey(exportAttrib.KeyElement, identifiable.Identification.IdType.Value, identifiable.Identification.Id));
- jArray.Add(JToken.FromObject(reference, serializer));
- }
- }
- jObj.Add(propName, jArray);
- continue;
- }
- }
- }
- jObj.Add(propName, JToken.FromObject(propVal, serializer));
- }
- }
- jObj.WriteTo(writer);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Extensions/Exceptions/Exception.cs b/sdks/csnet/BaSys40.Models/Extensions/Exceptions/Exception.cs
deleted file mode 100644
index 2296976..0000000
--- a/sdks/csnet/BaSys40.Models/Extensions/Exceptions/Exception.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace BaSys40.Models.Extensions.Exceptions
-{
- /// <summary>
- /// BaSys Base-Exception Class
- /// </summary>
- public class Exception
- {
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Extensions/JsonStandardSettings.cs b/sdks/csnet/BaSys40.Models/Extensions/JsonStandardSettings.cs
deleted file mode 100644
index 1268101..0000000
--- a/sdks/csnet/BaSys40.Models/Extensions/JsonStandardSettings.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using BaSys40.Utils.DIExtensions;
-using BaSys40.Utils.JsonHandling;
-using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using System;
-
-namespace BaSys40.Models.Extensions
-{
- public class JsonStandardSettings : JsonSerializerSettings
- {
- public IServiceProvider ServicePovider { get; }
- public IServiceCollection Services { get; }
- public JsonStandardSettings() : base()
- {
- Services = new ServiceCollection();
- Services.ConfigureStandardImplementation();
-
- var serviceProviderFactory = new DefaultServiceProviderFactory();
- ServicePovider = serviceProviderFactory.CreateServiceProvider(Services);
-
- NullValueHandling = NullValueHandling.Include;
-
-
- Formatting = Formatting.Indented;
- Converters.Add(new StringEnumConverter());
- ContractResolver = new DIContractResolver(new DIExtension(Services), ServicePovider);
- }
-
- public JsonStandardSettings(IServiceCollection services) : base()
- {
- Services = services;
-
- var serviceProviderFactory = new DefaultServiceProviderFactory();
- ServicePovider = serviceProviderFactory.CreateServiceProvider(Services);
-
- NullValueHandling = NullValueHandling.Include;
-
- Formatting = Formatting.Indented;
- Converters.Add(new StringEnumConverter());
- ContractResolver = new DIContractResolver(new DIExtension(Services), ServicePovider);
- }
-
- public static IServiceCollection GetStandardServiceCollection()
- {
- IServiceCollection services = new ServiceCollection();
- services.ConfigureStandardImplementation();
- return services;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Extensions/StandardDIExtensions.cs b/sdks/csnet/BaSys40.Models/Extensions/StandardDIExtensions.cs
deleted file mode 100644
index 9e6bad9..0000000
--- a/sdks/csnet/BaSys40.Models/Extensions/StandardDIExtensions.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Models.Core.Constraints;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace BaSys40.Models.Extensions
-{
- public static class StandardDIExtensions
- {
- public static IServiceCollection ConfigureStandardImplementation(this IServiceCollection services)
- {
- services.AddTransient<IAsset, Asset>();
- services.AddTransient<IAssetAdministrationShell, AssetAdministrationShell>();
- services.AddTransient<ISubmodel, Submodel>();
-
- services.AddTransient<IDataElement, DataElement>();
- services.AddTransient(typeof(IDataElement<>), typeof(DataElement<>));
- services.AddTransient<IOperation, Operation>();
- services.AddTransient<IEvent, Event>();
-
- services.AddTransient<IOperationVariable, OperationVariable>();
- services.AddTransient<IArgument, Argument>();
- services.AddTransient<IValue, DataElementValue>();
- services.AddTransient<IKey, Key>();
-
- services.AddTransient<IReference, Reference>();
-
- return services;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Semantics/IHasDataSpecification.cs b/sdks/csnet/BaSys40.Models/Semantics/IHasDataSpecification.cs
deleted file mode 100644
index 9ad85c5..0000000
--- a/sdks/csnet/BaSys40.Models/Semantics/IHasDataSpecification.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Semantics
-{
- public interface IHasDataSpecification
- {
- [IgnoreDataMember]
- IConceptDescription ConceptDescription { get; }
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "embeddedDataSpecifications")]
- List<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.Models/Semantics/IHasSemantics.cs b/sdks/csnet/BaSys40.Models/Semantics/IHasSemantics.cs
deleted file mode 100644
index 8e50a09..0000000
--- a/sdks/csnet/BaSys40.Models/Semantics/IHasSemantics.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using BaSys40.Models.Core.Extensions.References;
-using System.Runtime.Serialization;
-
-namespace BaSys40.Models.Semantics
-{
- public interface IHasSemantics
- {
- [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "semanticId")]
- IReference SemanticId { get; }
- }
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/BaSys40.RI.AAS.SmartControl.csproj b/sdks/csnet/BaSys40.RI.AAS.SmartControl/BaSys40.RI.AAS.SmartControl.csproj
deleted file mode 100644
index 2af44af..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/BaSys40.RI.AAS.SmartControl.csproj
+++ /dev/null
@@ -1,30 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>netstandard2.0</TargetFramework>
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- </PropertyGroup>
-
- <ItemGroup>
- <None Remove="SmartControlSettings.xml" />
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Include="SmartControlSettings.xml">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </EmbeddedResource>
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="NLog.Web.AspNetCore" Version="4.8.0" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.API\BaSys40.API.csproj" />
- <ProjectReference Include="..\BaSys40.Models\BaSys40.Models.csproj" />
- <ProjectReference Include="..\BaSys40.Technologies.oneM2M\BaSys40.Technologies.oneM2M.csproj" />
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControl.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControl.cs
deleted file mode 100644
index 0cef31b..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControl.cs
+++ /dev/null
@@ -1,1289 +0,0 @@
-using oneM2MClient;
-using oneM2MClient.Client;
-using oneM2MClient.Resources;
-using oneM2MClient.Protocols;
-
-
-using System;
-using System.Linq;
-using System.IO;
-using System.Reflection;
-using System.Collections.Generic;
-
-using BaSys40.API.Platform;
-using BaSys40.Models.Core;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Utils.ResultHandling;
-using BaSys40.Utils.ModelHandling;
-
-using Newtonsoft.Json;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Models.Core.AssetAdministrationShell.Enums;
-using BaSys40.Models.Core.Identification;
-using System.Net;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations.DataElementSubtypes;
-using BaSys40.Models.Core.AssetAdministrationShell;
-using oneM2MClient.Utils;
-using BaSys40.Models.Core.Extensions.References;
-using BaSys40.Utils.Settings;
-using System.Web;
-
-namespace BaSys40.RI.AAS.SmartControl
-{
- public partial class SmartControl : IAssetAdministrationShellManager
- {
-
- public static SmartControlSettings Settings { get; private set; }
-
- public static readonly IClient oneM2MClient;
- public static readonly string SettingsPath;
-
- static SmartControl()
- {
- SettingsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), SmartControlSettings.FileName);
-
- Assembly sourceAssembly = Assembly.GetExecutingAssembly();
- string nameSpace = typeof(SmartControl).Namespace.Split('.')[0];
-
- if (!ResourceChecker.CheckResource(sourceAssembly, nameSpace, "SmartControlSettings.xml", true))
- throw new FileNotFoundException("SmartControlSettings.xml is missing or has a wrong configuration!");
-
- Settings = SmartControlSettings.LoadSettings(SettingsPath);
- oneM2MClient = ClientFactory.CreateClient(Settings.oneM2MConfig.ProtocolBinding);
- }
-
- private void SmartControlSettingsChanged(string fullPath)
- {
- Settings = SmartControlSettings.LoadSettings(fullPath);
- }
-
- private static SmartControl smartControl;
- public static SmartControl Instance
- {
- get
- {
- if (smartControl == null)
- smartControl = new SmartControl();
- return smartControl;
- }
- }
- private SmartControl()
- {
- Settings.ConfigureSettingsWatcher(SettingsPath, SmartControlSettingsChanged);
- }
-
-
- #region Implementation of IAssetAdministrationShellManager
-
- public IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas)
- {
- var result = AddAAS(aas);
- if (result.Success)
- {
- return ConvertResult<IAssetAdministrationShell>(aas, result);
- }
- else
- return ConvertResult<IAssetAdministrationShell>(result);
- }
-
- public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas)
- {
- var result = UpdateAAS(aasId, aas);
- return ConvertResult(result);
- }
-
- public IResult DeleteAssetAdministrationShell(string aasId)
- {
- var result = RemoveComponent(new string[] { aasId } );
- return ConvertResult(result);
- }
-
- public IResult DeleteSubmodel(string aasId, string submodelId)
- {
- var components = new string[] { aasId, submodelId };
- var result = RemoveComponent(components);
-
- return ConvertResult(result);
- }
- public IResult InvokeOperation(string aasId, string submodelId, string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout)
- {
- var result = CallOperation(aasId, submodelId, operationId, inputArguments, outputArguments, timeout);
- return ConvertResult(result);
- }
-
-
- public IResult<ISubmodel> CreateSubmodel(string aasId, ISubmodel submodel)
- {
- var result = AddSubmodel(aasId, submodel);
- if(submodel.DataElements != null && submodel.DataElements.Count > 0)
- {
- foreach (var property in submodel.DataElements)
- {
- CreateDataElement(aasId, submodel.IdShort, property);
- }
- }
- if (submodel.Operations != null && submodel.Operations.Count > 0)
- {
- foreach (var operation in submodel.Operations)
- {
- CreateOperation(aasId, submodel.IdShort, operation);
- }
- }
- if (submodel.Events != null && submodel.Events.Count > 0)
- {
- foreach (var eventable in submodel.Events)
- {
- CreateEvent(aasId, submodel.IdShort, eventable);
- }
- }
- if (result.Success)
- {
- return ConvertResult<ISubmodel>(submodel, result);
- }
- else
- return ConvertResult<ISubmodel>(result);
- }
-
- public IResult<IDataElement> CreateDataElement(string aasId, string submodelId, IDataElement property)
- {
- var result = AddProperty(aasId, submodelId, property);
- if(result.Success)
- {
- return ConvertResult<IDataElement>(property, result);
- }
- return ConvertResult<IDataElement>(result);
- }
-
- public IResult<IOperation> CreateOperation(string aasId, string submodelId, IOperation operation)
- {
- var result = AddOperation(aasId, submodelId, operation);
- if (result.Success)
- {
- return ConvertResult<IOperation>(operation, result);
- }
- return ConvertResult<IOperation>(result);
- }
-
- public IResult<IEvent> CreateEvent(string aasId, string submodelId, IEvent eventable)
- {
- var result = AddEvent(aasId, submodelId, eventable);
- if (result.Success)
- {
- return ConvertResult<IEvent>(eventable, result);
- }
- return ConvertResult<IEvent>(eventable, result);
- }
-
- public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId)
- {
- var result = ReadAAS(aasId, out IAssetAdministrationShell aas);
- if (result.Success && aas != null)
- {
- return ConvertResult<IAssetAdministrationShell>(aas, result);
- }
- return ConvertResult<IAssetAdministrationShell>(result);
- }
-
- public IResult<List<IAssetAdministrationShell>> RetrieveAssetAdministrationShells()
- {
- var result = ReadAllAAS(out List<IAssetAdministrationShell> aasList);
- if (result.Success && aasList?.Count > 0)
- {
- return ConvertResult<List<IAssetAdministrationShell>>(aasList, result);
- }
- return ConvertResult<List<IAssetAdministrationShell>>(result);
- }
-
- public IResult<ElementContainer<ISubmodel>> RetrieveSubmodels(string aasId)
- {
- var result = ReadSubmodels(aasId, out ElementContainer<ISubmodel> submodels);
- if (result.Success && submodels != null)
- {
- return ConvertResult(submodels, result);
- }
- return ConvertResult<ElementContainer<ISubmodel>>(result);
-
- }
-
- public IResult<ISubmodel> RetrieveSubmodel(string aasId, string submodelId)
- {
- var result = ReadSubmodel(aasId, submodelId, out Submodel submodel);
- if (result.Success && submodel != null)
- {
- return ConvertResult<ISubmodel>(submodel, result);
- }
- return ConvertResult<ISubmodel>(result);
- }
-
- public IResult<IDataElement> RetrieveDataElement(string aasId, string submodelId, string propertyId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- var result = ReadProperty(aasId, submodelId, propertyId, out Property prop);
- if (result.Success && prop != null)
- {
- return ConvertResult<IDataElement>(prop, result);
- }
- else
- return ConvertResult<IDataElement>(result);
- }
- return null;
- }
-
- public IResult UpdateDataElementValue(string aasId, string submodelId, string propertyId, IValue value)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- var result = UpdatePropertyValue(aasId, submodelId, propertyId, value);
- return ConvertResult(result);
- }
- return null;
- }
-
- public IResult<IValue> RetrieveDataElementValue(string aasId, string submodelId, string propertyId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- var valueResult = ReadPropertyValue(aasId, submodelId, propertyId, out IValue value);
- if (valueResult.Success && value != null)
- return ConvertResult<IValue>(value, valueResult);
- else
- return ConvertResult<IValue>(valueResult);
- }
- return null;
- }
-
-
- public IResult DeleteDataElement(string aasId, string submodelId, string propertyId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- var result = RemoveProperty(aasId, submodelId, propertyId);
- return ConvertResult(result);
- }
- return null;
- }
-
- public IResult<IOperation> RetrieveOperation(string aasId, string submodelId, string operationId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(operationId))
- {
- var result = ReadOperation(aasId, submodelId, operationId, out Operation op);
- if (result.Success && op != null)
- {
- return ConvertResult<IOperation>(op, result);
- }
- else
- return ConvertResult<IOperation>(result);
- }
- return null;
- }
-
-
-
- public IResult DeleteOperation(string aasId, string submodelId, string operationId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(operationId))
- {
- var result = RemoveOperation(aasId, submodelId, operationId);
- return ConvertResult(result);
- }
- return null;
- }
-
-
-
- public IResult<IEvent> RetrieveEvent(string aasId, string submodelId, string eventId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(eventId))
- {
- var result = ReadEvent(aasId, submodelId, eventId, out Event ev);
- if (result.Success && ev != null)
- {
- return ConvertResult<IEvent>(ev, result);
- }
- else
- return ConvertResult<IEvent>(result);
- }
- return null;
- }
-
- public IResult DeleteEvent(string aasId, string submodelId, string eventId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(eventId))
- {
- var result = RemoveEvent(aasId, submodelId, eventId);
- return ConvertResult(result);
- }
- return null;
- }
-
- public IResult<ElementContainer<IDataElement>> RetrieveDataElements(string aasId, string submodelId)
- {
- var result = ReadSubmodel(aasId, submodelId, out Submodel submodel);
- if (result.Success && submodel?.DataElements != null)
- {
- return ConvertResult(submodel.DataElements, result);
- }
- return ConvertResult<ElementContainer<IDataElement>>(result);
- }
-
- public IResult<ElementContainer<IOperation>> RetrieveOperations(string aasId, string submodelId)
- {
- var result = ReadSubmodel(aasId, submodelId, out Submodel submodel);
- if (result.Success && submodel?.Operations != null)
- {
- return ConvertResult(submodel.Operations, result);
- }
- return ConvertResult<ElementContainer<IOperation>>(result);
- }
-
- public IResult<ElementContainer<IEvent>> RetrieveEvents(string aasId, string submodelId)
- {
- var result = ReadSubmodel(aasId, submodelId, out Submodel submodel);
- if (result.Success && submodel?.Events != null)
- {
- return ConvertResult(submodel.Events, result);
- }
- return ConvertResult<ElementContainer<IEvent>>(result);
- }
-
- #endregion
-
- #region SmartControl oneM2M-Functions
-
- public static Result<Response> CallOperation(string aasId, string submodelId, string operationId, List<IArgument> inputArguments, List<IArgument> outputArguments, int timeout = DEFAULT_TIMEOUT)
- {
- if (timeout == 0)
- timeout = DEFAULT_TIMEOUT;
-
- ReadOperation(aasId, submodelId, operationId, out Operation operation);
-
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, operationId, ContainerStrings.REQUEST);
- string argumentString = SmartControlUtils.ConvertStringArguments(inputArguments);
- string resourceName = "cin_"+req.GetHashCode();
- var result = ContentInstance.Create(oneM2MClient, req, resourceName, argumentString);
-
- req.SetPath(aasId, submodelId, operationId, ContainerStrings.RESPONSE);
- List<IArgument> outArgs = new List<IArgument>();
- bool success = Utils.ResultHandling.Utils.RetryUntilSuccessOrTimeout(
- () => GetResponseFromCall(req, resourceName, outArgs, operation.Out), TimeSpan.FromMilliseconds(timeout), TimeSpan.FromMilliseconds(100));
- outputArguments?.AddRange(outArgs);
-
- return result;
- }
-
- private static bool GetResponseFromCall(Request request, string resourceName, List<IArgument> outputArguments, List<IOperationVariable> referenceArguments)
- {
- var resp = Helper.ReadLatestAddedResource(oneM2MClient, request, out resource resource);
- if (resource != null && resource is cin cinResource)
- {
- if (cinResource.Rn == resourceName)
- {
- List<IArgument> outArgs = SmartControlUtils.ConvertStringArguments(cinResource.Con, referenceArguments);
- if(outArgs != null)
- outputArguments.AddRange(outArgs);
- return true;
- }
- }
- return false;
- }
-
- public static Result<Response> UpdatePropertyValue(string aasId, string submodelId, string propertyId, IValue value)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, propertyId, ContainerStrings.DATA);
-
- string content = SmartControlUtils.ConvertPropertyValue(value);
- ContentInstance data_cin = new ContentInstance(Guid.NewGuid().ToString(), content);
- var result = data_cin.Create(oneM2MClient, req);
- return result;
- }
-
- public static Result<Response> UpdateAAS(string aasId, IAssetAdministrationShell aas)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId);
- List<string> labels = null;
- if (aas.MetaData?.Count > 0)
- labels = aas.MetaData.Select(kvp => kvp.Key + SEPERATOR + kvp.Value)?.ToList();
- var result = ApplicationEntity.Update(oneM2MClient, req, aasId, null, labels);
- return result;
- }
-
-
- #region Converters
-
- public static Submodel ReadSubmodelFrom(string assetId, ObjectTreeBuilder submodelTree)
- {
- var rootCnt = submodelTree?.GetValue<cnt>();
- if (rootCnt != null)
- {
- Submodel submodel = new Submodel()
- {
- IdShort = rootCnt.Rn,
- SemanticId = new Reference(new GlobalKey(KeyElements.Submodel, KeyType.URI, GetLabelValue(TYPE_IDENTIFIER, rootCnt.Lbl))),
- Identification = new Identifier(GetLabelValue(Labels.ID, rootCnt.Lbl), KeyType.Custom),
- Descriptions = GetDescriptionsFromLabels(rootCnt.Lbl)
- };
-
- var typeInstance = GetLabelValue(BASYS_TYPE_IDENTIFIER, rootCnt.Lbl);
- if (typeInstance == ElementType.SUBMODEL_TYPE)
- submodel.Kind = Kind.Type;
- else if (typeInstance == ElementInstance.SUBMODEL)
- submodel.Kind = Kind.Instance;
-
- if (submodelTree.HasChildren())
- {
- submodel.Operations = new ElementContainer<IOperation>();
- submodel.DataElements = new ElementContainer<IDataElement>();
- submodel.Events = new ElementContainer<IEvent>();
-
- foreach (var subElement in submodelTree.Children)
- {
- var subElementCnt = subElement.GetValue<cnt>();
- if (subElementCnt != null)
- {
- if (subElementCnt.Lbl.FirstOrDefault(l => l.Contains(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.OPERATION)) != null)
- {
- var op = ReadOperationFrom(subElement);
- if (op != null)
- submodel.Operations.Add(op);
- }
- else if (subElementCnt.Lbl.FirstOrDefault(l => l.Contains(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.PROPERTY)) != null)
- {
- var prop = ReadPropertyFrom(subElement);
- if (prop != null)
- submodel.DataElements.Add(prop);
- }
- else if (subElementCnt.Lbl.FirstOrDefault(l => l.Contains(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.EVENT)) != null)
- {
- var prop = ReadEventFrom(subElement);
- if (prop != null)
- submodel.Events.Add(prop);
- }
- }
- }
- }
- return submodel;
- }
- return null;
- }
-
- public static Operation ReadOperationFrom(ObjectTreeBuilder operationTree)
- {
- var operationCnt = operationTree?.GetValue<cnt>();
- Operation operation = ConvertCntToOperation(operationCnt);
- if (operation != null)
- {
- //string listenerUriSubscriptionPath = string.Join(PATH_SEPERATOR, ContainerStrings.REQUEST, DEFAULT_SUBSCRIPTION_NAME);
- //if (operationTree.HasChildPath(listenerUriSubscriptionPath))
- //{
- // var sub = operationTree.GetChild(listenerUriSubscriptionPath).GetValue<sub>();
- // var uri = sub?.Nu?.FirstOrDefault();
- // operation.OperationInformation.Endpoint = uri ?? uri;
- //}
- return operation;
- }
- return null;
- }
-
- public static Event ReadEventFrom(ObjectTreeBuilder eventTree)
- {
- var eventCnt = eventTree?.GetValue<cnt>();
- if (eventCnt != null)
- {
- cin schemaCin = null;
- string schemaPath = string.Join(PATH_SEPERATOR, ContainerStrings.SCHEMA, EventIdentifier.SCHEMA_CIN);
- if (eventTree.HasChildPath(schemaPath))
- schemaCin = eventTree.GetChild(schemaPath).GetValue<cin>();
- Event eventable = ConvertCntToEvent(eventCnt, schemaCin);
- return eventable;
- }
- return null;
- }
-
- public static Property ReadPropertyFrom(ObjectTreeBuilder propertyTree)
- {
- var propertyCnt = propertyTree?.GetValue<cnt>();
- Property property = ConvertCntToProperty(propertyCnt);
- if (property != null)
- {
- //string listenerUriSubscriptionPath = string.Join(PATH_SEPERATOR, ContainerStrings.GET, ContainerStrings.REQUEST, DEFAULT_SUBSCRIPTION_NAME);
- //string listenerUriSubscriptionPath = string.Join(PATH_SEPERATOR, ContainerStrings.DATA, DEFAULT_SUBSCRIPTION_NAME);
- //if (propertyTree.HasChildPath(listenerUriSubscriptionPath))
- //{
- // var sub = propertyTree.GetChild(listenerUriSubscriptionPath).GetValue<sub>();
- // var uri = sub?.Nu?.FirstOrDefault();
- // (property.ElementInformation as ElementInformation).Endpoint = uri ?? uri;
- //}
-
- //string valuePath = string.Join(PATH_SEPERATOR, ContainerStrings.DATA);
- //if (propertyTree.HasChildPath(valuePath) && propertyTree.GetChild(valuePath).HasChildren())
- //{
- // var latestValue = Helper.GetLatestResource(propertyTree.GetChild(valuePath));
- // if(latestValue?.Con != null)
- // property.Value = new ElementValue<string>(latestValue.Con);
- //}
-
- return property;
- }
- return null;
- }
-
- public static IResult ConvertResult(Result<Response> requestResponse)
- {
- IResult result = new Result(requestResponse.Success);
-
- if (!requestResponse.Success)
- {
- foreach (var msg in requestResponse.Messages)
- {
- result.Messages.Add(new Message((MessageType)(int)msg.MessageType, msg.Text, msg.Code));
- }
- }
- return result;
- }
-
- public static IResult<T> ConvertResult<T>(Result<Response> requestResponse)
- {
- IResult<T> result = new Result<T>(requestResponse.Success);
-
- if (!requestResponse.Success)
- {
- foreach (var msg in requestResponse.Messages)
- {
- result.Messages.Add(new Message((MessageType)(int)msg.MessageType, msg.Text, msg.Code));
- }
- }
- return result;
- }
-
- public static IResult<T> ConvertResult<T>(T entity, Result<Response> requestResponse)
- {
- IResult<T> result;
- if (entity != null)
- result = new Result<T>(requestResponse.Success, entity);
- else
- result = new Result<T>(requestResponse.Success);
-
- if (!requestResponse.Success)
- {
- foreach (var msg in requestResponse.Messages)
- {
- result.Messages.Add(new Message((MessageType)(int)msg.MessageType, msg.Text, msg.Code));
- }
- }
- return result;
- }
-
- private static Property ConvertCntToProperty(cnt propertyCnt)
- {
- if (propertyCnt != null)
- {
- var dataObjectType = GetDataTypeFromString(GetLabelValue(DATATYPE_IDENTIFIER, propertyCnt.Lbl));
- Reference dataTypeDefinition = null;
- if (dataObjectType == DataObjectType.AnyType)
- dataTypeDefinition = new Reference(new GlobalKey(KeyElements.GlobalReference, KeyType.URI, GetLabelValue(DATATYPE_IDENTIFIER, propertyCnt.Lbl)));
-
- bool isCollection = false;
- if (propertyCnt.Lbl.Contains(Labels.COLLECTION))
- isCollection = true;
-
-
- Property property = new Property(new DataType(dataObjectType, isCollection, dataTypeDefinition))
- {
- Descriptions = GetDescriptionsFromLabels(propertyCnt.Lbl),
- IdShort = GetLabelValue(Labels.ID, propertyCnt.Lbl)
- };
-
- var semanticReference = GetLabelValue(TYPE_IDENTIFIER, propertyCnt.Lbl);
- if (semanticReference != null)
- property.SemanticId = new Reference(new GlobalKey(KeyElements.Property, KeyType.URI, semanticReference));
-
- return property;
- }
- return null;
- }
-
- public static List<Description> GetDescriptionsFromLabels(List<string> labels)
- {
- var descriptionText = GetLabelValue(Labels.DESCRIPTION, labels);
- if (!string.IsNullOrEmpty(descriptionText))
- return new List<Description>() { new Description("EN", descriptionText) };
- return null;
- }
-
- private static Operation ConvertCntToOperation(cnt subElementCnt)
- {
- if (subElementCnt != null)
- {
- var dataObjectType = GetDataTypeFromString(GetLabelValue(RETURN_DATATYPE_IDENTIFIER, subElementCnt.Lbl));
- Reference dataTypeDefinition = null;
- if (dataObjectType == DataObjectType.AnyType)
- dataTypeDefinition = new Reference(new GlobalKey(KeyElements.GlobalReference, KeyType.URI, GetLabelValue(RETURN_DATATYPE_IDENTIFIER, subElementCnt.Lbl)));
-
- Operation op = new Operation()
- {
- Descriptions = GetDescriptionsFromLabels(subElementCnt.Lbl),
- IdShort = GetLabelValue(Labels.ID, subElementCnt.Lbl),
- };
-
- if (Int32.TryParse(GetLabelValue(ParameterStrings.GetParameterLength(), subElementCnt.Lbl), out int paramLength) && paramLength > 0)
- {
- op.In = new List<IOperationVariable>(paramLength);
- for (int i = 0; i < paramLength; i++)
- {
- OperationVariable param = new OperationVariable()
- {
- IdShort = GetLabelValue(ParameterStrings.GetParameterName(i), subElementCnt.Lbl),
- DataType = new DataType(GetDataTypeFromString(GetLabelValue(ParameterStrings.GetParameterDataType(i), subElementCnt.Lbl)), false),
- Index = i
- };
- op.In.Add(param);
- }
- }
-
- op.Out = new List<IOperationVariable>()
- {
- new OperationVariable()
- {
- Index = 0,
- DataType = new DataType(dataObjectType, false, dataTypeDefinition)
- }
- };
- return op;
- }
- return null;
- }
-
- private static Event ConvertCntToEvent(cnt subElementCnt, cin schema)
- {
- if (subElementCnt != null)
- {
- Event ev = new Event()
- {
- Descriptions = GetDescriptionsFromLabels(subElementCnt.Lbl),
- IdShort = GetLabelValue(Labels.ID, subElementCnt.Lbl),
- Category = GetLabelValue(EventIdentifier.EVENT_CATEGORY, subElementCnt.Lbl),
- };
-
- if(schema != null)
- {
- SchemaType schemaType = (SchemaType)Enum.Parse(typeof(SchemaType), GetLabelValue(EventIdentifier.SCHEMA_TYPE, schema.Lbl));
- string schemaString = schema.Con;
- ev.DataType = new DataType(null, schemaType, schemaString);
- }
- return ev;
- }
- return null;
- }
-
- public static IAssetAdministrationShell ConvertAeResourceToAAS(ae aasAe)
- {
- if (aasAe != null)
- {
- var aas = new AssetAdministrationShell()
- {
- Identification = new Identifier(GetLabelValue(Labels.UUID, aasAe.Lbl), KeyType.Custom),
- IdShort = GetLabelValue(Labels.ID, aasAe.Lbl),
- Asset =
- new Asset()
- {
- Identification = new Identifier(GetLabelValue(AssetLabels.ASSET_UUID, aasAe.Lbl), KeyType.Custom),
- IdShort = GetLabelValue(AssetLabels.ASSET_ID, aasAe.Lbl),
- Kind = GetLabelValue(AssetLabels.ASSET_KIND, aasAe.Lbl).Contains(((int)Kind.Type).ToString()) ? Kind.Type : Kind.Instance,
- SemanticId = new Reference(new GlobalKey(KeyElements.Asset, KeyType.URI, GetLabelValue(AssetLabels.ASSET_TYPE_DEFINITION, aasAe.Lbl)))
- },
- Descriptions = GetDescriptionsFromLabels(aasAe.Lbl),
-
- };
- return aas;
- }
- return null;
- }
-
- #endregion
-
- public IAssetAdministrationShell ConvertAASDescriptorToAAS(AssetAdministrationShellDescriptor aasDesc)
- {
- if (aasDesc == null)
- return null;
-
- var aas = new AssetAdministrationShell()
- {
- Asset = aasDesc.Asset,
- Identification = aasDesc.Identification,
- IdShort = aasDesc.IdShort,
- MetaData = aasDesc.MetaData,
- Administration = aasDesc.Administration,
- Category = aasDesc.Category,
- Descriptions = aasDesc.Descriptions
- };
-
- if (aasDesc.Submodels?.Count > 0)
- {
- aas.Submodels = new ElementContainer<ISubmodel>();
- foreach (var submodel in aasDesc.Submodels)
- {
- var convertedSubmodel = ConvertSubmodelDescriptorToSubmodel(submodel);
- if (convertedSubmodel != null)
- aas.Submodels.Add(convertedSubmodel);
- }
- }
- return aas;
- }
-
- public ISubmodel ConvertSubmodelDescriptorToSubmodel(SubmodelDescriptor submodelDesc)
- {
- if (submodelDesc == null)
- return null;
-
- var submodel = new Submodel()
- {
- Identification = submodelDesc.Identification,
- MetaData = submodelDesc.MetaData,
- Administration = submodelDesc.Administration,
- IdShort = submodelDesc.IdShort,
- Category = submodelDesc.Category,
- Descriptions = submodelDesc.Descriptions,
- SemanticId = submodelDesc.SemanticId,
- Kind = submodelDesc.Kind
- };
-
- return submodel;
- }
-
- #region Add-Operations
- public static Result<Response> AddAAS(IAssetAdministrationShell aas)
- {
- if (aas == null || aas.Identification == null || aas.IdShort == null || aas.Asset == null || aas.Asset.Identification == null || aas.Asset.IdShort == null)
- return new Result<Response>(new ArgumentNullException());
-
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName);
-
- List<string> labels = new List<string>();
-
- if (aas.Asset.Kind.HasValue)
- {
- if (aas.Asset.Kind.Value == Kind.Type)
- {
- labels.Add(AssetLabels.ASSET_KIND + SEPERATOR + TYPE);
- labels.Add(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementType.AAS_TYPE);
- }
- else
- {
- labels.Add(AssetLabels.ASSET_KIND + SEPERATOR + INSTANCE);
- labels.Add(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.AAS);
- }
- }
- else
- {
- labels.Add(AssetLabels.ASSET_KIND + SEPERATOR + INSTANCE);
- labels.Add(BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.AAS);
- }
-
- labels.Add(Labels.ID + SEPERATOR + aas.IdShort);
- labels.Add(Labels.UUID + SEPERATOR + aas.Identification.Id);
- labels.Add(Labels.DISPLAY_NAME + SEPERATOR + aas.IdShort);
-
- labels.Add(AssetLabels.ASSET_ID + SEPERATOR + aas.Asset.IdShort);
- labels.Add(AssetLabels.ASSET_UUID + SEPERATOR + aas.Asset.Identification.Id);
-
- if (aas.Asset.SemanticId?.Keys?.Count > 0)
- labels.Add(AssetLabels.ASSET_TYPE_DEFINITION + SEPERATOR + aas.Asset.SemanticId.Keys.First().Value);
-
- if (aas.Descriptions?.Count > 0)
- labels.Add(Labels.DESCRIPTION + SEPERATOR + aas.Descriptions.First().Text);
-
- ApplicationEntity ae = new ApplicationEntity(aas.IdShort, aas.Identification.Id, true, aas.IdShort, null, labels);
- var result = ae.Create(oneM2MClient, req);
- return result;
- }
- public static Result<Response> AddProperty(string aasId, string submodelId, IDataElement property)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId);
- var labels = new List<string>
- {
- BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.PROPERTY,
- };
-
- string dty = string.Empty;
- if (property.ModelType == ModelType.DataElementCollection || property.ModelType == ModelType.SubmodelElementCollection)
- {
- labels.Add(Labels.COLLECTION);
- labels.Add(DATATYPE_IDENTIFIER + SEPERATOR + "string");
- }
- else
- {
- if (property.ValueType.DataObjectType == DataObjectType.AnyType && property.ValueType.SemanticId?.Keys?.Count > 0)
- dty = property.ValueType.SemanticId.Keys.First().Value;
- else
- dty = SmartControlUtils.ConvertDataTypeNames(property.ValueType);
- labels.Add(DATATYPE_IDENTIFIER + SEPERATOR + dty);
- }
-
- //if (property.DataElementInformation.Readable.HasValue && property.DataElementInformation.Readable.Value)
- labels.Add(Labels.READABLE);
- //if (property.DataElementInformation.Writable.HasValue && property.DataElementInformation.Writable.Value)
- labels.Add(Labels.WRITABLE);
- //if (property.DataElementInformation.Eventable.HasValue && property.DataElementInformation.Eventable.Value)
- labels.Add(Labels.EVENTABLE);
-
- if (property.SemanticId?.Keys?.Count > 0)
- labels.Add(TYPE_IDENTIFIER + SEPERATOR + property.SemanticId.Keys.First().Value);
-
- if (!string.IsNullOrEmpty(property.IdShort))
- labels.Add(Labels.ID + SEPERATOR + property.IdShort);
- if (property.Descriptions?.Count > 0)
- labels.Add(Labels.DESCRIPTION + SEPERATOR + property.Descriptions.First().Text);
-
- Container cont = new Container(property.IdShort, null, labels, 8);
- cont.Create(oneM2MClient, req);
-
- req.AddPath(property.IdShort);
- Container.Create(oneM2MClient, req, ContainerStrings.DATA, null, null, 8);
-
- if (property.Value != null)
- UpdatePropertyValue(aasId, submodelId, property.IdShort, new DataElementValue(property.Value, property.ValueType));
-
- req.AddPath(ContainerStrings.DATA);
- var result = CreateSubscription(req, Settings.CallbackEndpointUrl);
-
- return result;
- }
-
- public static Result<Response> CreateSubscription(Request req, string subscriptionUri)
- {
- req.From(subscriptionUri);
- Subscription sub = new Subscription(DEFAULT_SUBSCRIPTION_NAME, new List<string> { subscriptionUri }, new List<notificationEventType> { notificationEventType.CreateofDirectChildResource });
- sub.NotificationContentType = notificationContentType.AllAttributes;
- var result = sub.Create(oneM2MClient, req);
- return result;
- }
-
- public static Result<Response> AddEvent(string aasId, string submodelId, IEvent eventDescription)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId);
-
- var labels = new List<string>
- {
- BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.EVENT,
- EventIdentifier.EVENT_CATEGORY + SEPERATOR + eventDescription.Category,
- DATATYPE_IDENTIFIER + SEPERATOR + "void"
- };
- //if (!string.IsNullOrEmpty(eventDescription.Identification.Id))
- //labels.Add(Labels.UUID + SEPERATOR + eventDescription.Identification.Id);
- if (!string.IsNullOrEmpty(eventDescription.IdShort))
- labels.Add(Labels.ID + SEPERATOR + eventDescription.IdShort);
- if (eventDescription.Descriptions?.Count > 0)
- labels.Add(Labels.DESCRIPTION + SEPERATOR + eventDescription.Descriptions.First().Text);
-
- Container.Create(oneM2MClient, req, eventDescription.IdShort, null, labels, 1);
-
- req.AddPath(eventDescription.IdShort);
-
- var result = Container.Create(oneM2MClient, req, ContainerStrings.DATA, null, null, 8);
-
- req.AddPath(ContainerStrings.DATA);
- req.From(DEFAULT_SUBSCRIPTION_URI);
- Subscription sub = new Subscription(DEFAULT_SUBSCRIPTION_NAME, new List<string> { DEFAULT_SUBSCRIPTION_URI }, new List<notificationEventType> { notificationEventType.CreateofDirectChildResource });
- sub.NotificationContentType = notificationContentType.AllAttributes;
- result = sub.Create(oneM2MClient, req);
-
-
- if (eventDescription.DataType != null && !string.IsNullOrEmpty(eventDescription.DataType.Schema) && eventDescription.DataType.SchemaType.HasValue)
- {
- req.From(DEFAULT_FROM);
- Container.Create(oneM2MClient, req, ContainerStrings.SCHEMA, null, null, 1);
- req.SetPath(aasId, submodelId, eventDescription.IdShort, ContainerStrings.SCHEMA);
-
- var schemaLabels = new List<string>();
- schemaLabels.Add(EventIdentifier.SCHEMA_TYPE + SEPERATOR + Enum.GetName(typeof(SchemaType), eventDescription.DataType.SchemaType.Value));
- ContentInstance.Create(oneM2MClient, req, EventIdentifier.SCHEMA_CIN, eventDescription.DataType.Schema, null, schemaLabels);
- }
-
- return result;
- }
- public static Result<Response> AddOperation(string aasId, string submodelId, IOperation operation)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId);
-
- var labels = new List<string>
- {
- BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.OPERATION
- };
-
- if (operation.In != null)
- {
- labels.Add(ParameterStrings.GetParameterLength() + SEPERATOR + operation.In.Count);
-
- for (int i = 0; i < operation.In.Count; i++)
- {
- labels.Add(ParameterStrings.GetParameterName(i) + SEPERATOR + operation.In[i].IdShort);
- labels.Add(ParameterStrings.GetParameterDataType(i) + SEPERATOR + SmartControlUtils.ConvertDataTypeNames(operation.In[i].DataType));
- }
- }
- else
- labels.Add(ParameterStrings.GetParameterLength() + SEPERATOR + 0);
-
- if (operation.Out?.Count == 1)
- labels.Add(RETURN_DATATYPE_IDENTIFIER + SEPERATOR + SmartControlUtils.ConvertDataTypeNames(operation.Out[0].DataType));
- else
- labels.Add(RETURN_DATATYPE_IDENTIFIER + SEPERATOR + "void");
-
-
- if (!string.IsNullOrEmpty(operation.IdShort))
- labels.Add(Labels.ID + SEPERATOR + operation.IdShort);
- if (operation.Descriptions?.Count > 0)
- labels.Add(Labels.DESCRIPTION + SEPERATOR + operation.Descriptions.First().Text);
-
- Container cont = new Container(operation.IdShort, null, labels);
- var result = cont.Create(oneM2MClient, req);
-
- CreateRequestConstruct(new string[] { aasId, submodelId, operation.IdShort }, Settings.CallbackEndpointUrl);
-
- return result;
- }
- public static Result<Response> AddSubmodel(string aasId, ISubmodel submodel)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId);
-
- var labels = new List<string>
- {
- BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.SUBMODEL
- };
-
- if (submodel.SemanticId?.Keys?.Count > 0)
- labels.Add(TYPE_IDENTIFIER + SEPERATOR + submodel.SemanticId.Keys.First().Value);
- else
- labels.Add(TYPE_IDENTIFIER + SEPERATOR + submodel.IdShort);
-
- if (submodel.Kind.HasValue)
- {
- if (submodel.Kind.Value == Kind.Instance)
- labels.Add(AssetLabels.ASSET_KIND + SEPERATOR + INSTANCE);
- else
- labels.Add(AssetLabels.ASSET_KIND + SEPERATOR + TYPE);
- }
-
- if (!string.IsNullOrEmpty(submodel.Identification.Id))
- labels.Add(Labels.UUID + SEPERATOR + submodel.Identification.Id);
- if (!string.IsNullOrEmpty(submodel.IdShort))
- labels.Add(Labels.ID + SEPERATOR + submodel.IdShort);
- if (submodel.Descriptions?.Count > 0)
- labels.Add(Labels.DESCRIPTION + SEPERATOR + submodel.Descriptions.First().Text);
-
- Container cont = new Container(submodel.IdShort, null, labels);
- var result = cont.Create(oneM2MClient, req);
- return result;
- }
- #endregion
-
- #region Read-Operations
- public static Result<Response> ReadAllAAS(out List<IAssetAdministrationShell> aasList)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName);
- var response = Helper.ReadResourcesByLabels(oneM2MClient, req, new List<string> { BASYS_TYPE_IDENTIFIER + SEPERATOR + ElementInstance.AAS }, out List<resource> resources);
- if (response.Success && resources?.Count > 0)
- {
- aasList = new List<IAssetAdministrationShell>();
- foreach (var resource in resources)
- {
- if (resource is ae aasAe)
- {
- var aas = ConvertAeResourceToAAS(aasAe);
- if (aas != null)
- {
- ReadSubmodels(aas.IdShort, out ElementContainer<ISubmodel> submodels);
- if (submodels?.Count > 0)
- {
- aas.Submodels = new ElementContainer<ISubmodel>();
- foreach (var submodel in submodels)
- {
- //string serviceUri = string.Join(PATH_SEPERATOR, PATH_SEPERATOR, aas.IdShort, ElementInstance.SUBMODELS, submodel.IdShort).Replace("//", "/");
- aas.Submodels.Add(submodel);
- }
- }
- aasList.Add(aas);
- }
- }
- }
- return response;
- }
- aasList = null;
- return response;
- }
- public static Result<Response> ReadAAS(string aasId, out IAssetAdministrationShell aas)
- {
- if (!string.IsNullOrEmpty(aasId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName);
- var response = Helper.ReadResourcesByLabels(oneM2MClient, req, new List<string> { Labels.ID + SEPERATOR + aasId }, out List<resource> resources);
- if (response.Success && resources != null
- && resources.FirstOrDefault(r => r.Ty.Value == (int)resourceType.AE) != null)
- {
- aas = ConvertAeResourceToAAS((ae)resources.FirstOrDefault());
- ReadSubmodels(aasId, out ElementContainer<ISubmodel> submodels);
- if (aas != null)
- {
- if (submodels != null)
- {
- aas.Submodels = new ElementContainer<ISubmodel>();
- foreach (var submodel in submodels)
- {
- //string serviceUri = string.Join(PATH_SEPERATOR, PATH_SEPERATOR, aasId, ElementInstance.SUBMODELS, submodel.IdShort).Replace("//", "/");
- aas.Submodels.Add(submodel);
- }
- }
- return response;
- }
- }
- aas = null;
- return response;
- }
- aas = null;
- return null;
- }
- public static Result<Response> ReadSubmodel(string aasId, string submodelId, out Submodel submodel)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId);
- var result = Helper.ReadResourceTree(oneM2MClient, req, out ObjectTreeBuilder submodelTree);
- submodel = ReadSubmodelFrom(aasId, submodelTree);
-
- return result;
- }
- submodel = null;
- return null;
- }
- public static Result<Response> ReadSubmodels(string aasId, out ElementContainer<ISubmodel> submodels)
- {
- if (!string.IsNullOrEmpty(aasId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId);
- var result = Helper.ReadResourceTree(oneM2MClient, req, out ObjectTreeBuilder resTree);
- if (result.Success && resTree != null && resTree.HasChildren())
- {
- submodels = new ElementContainer<ISubmodel>();
- foreach (ObjectTreeBuilder child in resTree.Children)
- {
- var submodel = ReadSubmodelFrom(aasId, child);
- submodels.Add(submodel);
- }
- if (submodels.Count == 0)
- submodels = null;
-
- return result;
- }
- submodels = null;
- return result;
- }
- submodels = null;
- return null;
- }
- public static Result<Response> ReadProperty(string aasId, string submodelId, string propertyId, out Property property)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, propertyId);
- var result = Container.Retrieve(oneM2MClient, req);
- property = null;
- if (result.Success && result.Entity.TryGetResource(out cnt prop))
- {
- property = ConvertCntToProperty(prop);
- //if (property != null)
- //{
- // req.AddPath(ContainerStrings.DATA, DEFAULT_SUBSCRIPTION_NAME);
- // //req.AddPath(ContainerStrings.GET, ContainerStrings.REQUEST, DEFAULT_SUBSCRIPTION_NAME);
- // var listenerUriReq = Subscription.Retrieve(oneM2MClient, req);
- // if (listenerUriReq.Success && listenerUriReq.Entity.TryGetResource(out sub subUri))
- // (property.ElementInformation as ElementInformation).Endpoint = string.Join(ELEMENT_SEPERATOR, subUri.Nu);
- //}
- }
- return result;
- }
- property = null;
- return null;
- }
- public static Result<Response> ReadPropertyValue(string aasId, string submodelId, string propertyId, out IValue value)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- ReadProperty(aasId, submodelId, propertyId, out Property property);
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, propertyId, ContainerStrings.DATA);
- var resp = Helper.ReadLatestAddedResource(oneM2MClient, req, out resource data);
- if (resp.Success && data != null && data is cin dataCin)
- value = SmartControlUtils.ConvertPropertyValue(dataCin.Con, property.ValueType);
- else
- value = null;
- return resp;
- }
- value = null;
- return null;
- }
- public static Result<Response> ReadOperation(string aasId, string submodelId, string operationId, out Operation operation)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(operationId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, operationId);
- var result = Container.Retrieve(oneM2MClient, req);
- operation = null;
- if (result.Success && result.Entity.TryGetResource(out cnt op))
- {
- operation = ConvertCntToOperation(op);
- //if (operation != null)
- //{
- // req.AddPath(ContainerStrings.REQUEST, DEFAULT_SUBSCRIPTION_NAME);
- // var listenerUriReq = Subscription.Retrieve(oneM2MClient, req);
- // if (listenerUriReq.Success && listenerUriReq.Entity.TryGetResource(out sub subUri))
- // operation.OperationInformation.Endpoint = string.Join(ELEMENT_SEPERATOR, subUri.Nu);
- //}
- }
- return result;
- }
- operation = null;
- return null;
- }
- public static Result<Response> ReadEvent(string aasId, string submodelId, string eventId, out Event eventable)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(eventId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, eventId);
- var result = Container.Retrieve(oneM2MClient, req);
- eventable = null;
- if (result.Success && result.Entity.TryGetResource(out cnt ev))
- {
- cin schema = null;
- req.AddPath(ContainerStrings.SCHEMA);
- var schemaResult = Container.Retrieve(oneM2MClient, req);
- if (schemaResult.Success && schemaResult.Entity.TryGetResource(out cnt sc))
- {
- if (sc.Cni.HasValue && sc.Cni.Value > 0)
- {
- schemaResult = Helper.ReadLatestAddedResource(oneM2MClient, req, out resource res);
- if (res is cin)
- schema = (cin)res;
- }
- }
- eventable = ConvertCntToEvent(ev, schema);
- }
- return result;
- }
- eventable = null;
- return null;
- }
- #endregion
-
- #region Remove-Operations
- public static Result<Response> RemoveComponent(string[] components)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, components);
- var result = ApplicationEntity.Delete(oneM2MClient, req);
- return result;
- }
- public static Result<Response> RemoveOperation(string aasId, string submodelId, string operationId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(operationId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, operationId);
- var result = Container.Delete(oneM2MClient, req);
- return result;
- }
- return null;
- }
- public static Result<Response> RemoveEvent(string aasId, string submodelId, string eventId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(eventId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, eventId);
- var result = Container.Delete(oneM2MClient, req);
- return result;
- }
- return null;
- }
- public static Result<Response> RemoveProperty(string aasId, string submodelId, string propertyId)
- {
- if (!string.IsNullOrEmpty(aasId) && !string.IsNullOrEmpty(submodelId) && !string.IsNullOrEmpty(propertyId))
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, propertyId);
- var result = Container.Delete(oneM2MClient, req);
- return result;
- }
- return null;
- }
- #endregion
-
- #region Event-Operations
-
- public static Result<Response> Publish(string aasId, string submodelId, string eventId, IPublishableEvent publishableEvent)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, eventId, ContainerStrings.DATA);
-
- var evResult = ContentInstance.Create(oneM2MClient, req, publishableEvent.IdShort, JsonConvert.SerializeObject(publishableEvent));
-
- return evResult;
- }
-
- public static Result<Response> Subscribe(string aasId, string submodelId, string eventId, string subscriberId, string subscriberEndpoint)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, eventId, ContainerStrings.DATA);
-
- req.From(subscriberEndpoint);
- Subscription sub = new Subscription(EventIdentifier.SUBSCRIBER_SUB + subscriberId, new List<string> { subscriberEndpoint }, new List<notificationEventType> { notificationEventType.CreateofDirectChildResource });
- sub.NotificationContentType = notificationContentType.AllAttributes;
- var result = sub.Create(oneM2MClient, req);
-
- return result;
- }
-
- public static Result<Response> Unsubscribe(string aasId, string submodelId, string eventId, string subscriberId)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, aasId, submodelId, eventId, ContainerStrings.DATA, EventIdentifier.SUBSCRIBER_SUB + subscriberId);
- var result = Subscription.Delete(oneM2MClient, req);
- return result;
- }
- #endregion
-
- #endregion
- #region Utility-Functions
- public static string GetLabelValue(string label, List<string> labels, string seperator = SEPERATOR)
- {
- if (!string.IsNullOrEmpty(label) && labels != null)
- {
- string typeDefiniton = labels.FirstOrDefault(l => l.StartsWith(label));
- if (!string.IsNullOrEmpty(typeDefiniton))
- return typeDefiniton.Split(new string[] { label + seperator }, StringSplitOptions.RemoveEmptyEntries)[0];
- }
- return null;
- }
- private static Result<Response> CreateRequestConstruct(string[] path, string subscriptionListenerUri)
- {
- Request req = RequestFactory.CreateRequest(oneM2MClient, Settings.oneM2MConfig.ClientId, Settings.oneM2MConfig.Endpoint, Settings.oneM2MConfig.CSEName, path);
-
- Container.Create(oneM2MClient, req, ContainerStrings.REQUEST, null, null, 8);
- Container.Create(oneM2MClient, req, ContainerStrings.RESPONSE, null, null, 8);
- Container.Create(oneM2MClient, req, ContainerStrings.PROCESSING, null, null, 8);
-
- req.AddPath(ContainerStrings.REQUEST);
- req.From(subscriptionListenerUri);
- Subscription sub = new Subscription(DEFAULT_SUBSCRIPTION_NAME, new List<string> { subscriptionListenerUri }, new List<notificationEventType> { notificationEventType.CreateofDirectChildResource });
- sub.NotificationContentType = notificationContentType.AllAttributes;
- var result = sub.Create(oneM2MClient, req);
- return result;
- }
- public static DataObjectType GetDataTypeFromString(string dty)
- {
- if (!string.IsNullOrEmpty(dty))
- {
- if (DataObjectType.TryParse(dty, out DataObjectType dataType))
- return dataType;
- else
- return DataObjectType.AnyType;
- }
- return DataObjectType.None;
- }
-
-
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlExtensions.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlExtensions.cs
deleted file mode 100644
index 16bd8c4..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlExtensions.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using BaSys40.API.AssetAdministrationShell;
-using BaSys40.API.AssetAdministrationShell.Connectables;
-using BaSys40.API.Platform;
-using BaSys40.API.ServiceProvider;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using Microsoft.Extensions.DependencyInjection;
-using NLog;
-using NLog.Web;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-
-namespace BaSys40.RI.AAS.SmartControl.Extensions
-{
- public static class SmartControlExtensions
- {
- private static SmartControlSettings Settings;
- private static Logger logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
- private static IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider;
- private static SmartControlHandler smartControlHandler;
-
- static SmartControlExtensions()
- {
- string settingsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), SmartControlSettings.FileName);
- Settings = SmartControlSettings.LoadSettings(settingsPath);
- }
- public static IServiceCollection ConfigureSmartControl(this IServiceCollection services, IAssetAdministrationShellServiceProvider aasServiceProvider, SmartControlSettings settings = null)
- {
- Settings = settings ?? Settings;
- assetAdministrationShellServiceProvider = aasServiceProvider;
- smartControlHandler = new SmartControlHandler(Settings.CallbackEndpointUrl);
-
- var aas_Deleted = SmartControl.Instance.DeleteAssetAdministrationShell(aasServiceProvider.AssetAdministrationShell.IdShort);
- logger.Info($"AAS {aasServiceProvider.AssetAdministrationShell.IdShort} deleted - Success: " + aas_Deleted.Success);
- var aas_Created = SmartControl.Instance.CreateAssetAdministrationShell(aasServiceProvider.AssetAdministrationShell);
- logger.Info($"AAS {aasServiceProvider.AssetAdministrationShell.IdShort} created - Success: " + aas_Created.Success);
-
- var connectedAAS = new ConnectedAssetAdministrationShell(SmartControl.Instance);
- connectedAAS.BindTo(aasServiceProvider.AssetAdministrationShell);
-
- foreach (var submodel in aasServiceProvider.AssetAdministrationShell.Submodels)
- {
- var success = connectedAAS.CreateSubmodel(submodel);
- logger.Info($"Submodel {submodel.IdShort} created - Success: " + success);
- var connectedSubmodel = new ConnectedSubmodel(SmartControl.Instance, aasServiceProvider.AssetAdministrationShell);
- connectedSubmodel.BindTo(submodel);
- connectedAAS.RegisterSubmodelServiceProvider(submodel.IdShort, connectedSubmodel);
-
- foreach (var op in connectedSubmodel.RetrieveOperations().Entity)
- {
- var connectedOp = new ConnectedOperation(SmartControl.Instance, aasServiceProvider.AssetAdministrationShell, submodel, op);
- smartControlHandler.RegisterMethodCalledEventHandler(connectedSubmodel, connectedOp, GenericMethodHandler);
- }
-
- foreach (var de in connectedSubmodel.RetrieveDataElements().Entity)
- {
- var connectedDataElement = new ConnectedDataElement(SmartControl.Instance, aasServiceProvider.AssetAdministrationShell, submodel, de);
- smartControlHandler.RegisterGetPropertyValueHandler(connectedSubmodel, connectedDataElement, GenericGetValueHandler);
- smartControlHandler.RegisterSetPropertyValueHandler(connectedSubmodel, connectedDataElement, GenericSetValueHandler);
-
- assetAdministrationShellServiceProvider.GetSubmodelServiceProvider(submodel.IdShort).SubscribeUpdates(de.IdShort, value =>
- {
- SmartControl.Instance.UpdateDataElementValue(aasServiceProvider.AssetAdministrationShell.IdShort, submodel.IdShort, de.IdShort, value);
- });
- }
- }
-
- services.AddSingleton<IAssetAdministrationShellAggregator, SmartControl>(sp => { return SmartControl.Instance; });
- services.AddSingleton<IAssetAdministrationShellServiceProvider, ConnectedAssetAdministrationShell>(sp => { return connectedAAS; });
-
- return services;
- }
-
- private static void GenericSetValueHandler(IConnectableDataElement dataElement, IValue value)
- {
- var handler = assetAdministrationShellServiceProvider.GetSubmodelServiceProvider(dataElement.Submodel.IdShort)
- .RetrieveDataElementHandler(dataElement.DataElement.IdShort);
-
- handler?.SetHandler?.Invoke(dataElement.DataElement, value);
- }
-
- private static IValue GenericGetValueHandler(IConnectableDataElement dataElement)
- {
- var handler = assetAdministrationShellServiceProvider.GetSubmodelServiceProvider(dataElement.Submodel.IdShort)
- .RetrieveDataElementHandler(dataElement.DataElement.IdShort);
-
- return handler?.GetHandler?.Invoke(dataElement.DataElement);
- }
-
- private static OperationResult GenericMethodHandler(IConnectableOperation operation, List<IArgument> inputArguments, List<IArgument> outputArguments)
- {
- var del = assetAdministrationShellServiceProvider.GetSubmodelServiceProvider(operation.Submodel.IdShort)
- .RetrieveMethodDelegate(operation.Operation.IdShort);
-
- if (del is MethodCalledHandler mch)
- return mch.Invoke(operation.Operation, inputArguments, outputArguments);
- else
- {
- if (inputArguments == null || inputArguments.Count == 0)
- del.DynamicInvoke();
- else
- {
- object[] args = new object[inputArguments.Count];
- for (int i = 0; i < args.Length; i++)
- {
- args[i] = inputArguments[i].Value;
- }
- del.DynamicInvoke(args);
- }
- }
-
- return new OperationResult(true);
- }
-
- public static void Shutdown()
- {
- if(!string.IsNullOrEmpty(assetAdministrationShellServiceProvider?.AssetAdministrationShell?.IdShort))
- SmartControl.Instance.DeleteAssetAdministrationShell(assetAdministrationShellServiceProvider.AssetAdministrationShell.IdShort);
-
- smartControlHandler.Dispose();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlHandler.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlHandler.cs
deleted file mode 100644
index dfd4ee8..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlHandler.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using BaSys40.API.AssetAdministrationShell;
-using BaSys40.Models.Core;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using BaSys40.Utils.Server;
-using Newtonsoft.Json;
-using oneM2MClient;
-using oneM2MClient.Client;
-using oneM2MClient.Resources;
-using oneM2MClient.Utils;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using BaSys40.API.Platform;
-using NLog;
-
-namespace BaSys40.RI.AAS.SmartControl
-{
- public class SmartControlHandler : IAssetAdministrationShellHandler, IDisposable
- {
- private readonly SimpleLocalHttpServer server;
- private static Dictionary<string, IConnectableOperation> connectedOperations = new Dictionary<string, IConnectableOperation>();
- private static Dictionary<string, IConnectableDataElement> connectedProperties = new Dictionary<string, IConnectableDataElement>();
- private static Dictionary<string, IConnectableEvent> connectedEvents = new Dictionary<string, IConnectableEvent>();
-
- private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
-
- public SmartControlHandler(string endpoint)
- {
- server = new SimpleLocalHttpServer(endpoint);
- server.Start(HandleNotification, HandleResponse);
- }
-
- public SmartControlHandler(int localHttpPort) : this("http://127.0.0.1:" + localHttpPort)
- { }
-
- public SmartControlHandler() : this(SmartControl.Settings.CallbackEndpointUrl)
- { }
-
- public void RegisterGetPropertyValueHandler(IConnectableSubmodel connectableSubmodel, IConnectableDataElement connectableProperty, GetDataElementValueEventHandler getPropertyValueHandler)
- {
- var cPropId = string.Join("/", connectableSubmodel.Submodel.IdShort, connectableProperty.DataElement.IdShort);
- if (connectedProperties.ContainsKey(cPropId))
- {
- connectedProperties[cPropId].GetDataElementValueHandler += getPropertyValueHandler;
- }
- else
- {
- connectableProperty.GetDataElementValueHandler += getPropertyValueHandler;
- connectedProperties.Add(cPropId, connectableProperty);
- }
- }
-
- public void RegisterSetPropertyValueHandler(IConnectableSubmodel connectableSubmodel, IConnectableDataElement connectableProperty, SetDataElementValueEventHandler SetPropertyValueHandler)
- {
- var cPropId = string.Join("/", connectableSubmodel.Submodel.IdShort, connectableProperty.DataElement.IdShort);
- if (connectedProperties.ContainsKey(cPropId))
- {
- connectedProperties[cPropId].SetDataElementValueHandler += SetPropertyValueHandler;
- }
- else
- {
- connectableProperty.SetDataElementValueHandler += SetPropertyValueHandler;
- connectedProperties.Add(cPropId, connectableProperty);
- }
- }
- public void RegisterMethodCalledEventHandler(IConnectableSubmodel connectableSubmodel, IConnectableOperation connectableOperation, MethodCalledEventHandler handler)
- {
- connectableOperation.OnCallMethod += handler;
- var cOpId = string.Join("/", connectableSubmodel.Submodel.IdShort, connectableOperation.Operation.IdShort);
- if (!connectedOperations.ContainsKey(cOpId))
- connectedOperations.Add(cOpId, connectableOperation);
- else
- connectedOperations[cOpId] = connectableOperation;
- }
-
- public void RegisterEventHandler(IConnectableSubmodel connectableSubmodel, IConnectableEvent connectableEvent, BaSys40.API.AssetAdministrationShell.EventHandler handler)
- {
- connectableEvent.EventHandler += handler;
- var cEvId = string.Join("/", connectableSubmodel.Submodel.IdShort, connectableEvent.Event.IdShort);
- if (!connectedEvents.ContainsKey(cEvId))
- connectedEvents.Add(cEvId, connectableEvent);
- else
- connectedEvents[cEvId] = connectableEvent;
- }
-
- private void HandleResponse(HttpListenerResponse obj)
- {
- obj.StatusCode = (int)HttpStatusCode.OK;
- obj.Close();
- }
-
- private void HandleNotification(HttpListenerRequest obj)
- {
- logger.Debug("Enter HandleNotification(...), Incoming request: {0},{1}", obj.HttpMethod, obj.Url);
-
- Notification notification = Notification.ReadFrom(obj);
- if (notification != null)
- {
- logger.Debug("Parsed notification, subscription reference: {0}, notification event?: {1}", notification.SubscriptionReference, notification.NotificationEvent);
-
- Request request = RequestFactory.CreateRequest(SmartControl.oneM2MClient, SmartControl.Settings.oneM2MConfig.ClientId, SmartControl.Settings.oneM2MConfig.Endpoint, notification.NotificationEvent.Representation.Ri.Replace("/in-cse/", string.Empty));
- var result = Helper.DiscoverResource(SmartControl.oneM2MClient, request, out List<string> resourceUrils);
- if (result.Success && resourceUrils != null && resourceUrils.Count > 0)
- {
- if (notification.TryGetResource(out ContentInstance requestCall))
- {
- string[] resourceTree = null;
- string resourceUril = string.Empty;
- if (!string.IsNullOrEmpty(notification.SubscriptionReference))
- {
- resourceTree = notification.SubscriptionReference.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
- if (resourceTree.Length >= 4)
- resourceUril = string.Join("/", resourceTree[1], resourceTree[2], resourceTree[3]);
- }
-
- if (string.IsNullOrEmpty(resourceUril))
- {
- resourceTree = resourceUrils[0].Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
- if (resourceTree.Length >= 5)
- resourceUril = string.Join("/", resourceTree[3], resourceTree[4]);
- }
- if (resourceTree.Contains(SmartControl.ContainerStrings.DATA))
- {
- if (connectedProperties.TryGetValue(resourceUril, out IConnectableDataElement cProp))
- {
- var value = SmartControlUtils.ConvertPropertyValue(requestCall.Content, cProp.DataElement.ValueType);
- cProp.SetLocalValue(value);
- }
- }
- else
- {
- if (connectedOperations.TryGetValue(resourceUril, out IConnectableOperation cOp))
- {
- List<IArgument> inputArguments = SmartControlUtils.ConvertStringArguments(requestCall.Content, cOp.Operation.In);
- List<IArgument> outputArguments = new List<IArgument>();
- var invokeResult = cOp.InvokeLocal(inputArguments, outputArguments, 10000);
- if (invokeResult.Success)
- {
- string argumentString = SmartControlUtils.ConvertStringArguments(outputArguments);
-
- request = RequestFactory.CreateRequest(SmartControl.oneM2MClient, SmartControl.Settings.oneM2MConfig.ClientId, SmartControl.Settings.oneM2MConfig.Endpoint, SmartControl.Settings.oneM2MConfig.CSEName,
- resourceTree[1], resourceTree[2], resourceTree[3], resourceTree[4], SmartControl.ContainerStrings.RESPONSE);
- var labels = new List<string>() { SmartControl.RELATION + SmartControl.SEPERATOR + notification.NotificationEvent.Representation.Ri };
- ContentInstance.Create(SmartControl.oneM2MClient, request, requestCall.ResourceName, argumentString, null, labels);
- }
- }
- else if (connectedEvents.TryGetValue(resourceUril, out IConnectableEvent cEv))
- {
- cEv.Invoke(JsonConvert.DeserializeObject<PublishableEvent>(requestCall.Content));
- }
- }
- }
- }
- }
- }
-
- #region IDisposable Support
- private bool disposedValue = false; // To detect redundant calls
-
- protected virtual void Dispose(bool disposing)
- {
- if (!disposedValue)
- {
- if (disposing)
- {
- server.Stop();
- }
- disposedValue = true;
- }
- }
-
-
- public void Dispose()
- {
- Dispose(true);
- }
- #endregion
- }
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlIdentifier.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlIdentifier.cs
deleted file mode 100644
index 6a92809..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlIdentifier.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-namespace BaSys40.RI.AAS.SmartControl
-{
- public partial class SmartControl
- {
- public const string SEPERATOR = ":";
- public const string ELEMENT_SEPERATOR = ",";
- public const string PATH_SEPERATOR = "/";
-
- public const string BASYS_TYPE_IDENTIFIER = "basys";
- public const string TYPE_IDENTIFIER = "td";
- public const string DATATYPE_IDENTIFIER = "dty";
- public const string RETURN_DATATYPE_IDENTIFIER = "rdty";
-
- public const int DEFAULT_TIMEOUT = 10000;
-
- public const string DEFAULT_FROM = "admin:admin";
- public const string DEFAULT_SUBSCRIPTION_NAME = "default_subscription";
- public const string DEFAULT_SUBSCRIPTION_URI = "http://127.0.0.1:8544";
-
- public const string INSTANCE = "inst";
- public const string TYPE = "ty";
-
- public const string RELATION = "rel";
-
-
- public static class AssetLabels
- {
- public const string ASSET_TYPE_DEFINITION = "atd";
- public const string ASSET_ID = "aid";
- public const string ASSET_KIND = "ak";
- public const string ASSET_UUID = "auuid";
- }
-
- public static class ElementType
- {
- public const string AAS_TYPE = "aas-ty";
- public const string PROPERTY_TYPE = "prop-ty";
- public const string OPERATION_TYPE = "op-ty";
- public const string SUBMODEL_TYPE = "sm-ty";
- public const string EVENT_TYPE = "evt-ty";
- }
-
- public static class ElementInstance
- {
- public const string AAS = "aas";
- public const string PROPERTY = "prop";
- public const string OPERATION = "op";
- public const string SUBMODEL = "sm";
- public const string EVENT = "evt";
- public const string SUBMODELS = "submodels";
- }
-
- public static class EventIdentifier
- {
- public const string ORIGINATOR = "orig";
- public const string SCHEMA_TYPE = "sc-ty";
- public const string EVENT_CATEGORY = "cat";
- public const string SCHEMA_CIN = "cin_schema";
- public const string SUBSCRIBER_SUB = "sub_subscriber";
- }
-
- public static class ContainerStrings
- {
- public const string GET = "GET";
- public const string SET = "SET";
- public const string DATA = "DATA";
- public const string REQUEST = "REQ";
- public const string PROCESSING = "PROC";
- public const string RESPONSE = "RESP";
- public const string SCHEMA = "SCHEMA";
- }
-
- public static class Labels
- {
- public const string READABLE = "rd";
- public const string WRITABLE = "wr";
- public const string EVENTABLE = "ev";
- public const string ID = "id";
- public const string DESCRIPTION = "desc";
- public const string DISPLAY_NAME = "dn";
- public const string COLLECTION = "col:map";
- public const string UUID = "uuid";
- }
-
- public static class ParameterStrings
- {
- public const string PARAM_IDENTIFIER = "par";
- public const string PARAM_SEPERATOR = "-";
- public const string PARAM_NAME = "nm";
- public const string PARAM_DATATYPE = "dty";
- public const string PARAM_LENGTH = "len";
-
- public const string PARAM_BRACKET_LEFT = "[";
- public const string PARAM_BRACKET_RIGHT = "]";
-
- public static string GetParameterLength()
- {
- return PARAM_IDENTIFIER + PARAM_SEPERATOR + PARAM_LENGTH;
- }
-
- public static string GetParameterName(int i)
- {
- return PARAM_IDENTIFIER + PARAM_SEPERATOR + i + PARAM_SEPERATOR + PARAM_NAME;
- }
-
- public static string GetParameterDataType(int i)
- {
- return PARAM_IDENTIFIER + PARAM_SEPERATOR + i + PARAM_SEPERATOR + PARAM_DATATYPE;
- }
- }
-
- public static class OneM2MStrings
- {
- public const string LATEST = "la";
- }
-
- }
-
-
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.cs
deleted file mode 100644
index 2097a6c..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using BaSys40.Utils.Settings;
-using System;
-using System.Xml.Serialization;
-
-namespace BaSys40.RI.AAS.SmartControl
-{
- public class SmartControlSettings : Settings<SmartControlSettings>
- {
- public oneM2MConfiguration oneM2MConfig { get; set; } = new oneM2MConfiguration();
-
- public string CallbackEndpointUrl { get; set; }
-
- [Serializable]
- public class oneM2MConfiguration
- {
- [XmlElement]
- public string ProtocolBinding { get; set; }
- [XmlElement]
- public string ClientId { get; set; }
- [XmlElement]
- public string CSEName { get; set; }
- [XmlElement]
- public string Endpoint { get; set; }
- }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.xml b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.xml
deleted file mode 100644
index d1a4aee..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlSettings.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<SmartControlSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <CallbackEndpointUrl>http://127.0.0.1:5455</CallbackEndpointUrl>
- <!-- http://192.168.46.165:8544 -->
- <OperationMode>None</OperationMode>
- <ClientConfig/>
- <ServerConfig>
- <ServerId>SmartControlServer</ServerId>
- <Endpoint>http://127.0.0.1:5455</Endpoint>
- </ServerConfig>
- <PathConfig/>
- <oneM2MConfig>
- <ProtocolBinding>Http</ProtocolBinding>
- <ClientId>admin:admin</ClientId>
- <Endpoint>http://127.0.0.1:8282</Endpoint>
- <CSEName>in-name</CSEName>
- </oneM2MConfig>
- <Miscellaneous/>
-</SmartControlSettings>
diff --git a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlUtils.cs b/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlUtils.cs
deleted file mode 100644
index c73abf7..0000000
--- a/sdks/csnet/BaSys40.RI.AAS.SmartControl/SmartControlUtils.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using BaSys40.Models.Core;
-using BaSys40.Models.Core.AssetAdministrationShell.Generics;
-using BaSys40.Models.Core.AssetAdministrationShell.Implementations;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Net;
-using System.Reflection;
-using System.Web;
-
-namespace BaSys40.RI.AAS.SmartControl
-{
- public static class SmartControlUtils
- {
- public static Operation GetOperationDescription(MethodInfo method)
- {
- Operation operation = new Operation();
- //operation.Identification = new Identifier(method.Name, Identificator.Internal);
- operation.IdShort = method.Name;
- var parameters = method.GetParameters();
- operation.In = new List<IOperationVariable>(parameters.Length);
- for (int i = 0; i < parameters.Length; i++)
- {
- operation.In.Add(
- new OperationVariable()
- {
- DataType = DataType.GetDataTypeFromSystemTypes(parameters[i].ParameterType),
- IdShort = parameters[i].Name
- }
- );
- }
-
- operation.Out = new List<IOperationVariable>()
- {
- new OperationVariable()
- {
- Index = 0,
- DataType = DataType.GetDataTypeFromSystemTypes(method.ReturnType)
- }
- };
-
- return operation;
- }
-
- public static List<IArgument> ConvertStringArguments(string argumentString, List<IOperationVariable> referenceArguments)
- {
- string urlDecoded = Uri.UnescapeDataString(argumentString);
- object[] args;
- try
- {
- JArray ja = JArray.Parse(urlDecoded);
- args = ja.ToObject<object[]>();
- }
- catch
- {
- JToken val = JValue.Parse(urlDecoded);
- object oVal = val.ToObject<object>();
- args = new object[] {oVal };
- }
-
- if (args.Length > 0)
- {
- List<IArgument> arguments = new List<IArgument>();
- for (int i = 0; i < args.Length; i++)
- {
- arguments.Add(
- new Argument()
- {
- Index = i,
- IdShort = referenceArguments[i].IdShort,
- ValueType = referenceArguments[i].DataType,
- Value = args[i]
- });
- }
- return arguments;
- }
- return null;
- }
-
- public static string ConvertStringArguments(List<IArgument> arguments)
- {
- string argumentString = string.Empty;
- if (arguments?.Count == 1)
- {
- if (arguments[0].ValueType.DataObjectType == DataObjectType.String)
- argumentString += '"' + HttpUtility.JavaScriptStringEncode((string)arguments[0].Value) + '"';
- else if (arguments[0].ValueType.DataObjectType == DataObjectType.Float || arguments[0].ValueType.DataObjectType == DataObjectType.Double)
- argumentString += ((float)arguments[0].Value).ToString(System.Globalization.CultureInfo.GetCultureInfo("en-US").NumberFormat);
- else
- argumentString += arguments[0].Value.ToString();
- }
- else if (arguments?.Count > 1)
- {
- argumentString += SmartControl.ParameterStrings.PARAM_BRACKET_LEFT;
- for (int i = 0; i < arguments.Count; i++)
- {
- if (arguments[i].ValueType.DataObjectType == DataObjectType.String)
- argumentString += '"' + HttpUtility.JavaScriptStringEncode((string)arguments[i].Value) + '"';
- else if (arguments[i].ValueType.DataObjectType == DataObjectType.Float || arguments[i].ValueType.DataObjectType == DataObjectType.Double)
- argumentString += ((float)arguments[i].Value).ToString(System.Globalization.CultureInfo.GetCultureInfo("en-US").NumberFormat);
- else
- argumentString += arguments[i].Value.ToString();
-
- if (i != arguments.Count - 1)
- argumentString += SmartControl.ELEMENT_SEPERATOR;
- }
- argumentString += SmartControl.ParameterStrings.PARAM_BRACKET_RIGHT;
- }
- else
- argumentString = SmartControl.ParameterStrings.PARAM_BRACKET_LEFT + SmartControl.ParameterStrings.PARAM_BRACKET_RIGHT;
-
- string urlEncoded = Uri.EscapeDataString(argumentString);
- return urlEncoded;
- }
-
- public static string ConvertPropertyValue(IValue value)
- {
- string content = string.Empty;
- if (value?.ValueType?.DataObjectType == DataObjectType.String)
- content = '"' + HttpUtility.JavaScriptStringEncode((string)value.Value) + '"';
- else if (value?.ValueType?.DataObjectType == DataObjectType.AnyType)
- content = '"' + HttpUtility.JavaScriptStringEncode(JsonConvert.SerializeObject(value.Value)) + '"';
- else if (value?.ValueType?.DataObjectType == DataObjectType.Float || value?.ValueType?.DataObjectType == DataObjectType.Double)
- content = ((float)value.Value).ToString(System.Globalization.CultureInfo.GetCultureInfo("en-US").NumberFormat);
- else if (value?.ValueType?.DataObjectType == DataObjectType.Bool)
- content = value?.Value?.ToString().ToLower();
- else
- content = value?.Value?.ToString();
-
- if(!string.IsNullOrEmpty(content))
- return Uri.EscapeDataString(content);
- else
- return string.Empty;
- }
-
- public static IValue ConvertPropertyValue(string propertyValue, DataType dataType)
- {
- string urlDecoded = Uri.UnescapeDataString(propertyValue);
-
- var value = urlDecoded.ToObject(dataType);
-
- var dataElementValue = new DataElementValue(value, dataType);
- return dataElementValue;
- }
-
- public static object ToObject(this string value, DataType dataType)
- {
- try
- {
- var jVal = JValue.Parse(value);
- var convertedVal = jVal.ToObject(DataType.GetSystemTypeFromDataType(dataType));
- return convertedVal;
- }
- catch (Exception e)
- {
- throw new InvalidCastException("Cannot convert to " + dataType.DataObjectType + " - Exception: " + e.Message);
- }
- }
-
- public static string ConvertDataTypeNames(DataType dataType)
- {
- string dataTypeName = dataType.DataObjectType.Name.ToLower();
- switch (dataTypeName)
- {
- case "integer":
- case "int": return "int";
- case "bool":
- case "boolean": return "bool";
- case "none": return "void";
- case "decimal":
- case "double":
- case "float": return "float";
- default:
- return ("string");
- }
- }
- }
-}
-
diff --git a/sdks/csnet/BaSys40.Registry.Client/BaSys40.Registry.Client.csproj b/sdks/csnet/BaSys40.Registry.Client/BaSys40.Registry.Client.csproj
deleted file mode 100644
index 6234bca..0000000
--- a/sdks/csnet/BaSys40.Registry.Client/BaSys40.Registry.Client.csproj
+++ /dev/null
@@ -1,29 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>full</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="NLog" Version="4.5.11" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.API\BaSys40.API.csproj" />
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <None Update="RegistryClientSettings.xml">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- </ItemGroup>
-
-</Project>
diff --git a/sdks/csnet/BaSys40.Registry.Client/RegistryClient.cs b/sdks/csnet/BaSys40.Registry.Client/RegistryClient.cs
deleted file mode 100644
index 5c64bf4..0000000
--- a/sdks/csnet/BaSys40.Registry.Client/RegistryClient.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-
-using BaSys40.API.Platform;
-using BaSys40.Models.Core.AssetAdministrationShell;
-using BaSys40.Models.Extensions;
-using BaSys40.Utils.Client.Http;
-using BaSys40.Utils.ResultHandling;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Http;
-using System.Reflection;
-
-namespace BaSys40.Registry.Client
-{
- public class RegistryClient : SimpleHttpClient, IAssetAdministrationShellRegistry
- {
- public static RegistryClientSettings Settings { get; private set; }
- public static string SettingsPath { get; private set; }
-
- private static RegistryClient registryClient;
-
- private const string RegistryPath = "api/v1/registry";
- private const string SubmodelPath = "submodels";
- private const string PathSeperator = "/";
-
- private const int Timeout = 5000;
-
- private IServiceCollection services;
- private IServiceProvider serviceProvider;
-
- static RegistryClient()
- {
- SettingsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), RegistryClientSettings.FileName);
- Settings = RegistryClientSettings.LoadSettings(SettingsPath);
-
- LoadSettings(Settings);
- }
-
- public static void LoadSettings(RegistryClientSettings settings)
- {
- if (settings.ProxyConfig.UseProxy.HasValue && settings.ProxyConfig.UseProxy.Value && !string.IsNullOrEmpty(settings.ProxyConfig.ProxyAddress))
- {
- HttpClientHandler.UseProxy = true;
- if (!string.IsNullOrEmpty(settings.ProxyConfig.UserName) && !string.IsNullOrEmpty(settings.ProxyConfig.Password))
- {
- NetworkCredential credential;
- if (!string.IsNullOrEmpty(settings.ProxyConfig.Domain))
- credential = new NetworkCredential(settings.ProxyConfig.UserName, settings.ProxyConfig.Password, settings.ProxyConfig.Domain);
- else
- credential = new NetworkCredential(settings.ProxyConfig.UserName, settings.ProxyConfig.Password);
-
- HttpClientHandler.Proxy = new WebProxy(settings.ProxyConfig.ProxyAddress, false, null, credential);
- }
- else
- HttpClientHandler.Proxy = new WebProxy(settings.ProxyConfig.ProxyAddress);
- }
- else
- HttpClientHandler.UseProxy = false;
- }
-
- public static RegistryClient Instance
- {
- get
- {
- if (registryClient == null)
- registryClient = new RegistryClient();
- return registryClient;
- }
- }
-
- public RegistryClient(RegistryClientSettings registryClientSettings = null)
- {
- if (registryClientSettings != null)
- {
- Settings = registryClientSettings;
- LoadSettings(Settings);
- }
-
- JsonSerializerSettings = new JsonStandardSettings();
- }
-
- public Uri GetUri(params string[] pathElements)
- {
- string path = string.Empty;
- if (!Settings.RegistryConfig.RegistryUrl.EndsWith("/") && !RegistryPath.StartsWith("/"))
- path = Settings.RegistryConfig.RegistryUrl + PathSeperator + RegistryPath;
- else
- path = Settings.RegistryConfig.RegistryUrl + RegistryPath;
-
- if (pathElements?.Length > 0)
- foreach (var pathElement in pathElements)
- {
- if (!pathElement.EndsWith("/") && !pathElement.StartsWith("/"))
- path = path + PathSeperator + pathElement;
- else
- path = path + pathElement;
-
- //if (!path.EndsWith("/"))
- // path = path + PathSeperator;
- }
- return new Uri(path);
- }
-
- public IResult<AssetAdministrationShellDescriptor> CreateAssetAdministrationShell(AssetAdministrationShellDescriptor aas)
- {
- var request = base.CreateJsonContentRequest(GetUri(), HttpMethod.Post, aas);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<AssetAdministrationShellDescriptor>(response, response.Entity);
- }
-
- public IResult<AssetAdministrationShellDescriptor> RetrieveAssetAdministrationShell(string aasId)
- {
- var request = base.CreateRequest(GetUri(aasId), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<AssetAdministrationShellDescriptor>(response, response.Entity);
- }
-
- public IResult<List<AssetAdministrationShellDescriptor>> RetrieveAssetAdministrationShells()
- {
- var request = base.CreateRequest(GetUri(), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<List<AssetAdministrationShellDescriptor>>(response, response.Entity);
- }
-
- public IResult UpdateAssetAdministrationShell(string aasId, Dictionary<string, string> metaData)
- {
- var request = base.CreateRequest(GetUri(aasId), HttpMethod.Put);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult DeleteAssetAdministrationShell(string aasId)
- {
- var request = base.CreateRequest(GetUri(aasId), HttpMethod.Delete);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse(response, response.Entity);
- }
-
- public IResult<SubmodelDescriptor> CreateSubmodel(string aasId, SubmodelDescriptor submodel)
- {
- var request = base.CreateJsonContentRequest(GetUri(aasId, SubmodelPath), HttpMethod.Post, submodel);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<SubmodelDescriptor>(response, response.Entity);
- }
-
- public IResult<List<SubmodelDescriptor>> RetrieveSubmodels(string aasId)
- {
- var request = base.CreateRequest(GetUri(aasId, SubmodelPath), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<List<SubmodelDescriptor>>(response, response.Entity);
- }
-
- public IResult<SubmodelDescriptor> RetrieveSubmodel(string aasId, string submodelId)
- {
- var request = base.CreateRequest(GetUri(aasId, SubmodelPath, submodelId), HttpMethod.Get);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse<SubmodelDescriptor>(response, response.Entity);
- }
-
- public IResult DeleteSubmodel(string aasId, string submodelId)
- {
- var request = base.CreateRequest(GetUri(aasId, SubmodelPath, submodelId), HttpMethod.Delete);
- var response = base.SendRequest(request, Timeout);
- return base.EvaluateResponse(response, response.Entity);
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.cs b/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.cs
deleted file mode 100644
index aa172f9..0000000
--- a/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using BaSys40.Utils.Settings;
-using System;
-using System.Xml.Serialization;
-
-namespace BaSys40.Registry.Client
-{
- public class RegistryClientSettings : Settings<RegistryClientSettings>
- {
- public RegistryConfiguration RegistryConfig { get; set; } = new RegistryConfiguration();
-
- public CatalogConfiguration CatalogConfig { get; set; } = new CatalogConfiguration();
-
- public SecurityConfiguration SecurityConfig { get; set; } = new SecurityConfiguration();
-
-
- [Serializable]
- public class RegistryConfiguration
- {
- [XmlElement]
- public string RegistryUrl { get; set; }
- }
- [Serializable]
- public class CatalogConfiguration
- {
- [XmlElement]
- public string CatalogUrl { get; set; }
- [XmlElement]
- public string PrivateToken { get; set; }
- [XmlElement]
- public string NamespaceId { get; set; }
- }
- [Serializable]
- public class SecurityConfiguration
- {
- [XmlElement]
- public string KeyCloakUrl { get; set; }
- [XmlElement]
- public string KeyCloakClientId { get; set; }
- [XmlElement]
- public string KeyCloakClientSecret { get; set; }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.xml b/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.xml
deleted file mode 100644
index 2596f76..0000000
--- a/sdks/csnet/BaSys40.Registry.Client/RegistryClientSettings.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RegistryClientSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <RegistryConfig>
- <RegistryUrl>http://basysregistry.azurewebsites.net/</RegistryUrl>
- </RegistryConfig>
- <ProxyConfig>
- <UseProxy>false</UseProxy>
- <ProxyAddress>http://localhost:3128</ProxyAddress>
- </ProxyConfig>
-</RegistryClientSettings>
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/BaSys40.Technologies.oneM2M.csproj b/sdks/csnet/BaSys40.Technologies.oneM2M/BaSys40.Technologies.oneM2M.csproj
deleted file mode 100644
index b6070a5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/BaSys40.Technologies.oneM2M.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
- <Configurations>Debug;Release</Configurations>
- <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>Full</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="M2MqttDotnetCore" Version="1.0.8" />
- <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
- <PackageReference Include="NLog" Version="4.5.11" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\BaSys40.Utils\BaSys40.Utils.csproj" />
- </ItemGroup>
-
-
-</Project>
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/BindingConfig.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/BindingConfig.cs
deleted file mode 100644
index 1c2e3a2..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/BindingConfig.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Xml.Serialization;
-
-namespace oneM2MClient.Client.Bindings
-{
- public abstract class BindingConfig : oneM2MConfig
- {
- [XmlElement]
- public string ConfigurationPath { get; protected set; }
-
- public abstract string GenerateConfigurationPayload();
-
- public BindingConfig()
- { }
- public BindingConfig(Uri cseHostUri, string cseName = DefaultCSEName, oneM2M.CseTypeId cseType = DefaultCSEType)
- {
- CSEName = cseName;
- CSEType = cseType;
-
- if (cseHostUri != null)
- {
- CSEHost = cseHostUri.Host;
- CSEPort = cseHostUri.Port;
- Scheme = cseHostUri.Scheme;
- }
- else
- {
- CSEHost = DefaultCSEHost;
- CSEPort = DefaultCSEPort;
- Scheme = DefaultScheme;
- }
- }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpBinding.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpBinding.cs
deleted file mode 100644
index 4a0846f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpBinding.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-using BaSys40.Utils.ResultHandling;
-using System;
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace oneM2MClient.Client.Bindings
-{
- public class HttpBinding : IClient
- {
- private static HttpClient httpClient;
- private bool isAlive = false;
-
- public ClientFactory.Protocol Protocol => ClientFactory.Protocol.Http;
-
- public static void ConfigureHttpClient()
- {
- httpClient = new HttpClient(
- new HttpClientHandler
- {
- MaxConnectionsPerServer = 100,
- UseProxy = false
- });
- }
-
- public Result<Response> Send(Request request)
- {
- if (request == null)
- return new Result<Response>(new ArgumentNullException("request"));
-
- string rqi = request.GetHashCode().ToString();
- request.RequestIdentifier(rqi);
-
- HttpRequest requestHelper = new HttpRequest(request);
- requestHelper.Query.Remove(oneM2M.Name.RESOURCE_TYPE);
-
- string uri = requestHelper.RequestPath + GetQueryString(requestHelper.Query);
-
- HttpRequestMessage requestMessage = new HttpRequestMessage();
- requestMessage.RequestUri = new Uri(uri);
- requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(requestHelper.AcceptMIME));
-
- AddHeader(requestMessage.Headers, requestHelper.Header);
-
- oneM2M.Operation op = (oneM2M.Operation)requestHelper.Method;
- switch (op)
- {
- case oneM2M.Operation.CREATE:
- requestMessage.Method = HttpMethod.Post;
- requestMessage.Content = new StringContent(requestHelper.Body);
-
- var contentType = new MediaTypeHeaderValue(requestHelper.ContentMIME);
- contentType.Parameters.Add(new NameValueHeaderValue(oneM2M.Name.RESOURCE_TYPE, request.RequestPrimitive.Ty.Value.ToString()));
- requestMessage.Content.Headers.ContentType = contentType;
- break;
-
- case oneM2M.Operation.RETRIEVE:
- requestMessage.Method = HttpMethod.Get;
- break;
-
- case oneM2M.Operation.UPDATE:
- requestMessage.Method = HttpMethod.Put;
- requestMessage.Content = new StringContent(requestHelper.Body, Encoding.Default, requestHelper.ContentMIME);
- break;
-
- case oneM2M.Operation.DELETE:
- requestMessage.Method = HttpMethod.Delete;
- break;
-
- case oneM2M.Operation.NOTIFY:
- requestMessage.Method = HttpMethod.Post;
- break;
- default:
- return new Result<Response>(new InvalidOperationException("Invalid Operation: " + op));
- }
- try
- {
- var task = Task.Run(() => httpClient.SendAsync(requestMessage));
- bool success = task.Wait(request.MillisecondsTimeout);
- if (success && task.Result != null)
- {
- HttpResponse response = new HttpResponse(task.Result);
- if (response.OriginalHttpResponseMessage.IsSuccessStatusCode)
- {
- if (response.RequestIdentifier == rqi)
- return new Result<Response>(true, response);
- else
- return new Result<Response>(false, response, new Message(MessageType.Error, "Response-Id: '" + response.RequestIdentifier + "' does not match Request-Id: '" + rqi + "'"));
- }
- else
- {
- StringBuilder errorMsg = new StringBuilder();
- errorMsg.Append("Http-Response: " + (int)response.OriginalHttpResponseMessage.StatusCode + " - " + response.OriginalHttpResponseMessage.ReasonPhrase + " || ");
- errorMsg.Append("oneM2M-Response: ").Append(response.ResponseStatusCode + " - ").Append(response.ErrorMessage + " ").Append(response.ResponseBody);
- return new Result<Response>(false, response, new Message(MessageType.Error, errorMsg.ToString(), ((int)response.OriginalHttpResponseMessage.StatusCode).ToString()));
- }
- }
- else
- return new Result<Response>(false, new Message(MessageType.Error, "Error getting response from host", ((int)HttpStatusCode.BadGateway).ToString()));
- }
- catch (Exception e)
- {
- string msg = e.Message + ((e.InnerException != null) ? " - InnerException: " + e.InnerException.Message : string.Empty);
- return new Result<Response>(false, new Message(MessageType.Error, msg, ((int)HttpStatusCode.InternalServerError).ToString()));
- }
- }
-
- protected void AddHeader(HttpRequestHeaders headers, Dictionary<string, List<string>> dic)
- {
- foreach (var entry in dic)
- {
- string key = HttpMapping.Header.map(entry.Key);
- string value = HttpRequest.ConcatQuery(entry.Value);
- headers.Add(key, value);
- }
- }
-
- private string GetQueryString(Dictionary<string, List<string>> dic)
- {
- if (dic != null && dic.Count > 0)
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("?");
- int count = 1;
- foreach (var entry in dic)
- {
- string key = entry.Key;
- string value = HttpRequest.ConcatQuery(entry.Value);
- sb.Append(key + "=" + value);
- if (count != dic.Count)
- sb.Append("&");
- count++;
- }
- return sb.ToString();
- }
- else
- return string.Empty;
- }
-
- public void Start()
- {
- ConfigureHttpClient();
- isAlive = true;
- }
-
- public void Stop()
- {
- httpClient.Dispose();
- isAlive = false;
- }
-
- public bool IsAlive
- {
- get
- {
- return isAlive;
- }
- }
-
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpMapping.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpMapping.cs
deleted file mode 100644
index 1a4efb4..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpMapping.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using System.Collections.Generic;
-using static oneM2MClient.oneM2M;
-
-namespace oneM2MClient.Client.Bindings
-{
- public static class HttpMapping
- {
- public static readonly String NAME = "http";
-
- public static class MIME //hier war ein extends von OneM2M.MIME
- {
- public static readonly String APPLICATION_XML = "application/xml";
- public static readonly String APPLICATION_JSON = "application/json";
- }
-
- public static class Header
- {
- public static readonly String HOST = "host";
- public static readonly String ACCEPT = "accept";
- public static readonly String CONTENT_TYPE = "content-type";
- public static readonly String CONTENT_LOCATION = "content-location";
- public static readonly String CONTENT_LENGTH = "content-length";
- public static readonly String ETAG = "etag";
- public static readonly String X_M2M_ORIGIN = "X-M2M-Origin";
- public static readonly String X_M2M_RI = "X-M2M-RI";
- public static readonly String X_M2M_NM = "X-M2M-NM";
- public static readonly String X_M2M_GID = "X-M2M-GID";
- public static readonly String X_M2M_RTU = "X-M2M-RTU";
- public static readonly String X_M2M_OT = "X-M2M-OT";
- public static readonly String X_M2M_RST = "X-M2M-RST";
- public static readonly String X_M2M_RET = "X-M2M-RET";
- public static readonly String X_M2M_OET = "X-M2M-OET";
- public static readonly String X_M2M_EC = "X-M2M-EC";
- public static readonly String X_M2M_RSC = "X-M2M-RSC";
-
- private static Dictionary<String, String> _map = new Dictionary<string, string>();
-
- static Header()
- {
- _map.Add(Name.FROM, X_M2M_ORIGIN);
- _map.Add(Name.REQUEST_IDENTIFIER, X_M2M_RI);
- _map.Add(Name.NAME, X_M2M_NM);
- _map.Add(Name.ORIGINATING_TIMESTAMP, X_M2M_OT);
- _map.Add(Name.REQUEST_EXPIRATION_TIMESTAMP, X_M2M_RET);
- _map.Add(Name.RESULT_EXPIRATION_TIMESTAMP, X_M2M_RST);
- _map.Add(Name.OPERATION_EXECUTION_TIME, X_M2M_OET);
- _map.Add(Name.RESPONSE_TYPE_VALUE, X_M2M_RTU);
- _map.Add(Name.EVENT_CATEGORY, X_M2M_EC);
- _map.Add(Name.RESPONSE_STATUS_CODE, X_M2M_RSC);
- _map.Add(Name.GROUP_REQUEST_IDENTIFIER, X_M2M_GID);
- }
-
- public static String map(String name)
- {
- return _map.ContainsKey(name) ? _map[name] : name;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpRequest.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpRequest.cs
deleted file mode 100644
index 754e9df..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpRequest.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using oneM2MClient.Protocols;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Text;
-using oneM2MClient.Utils;
-
-namespace oneM2MClient.Client
-{
- public class HttpRequest : Request
- {
- public string Body { get; private set; }
- public int Method { get; private set; }
- public Dictionary<string, List<string>> Query { get; } = new Dictionary<string, List<string>>();
- public Dictionary<string, List<string>> Header { get; } = new Dictionary<string, List<string>>();
-
- public HttpRequest(Request request)
- {
- this.RequestPrimitive = request.RequestPrimitive;
- this.CSEName = request.CSEName;
- this.ContentMIME = request.ContentMIME;
- this.AcceptMIME = request.AcceptMIME;
- this.EndpointAddress = request.EndpointAddress;
- this.MillisecondsTimeout = request.MillisecondsTimeout;
- this.RequestPath = request.RequestPath;
-
- Method = (int)RequestPrimitive.Op;
-
- AdaptQuery(RequestPrimitive);
- AdaptHeader(RequestPrimitive);
- AdaptBody(RequestPrimitive);
- }
-
- public HttpRequest(string clientId, string endpointAddress, string cseName, oneM2M.Operation operation, oneM2M.ResourceType resourceType, string path)
- : base(clientId, endpointAddress, cseName, operation, resourceType, path) { }
-
- public HttpRequest(string clientId, string endpointAddress, string cseName, string path)
- : base (clientId, endpointAddress, cseName, path) { }
-
- public static string ConcatQuery(List<string> list)
- {
- StringBuilder sb = new StringBuilder();
- bool firstStr = true;
- foreach (string str in list)
- {
- if (str != null)
- {
- if(!firstStr)
- sb.Append("+");
- sb.Append(str);
- firstStr = false;
- }
- }
- return sb.Length > 0 ? sb.ToString() : "";
- }
-
- private void AdaptQuery(rqp requestPrimitive)
- {
- if (requestPrimitive.Rt != null)
- Add(Query, oneM2M.Name.RESPONSE_TYPE_VALUE, requestPrimitive.Rt.Rtv);
-
- Add(Query, oneM2M.Name.RESOURCE_TYPE, requestPrimitive.Ty);
- Add(Query, oneM2M.Name.RESULT_PERSISTENCE, requestPrimitive.Rp);
- Add(Query, oneM2M.Name.RESULT_CONTENT, requestPrimitive.Rcn);
- Add(Query, oneM2M.Name.DELIVERY_AGGREGATION, requestPrimitive.Drt);
-
- if (requestPrimitive.Fc != null)
- {
- filterCriteria fc = requestPrimitive.Fc;
- Add(Query, oneM2M.Name.CREATED_BEFORE, fc.Crb);
- Add(Query, oneM2M.Name.CREATED_AFTER, fc.Cra);
- Add(Query, oneM2M.Name.MODIFIED_SINCE, fc.Ms);
- Add(Query, oneM2M.Name.UNMODIFIED_SINCE, fc.Us);
- Add(Query, oneM2M.Name.STATE_TAG_SMALLER, fc.Sts);
- Add(Query, oneM2M.Name.STATE_TAG_BIGGER, fc.Stb);
- Add(Query, oneM2M.Name.EXPIRE_BEFORE, fc.Exb);
- Add(Query, oneM2M.Name.EXPIRE_AFTER, fc.Exa);
-
- foreach (string value in fc.Lbl)
- {
- Add(Query, oneM2M.Name.LABELS, value);
- }
-
- Add(Query, oneM2M.Name.RESOURCE_TYPE, fc.Ty);
- Add(Query, oneM2M.Name.SIZE_ABOVE, fc.Sza);
- Add(Query, oneM2M.Name.SIZE_BELOW, fc.Szb);
-
- foreach (string value in fc.Cty)
- {
- Add(Query, oneM2M.Name.CONTENT_TYPE, value);
- }
-
- Add(Query, oneM2M.Name.LIMIT, fc.Lim);
-
- if (fc.Atr != null)
- {
- foreach (attribute attribute in fc.Atr)
- {
- Add(Query, attribute.Nm, attribute.Val);
- }
- }
- Add(Query, oneM2M.Name.FILTER_USAGE, fc.Fu);
- }
- Add(Query, oneM2M.Name.DISCOVERY_RESULT_TYPE, requestPrimitive.Drt);
- }
-
- private void Add(Dictionary<string, List<string>> dic, string name, object obj)
- {
- if (obj == null)
- return;
- if (!dic.ContainsKey(name))
- dic.Add(name, new List<string>());
- dic[name].Add(obj.ToString());
- }
-
- private void AdaptHeader(rqp requestPrimitive)
- {
- Add(Header, oneM2M.Name.FROM, requestPrimitive.Fr);
- Add(Header, oneM2M.Name.REQUEST_IDENTIFIER, requestPrimitive.Rqi);
- Add(Header, oneM2M.Name.GROUP_ID, requestPrimitive.Gid);
-
- if (requestPrimitive.Rt != null)
- {
- responseTypeInfo rti = requestPrimitive.Rt;
- if (rti.Nu.Count != 0)
- {
- StringBuilder sb = new StringBuilder();
- bool firstStr = true;
- foreach (string ss in rti.Nu)
- {
- if (!firstStr)
- sb.Append("&");
-
- firstStr = false;
- sb.Append(ss);
- }
- Add(Header, oneM2M.Name.RESPONSE_TYPE_VALUE, sb.ToString());
- }
- }
-
- Add(Header, oneM2M.Name.ORIGINATING_TIMESTAMP, requestPrimitive.Ot);
- Add(Header, oneM2M.Name.RESULT_EXPIRATION_TIMESTAMP, requestPrimitive.Rset);
- Add(Header, oneM2M.Name.REQUEST_EXPIRATION_TIMESTAMP, requestPrimitive.Rqet);
- Add(Header, oneM2M.Name.OPERATION_EXECUTION_TIME, requestPrimitive.Oet);
- Add(Header, oneM2M.Name.EVENT_CATEGORY, requestPrimitive.Ec);
- }
-
- private void AdaptBody(rqp requestPrimitive)
- {
- Body = JsonConvert.SerializeObject(requestPrimitive.Pc, Formatting.Indented, new PrimitiveContentJsonSerializer());
- }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpResponse.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpResponse.cs
deleted file mode 100644
index 5466461..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Http/HttpResponse.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using oneM2MClient.Protocols;
-using System.Linq;
-using System.Net.Http;
-
-namespace oneM2MClient.Client
-{
- public class HttpResponse : Response
- {
- public HttpResponseMessage OriginalHttpResponseMessage { get; }
- public HttpResponse(oneM2M.ResponseStatusCodes responseStatusCode, string requestIdentifier, primitiveContent primitiveContent, string to, string from, oneM2M.Time originatingTimestamp, oneM2M.Time resultExpirationTimestamp, oneM2M.StdEventCats eventCategory, string responseBody)
- : base(responseStatusCode, requestIdentifier, primitiveContent, to, from, originatingTimestamp, resultExpirationTimestamp, eventCategory, responseBody) { }
-
- public HttpResponse(HttpResponseMessage respMessage)
- {
- if (respMessage == null)
- return;
- else
- OriginalHttpResponseMessage = respMessage;
-
- var headers = respMessage.Headers;
- foreach (var header in respMessage.Headers)
- {
- switch (header.Key)
- {
- case "X-M2M-RSC":
- ResponseStatusCode = (oneM2M.ResponseStatusCodes)int.Parse(header.Value.FirstOrDefault());
- break;
- case "X-M2M-RI":
- RequestIdentifier = header.Value.FirstOrDefault();
- break;
- case "X-M2M-ORIGIN":
- From = header.Value.FirstOrDefault();
- break;
- case "X-M2M-OT":
- OriginatingTimestamp = new oneM2M.Time(header.Value.FirstOrDefault());
- break;
- case "X-M2M-RST":
- ResultExpirationTimestamp = new oneM2M.Time(header.Value.FirstOrDefault());
- break;
- case "X-M2M-EC":
- EventCategory = (oneM2M.StdEventCats)int.Parse(header.Value.FirstOrDefault());
- break;
- default:
- continue;
- }
- }
-
- ResponseBody = respMessage.Content.ReadAsStringAsync().Result;
-
- if (!string.IsNullOrEmpty(ResponseBody) && (int)ResponseStatusCode < 4000)
- {
- PrimitiveContent = ExtractPrimitiveContent(ResponseBody);
- }
- }
- }
-
-}
-
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBinding.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBinding.cs
deleted file mode 100644
index 3edbc6b..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBinding.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-using System;
-using System.Text;
-using BaSys40.Utils.ResultHandling;
-using uPLibrary.Networking.M2Mqtt;
-using uPLibrary.Networking.M2Mqtt.Messages;
-using System.Threading;
-using NLog;
-
-namespace oneM2MClient.Client.Bindings
-{
- public class MqttBinding : IClient
- {
- public const string requestTopic = "/oneM2M/req";
- public const string responseTopic = "/oneM2M/resp";
-
- private bool subscribedFlag = false;
-
- public ClientFactory.Protocol Protocol => ClientFactory.Protocol.Mqtt;
-
- public string PayLoad { get; set; }
-
- private ManualResetEvent manualResetEvent;
- private ManualResetEvent connectionClosed;
- private MqttResponse response;
- private string tempRqi;
-
- private MqttClient mqttClient;
-
- private string clientId;
-
- private MqttBindingConfig mqttConfig;
-
-
- private static Logger logger = LogManager.GetCurrentClassLogger();
-
- public MqttBinding(string clientId, BindingConfig mqttConfig)
- {
- this.clientId = clientId;
- if (mqttConfig != null)
- this.mqttConfig = mqttConfig as MqttBindingConfig;
- else
- this.mqttConfig = new MqttBindingConfig("MqttProviderDefault");
-
- mqttClient = new MqttClient(this.mqttConfig.BrokerIPAddress, this.mqttConfig.BrokerPort, this.mqttConfig.SecureConnection, null, null, MqttSslProtocols.None, null, null);
- }
-
- public bool IsAlive
- {
- get
- {
- if (mqttClient != null)
- return mqttClient.IsConnected;
- else
- return false;
- }
- }
-
-
- public Result<Response> Send(Request request)
- {
- if (request == null && request.RequestPrimitive != null)
- return null;
-
- tempRqi = request.GetHashCode().ToString();
- request.RequestIdentifier(tempRqi);
-
- MqttRequest requestHelper = new MqttRequest(request);
-
- string sMessage = requestHelper.MessageBody.ToString();
- byte[] bMessage = Encoding.UTF8.GetBytes(sMessage);
-
- mqttClient.MqttMsgPublished -= MqttClient_MqttMsgPublished;
- mqttClient.MqttMsgPublished += MqttClient_MqttMsgPublished;
-
- ushort msgIdPub = mqttClient.Publish(requestHelper.RequestTopic, bMessage, MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, false);
- if (!subscribedFlag)
- {
- mqttClient.MqttMsgSubscribed += MqttClient_MqttMsgSubscribed;
- string subTopic = string.Join("/", responseTopic, requestHelper.RequestPrimitive.Fr, requestHelper.CSEName, requestHelper.ContentMIME);
- ushort msgIdSub = mqttClient.Subscribe(new string[] { subTopic }, new byte[] { MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE });
- mqttClient.MqttMsgPublishReceived += MqttClient_MqttMsgPublishReceived;
- subscribedFlag = true;
- }
- manualResetEvent = new ManualResetEvent(false);
- bool success = manualResetEvent.WaitOne(2000);
- if(success && response != null && response.RequestIdentifier == tempRqi)
- {
- var clonedResponse = response.Clone();
- response = null;
- bool error = !string.IsNullOrEmpty(clonedResponse.ErrorMessage) ? true : false;
-
- if(error)
- return new Result<Response>(false, clonedResponse, new Message(MessageType.Error, clonedResponse.ErrorMessage));
- else
- return new Result<Response>(true, clonedResponse);
- }
- else if (response != null && response.RequestIdentifier != tempRqi)
- {
- var clonedResponse = response.Clone();
- response = null;
- return new Result<Response>(false, clonedResponse, new Message(MessageType.Error, "Response-Id: '" + clonedResponse.RequestIdentifier+"' does not match Request-Id: '"+ tempRqi + "'"));
- }
- else
- {
- return new Result<Response>(false, new Message(MessageType.Error, "Error getting response from host, response is null"));
- }
- }
-
- private void MqttClient_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e)
- {
- Console.Out.WriteLine("Received = " + Encoding.UTF8.GetString(e.Message) + " on topic " + e.Topic);
- response = new MqttResponse(e);
- if(response.RequestIdentifier == tempRqi)
- manualResetEvent.Set();
- }
-
- private void MqttClient_MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e)
- {
- Console.Out.WriteLine("Subscribed for id = " + e.MessageId);
- }
-
- private void MqttClient_MqttMsgPublished(object sender, MqttMsgPublishedEventArgs e)
- {
- Console.Out.WriteLine("MessageId = " + e.MessageId + " Published = " + e.IsPublished);
- }
-
- public void Start()
- {
- clientId = clientId ?? Guid.NewGuid().ToString();
-
- try
- {
- byte success = mqttClient.Connect(clientId);
- if (success != 0)
- throw new Exception("Could not connect to MQTT-Broker");
- }
- catch (Exception e)
- {
- logger.Error(e, "Could not connect MQTT-Broker");
- }
- }
-
- public void Stop()
- {
- if (mqttClient != null)
- {
- if (mqttClient.IsConnected)
- {
- connectionClosed = new ManualResetEvent(false);
- mqttClient.ConnectionClosed += MqttClient_ConnectionClosed;
-
- mqttClient.Disconnect();
-
- bool success = connectionClosed.WaitOne(1000);
-
- if (!success)
- logger.Error("Could not close MQTT-Client");
-
- }
- mqttClient = null;
- }
- }
-
- private void MqttClient_ConnectionClosed(object sender, EventArgs e)
- {
- connectionClosed.Set();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBindingConfig.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBindingConfig.cs
deleted file mode 100644
index bca1f09..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttBindingConfig.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using Newtonsoft.Json.Linq;
-using System.Xml.Serialization;
-using oneM2MClient.Utils;
-
-namespace oneM2MClient.Client.Bindings
-{
- [Serializable]
- public class MqttBindingConfig : BindingConfig
- {
- [XmlElement]
- public string MqttProviderInstanceName { get; private set; }
- [XmlElement]
- public string BrokerIPAddress { get; private set; }
- [XmlElement]
- public int BrokerPort { get; private set; }
- [XmlElement]
- public string SecurityLevel { get; private set; }
- [XmlElement]
- public bool SecureConnection { get; private set; }
- [XmlElement]
- public string UserName { get; private set; }
- [XmlElement]
- public string Password { get; private set; }
-
-
- public const string DefaultSecurityLevel = "l0";
- public const string DefaultBrokerInstanceName = "MqttProviderDefault";
- public const string DefaultBrokerIPAddress = "127.0.0.1";
- public const int DefaultBrokerPort = 1883;
- public new const string DefaultScheme = "mqtt";
-
- public MqttBindingConfig(Uri brokerUri, string brokerInstanceName = DefaultBrokerInstanceName, string securityLevel = DefaultSecurityLevel)
- {
- if(brokerUri != null)
- {
- BrokerIPAddress = brokerUri.Host;
- BrokerPort = brokerUri.Port;
- if (!string.IsNullOrEmpty(brokerUri.Scheme))
- {
- SecureConnection = brokerUri.Scheme.Contains("mqtts") ? true : false;
- Scheme = brokerUri.Scheme;
- }
- if (!string.IsNullOrEmpty(brokerUri.UserInfo) && brokerUri.UserInfo.Contains(":"))
- {
- string[] account = brokerUri.UserInfo.Split(':');
- UserName = account[0];
- Password = account[1];
- }
-
- MqttProviderInstanceName = brokerInstanceName;
- SecurityLevel = securityLevel;
- ConfigurationPath = "restconf/config/onem2m-protocol-mqtt:onem2m-protocol-mqtt-providers/" + MqttProviderInstanceName + "/mqtt-client-config";
- }
- else
- throw new Exception("Could not load MqttConfig");
- }
-
- public MqttBindingConfig(string brokerInstanceName = DefaultBrokerInstanceName)
- : this(Helper.ConcatUrl(DefaultScheme, DefaultBrokerIPAddress, DefaultBrokerPort, null), brokerInstanceName)
- { }
-
- public override string GenerateConfigurationPayload()
- {
- JObject config = new JObject();
-
- JObject clientConfig = new JObject();
- clientConfig.Add("onem2m-protocol-mqtt:mqtt-broker-port", BrokerPort);
- clientConfig.Add("onem2m-protocol-mqtt:mqtt-broker-ip", BrokerIPAddress);
- clientConfig.Add("onem2m-protocol-mqtt:security-level", SecurityLevel);
-
- config.Add("onem2m-protocol-mqtt:mqtt-client-config", clientConfig);
-
- return config.ToString();
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttRequest.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttRequest.cs
deleted file mode 100644
index ffce5ee..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttRequest.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using oneM2MClient.Client.Bindings;
-using oneM2MClient.Protocols;
-using oneM2MClient.Utils;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace oneM2MClient.Client
-{
- public class MqttRequest : Request
- {
- public string RequestTopic { get; private set; }
- public JObject MessageBody { get; private set; }
-
- public MqttRequest(string clientId, string endpointAddress, string cseName, oneM2M.Operation operation, oneM2M.ResourceType resourceType, string path)
- : base(clientId, endpointAddress, cseName, operation, resourceType, path)
- {
- ContentMIME = "json";
- EndpointAddress = endpointAddress;
- RequestTopic = string.Join("/", MqttBinding.requestTopic, RequestPrimitive.Fr, CSEName, ContentMIME);
- }
-
- public MqttRequest(string clientId, string endpointAddress, string cseName, string path)
- : this (clientId, endpointAddress, cseName, oneM2M.Operation.NOOPERATION, oneM2M.ResourceType.NoResource, path) { }
-
- public MqttRequest(Request request)
- {
- this.RequestPrimitive = request.RequestPrimitive;
- this.CSEName = request.CSEName;
- this.ContentMIME = "json";
- this.AcceptMIME = "json";
- this.EndpointAddress = request.EndpointAddress;
- this.MillisecondsTimeout = request.MillisecondsTimeout;
- this.RequestPath = request.RequestPath;
- this.RequestTopic = string.Join("/", MqttBinding.requestTopic, RequestPrimitive.Fr, CSEName, ContentMIME);
-
-
- MessageBody = new JObject();
- MessageBody.Add(oneM2M.Name.OPERATION, RequestPrimitive.Op.ToString());
- MessageBody.Add(oneM2M.Name.TO, RequestPrimitive.To);
- MessageBody.Add(oneM2M.Name.FROM, RequestPrimitive.Fr);
- MessageBody.Add(oneM2M.Name.REQUEST_IDENTIFIER, RequestPrimitive.Rqi);
-
- if (RequestPrimitive.Op == (int)oneM2M.Operation.CREATE)
- MessageBody.Add(oneM2M.Name.RESOURCE_TYPE, RequestPrimitive.Ty);
-
- if (RequestPrimitive.Pc != null && RequestPrimitive.Pc.Items.Count > 0)
- {
- string pcPayLoad = JsonConvert.SerializeObject(RequestPrimitive.Pc, Formatting.Indented, new PrimitiveContentJsonSerializer());
- MessageBody.Add(oneM2M.Name.PRIMITIVE_CONTENT, JObject.Parse(pcPayLoad));
- }
-
- checkRequestPrimitiveForMoreProps();
- }
-
- private void checkRequestPrimitiveForMoreProps()
- {
- var props = typeof(rqp).GetProperties();
- foreach (var prop in props)
- {
- var value = prop.GetValue(this.RequestPrimitive);
- if (value != null)
- {
- switch (prop.Name.ToLower())
- {
- case oneM2M.Name.FILTER_CRITERIA:
- {
- if((value as filterCriteria).Fu != null)
- MessageBody.Add(oneM2M.Name.FILTER_USAGE, (value as filterCriteria).Fu);
- }
- break;
- default:
- break;
- }
- }
-
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttResponse.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttResponse.cs
deleted file mode 100644
index e3f533f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/Mqtt/MqttResponse.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using oneM2MClient.Protocols;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using uPLibrary.Networking.M2Mqtt.Messages;
-
-namespace oneM2MClient.Client
-{
- public class MqttResponse : Response
- {
- public string ResponseTopic { get; private set; }
-
- private MqttResponse()
- { }
- public MqttResponse(oneM2M.ResponseStatusCodes responseStatusCode, string requestIdentifier, primitiveContent primitiveContent, string to, string from, oneM2M.Time originatingTimestamp, oneM2M.Time resultExpirationTimestamp, oneM2M.StdEventCats eventCategory, string responseBody)
- : base(responseStatusCode, requestIdentifier, primitiveContent, to, from, originatingTimestamp, resultExpirationTimestamp, eventCategory, responseBody) { }
-
- public MqttResponse(MqttMsgPublishEventArgs respMessage)
- {
- if (respMessage == null)
- return;
-
- ResponseBody = Encoding.UTF8.GetString(respMessage.Message);
-
- ResponseTopic = respMessage.Topic;
- string[] topicElements = ResponseTopic.Split('/');
-
- if(topicElements != null && topicElements.Length == 6)
- {
- From = topicElements[4];
- To = topicElements[3];
- }
-
- JObject responseJson;
- try
- {
- responseJson = JObject.Parse(ResponseBody);
- }
- catch { responseJson = null; }
-
- if (responseJson != null)
- {
- foreach (var child in responseJson.Children())
- {
- if (child is JProperty)
- {
- JProperty jProp = child as JProperty;
- switch (jProp.Name)
- {
- case oneM2M.Name.REQUEST_IDENTIFIER:
- RequestIdentifier = jProp.Value.ToString();
- break;
- case oneM2M.Name.RESPONSE_STATUS_CODE:
- ResponseStatusCode = (oneM2M.ResponseStatusCodes)int.Parse(jProp.Value.ToString());
- break;
- case oneM2M.Name.PRIMITIVE_CONTENT:
- PrimitiveContent = ExtractPrimitiveContent(jProp);
- break;
- default:
- break;
- }
- }
- }
- }
- }
-
- public MqttResponse Clone()
- {
- return new MqttResponse {
- From = this.From,
- To = this.To,
- ResponseBody = this.ResponseBody,
- ErrorMessage = this.ErrorMessage,
- RequestIdentifier = this.RequestIdentifier,
- ResponseStatusCode = this.ResponseStatusCode,
- EventCategory = this.EventCategory,
- OriginatingTimestamp = this.OriginatingTimestamp,
- PrimitiveContent = this.PrimitiveContent,
- ResultExpirationTimestamp = this.ResultExpirationTimestamp
- };
- }
-
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/oneM2MConfig.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/oneM2MConfig.cs
deleted file mode 100644
index bb258c0..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Bindings/oneM2MConfig.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace oneM2MClient.Client.Bindings
-{
- public abstract class oneM2MConfig
- {
- public string CSEHost { get; protected set; }
- public int CSEPort { get; protected set; }
- public string CSEName { get; protected set; }
- public oneM2M.CseTypeId CSEType { get; protected set; }
- public string Scheme { get; protected set; }
-
- public const string DefaultCSEName = "InCSE1";
- public const oneM2M.CseTypeId DefaultCSEType = oneM2M.CseTypeId.IN_CSE;
- public const string DefaultCSEHost = "localhost";
- public const int DefaultCSEPort = 8181;
- public const string DefaultScheme = "http";
-
- private static HttpClient httpClient;
-
- public static async Task<HttpResponseMessage> Send(Uri url, HttpMethod method, String payload, String username, String password, Dictionary<string, string> headers)
- {
- try
- {
- HttpRequestMessage request = new HttpRequestMessage();
- request.RequestUri = url;
- request.Method = method;
- if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
- {
- String authString = username + ":" + password;
- request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String((new ASCIIEncoding()).GetBytes(authString)));
- }
-
- if (headers != null)
- {
- foreach (var item in headers)
- {
- request.Headers.TryAddWithoutValidation(item.Key, item.Value);
- }
- }
-
- if (!string.IsNullOrEmpty(payload))
- request.Content = new StringContent(payload, Encoding.UTF8, HttpMapping.MIME.APPLICATION_JSON);
-
- if (httpClient == null)
- {
- httpClient = new HttpClient();
- httpClient.DefaultRequestHeaders.Accept.Clear();
- httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(HttpMapping.MIME.APPLICATION_JSON));
- }
-
- HttpResponseMessage response = await httpClient.SendAsync(request);
-
- return (response);
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- return (null);
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IClient.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IClient.cs
deleted file mode 100644
index 4dbbeb2..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IClient.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using BaSys40.Utils.ResultHandling;
-
-namespace oneM2MClient.Client
-{
- public interface IClient
- {
- bool IsAlive { get; }
-
- ClientFactory.Protocol Protocol { get; }
-
- void Start();
-
- void Stop();
-
- Result<Response> Send(Request request);
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IRequest.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IRequest.cs
deleted file mode 100644
index 423f090..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/IRequest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using oneM2MClient.Protocols;
-using System;
-
-namespace oneM2MClient.Client
-{
- public interface IRequest
- {
- rqp RequestPrimitive { get; set; }
- string ContentMIME { get; set; }
- string AcceptMIME { get; set; }
- int MillisecondsTimeout { get; set;}
-
- string CSEName { get; set; }
- string EndpointAddress { get; set; }
-
- Uri RequestPath { get; set; }
-
- Request ClearRequest();
- }
-}
\ No newline at end of file
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Request.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Request.cs
deleted file mode 100644
index 9e52446..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Request.cs
+++ /dev/null
@@ -1,304 +0,0 @@
-using oneM2MClient.Protocols;
-using System;
-using System.Collections.Generic;
-
-namespace oneM2MClient.Client
-{
- public abstract class Request : IRequest
- {
- public rqp RequestPrimitive { get; set; } = new rqp();
- public string ContentMIME { get; set; } = "application/json";
- public string AcceptMIME { get; set; } = "application/json";
- public int MillisecondsTimeout { get; set; } = 30000;
- public string EndpointAddress { get; set; } = string.Empty;
- public Uri RequestPath { get; set; }
- public string CSEName { get; set; } = string.Empty;
-
- public Request() { }
-
- public Request(string clientId, string endpointAddress, string cseName, string path)
- : this(clientId, endpointAddress, cseName, oneM2M.Operation.NOOPERATION, oneM2M.ResourceType.NoResource, path) { }
-
- public Request(string clientId, string endpointAddress, string cseName, oneM2M.Operation operation, oneM2M.ResourceType resourceType, string path)
- {
- if (!string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(endpointAddress) && !string.IsNullOrEmpty(cseName))
- {
- RequestPrimitive.Fc = new filterCriteria();
- RequestPrimitive.Rt = new responseTypeInfo();
- RequestPrimitive.Pc = new primitiveContent();
-
- RequestPrimitive.Fr = clientId;
-
- path = path.Replace("//", "/");
- RequestPrimitive.To = string.Join("/", cseName, path);
- RequestPath = new Uri(string.Join("/", endpointAddress, RequestPrimitive.To));
- EndpointAddress = endpointAddress;
- CSEName = cseName;
-
- if (operation == oneM2M.Operation.NOOPERATION)
- RequestPrimitive.Op = null;
- else
- RequestPrimitive.Op = (int)operation;
-
- if (resourceType == oneM2M.ResourceType.NoResource)
- RequestPrimitive.Ty = null;
- else
- RequestPrimitive.Ty = (int)resourceType;
- }
- else
- return;
- }
-
- public Request ClearRequest()
- {
- string sRqi;
- if (Int32.TryParse(RequestPrimitive.Rqi, out int iRqi))
- sRqi = (iRqi++).ToString();
- else
- sRqi = RequestPrimitive.Rqi;
-
- RequestPrimitive = new rqp() { Fr = RequestPrimitive.Fr, To = RequestPrimitive.To, Rqi = sRqi };
-
- return this;
- }
-
-
- public Request Operation(oneM2M.Operation operation)
- {
- RequestPrimitive.Op = (int)operation;
- return this;
- }
-
- public Request To(string to)
- {
- RequestPrimitive.To = to;
- RequestPath = new Uri(string.Join("/", EndpointAddress, RequestPrimitive.To));
- return this;
- }
-
- public Request AddPath(params string[] pathElements)
- {
- string joinedPathElements = string.Join("/", pathElements);
- RequestPrimitive.To = string.Join("/", RequestPrimitive.To, joinedPathElements).Replace("//", "/");
- RequestPath = new Uri(string.Join("/", EndpointAddress, RequestPrimitive.To));
- return this;
- }
-
- public Request SetPath(params string[] pathElements)
- {
- string joinedPathElements = string.Join("/", pathElements).Replace(CSEName, string.Empty).Replace("in-cse", string.Empty).Replace("//", "/");
- RequestPrimitive.To = string.Join("/", CSEName, joinedPathElements).Replace("//", "/").Replace("//", "/");
- RequestPath = new Uri(string.Join("/", EndpointAddress, RequestPrimitive.To));
- return this;
- }
-
- public Request SetResourcePath(string resourceId)
- {
- RequestPrimitive.To = resourceId;
- RequestPath = new Uri(string.Join("/", EndpointAddress, RequestPrimitive.To));
- return this;
- }
-
- public Request SetRequestPath(Uri requestPath)
- {
- RequestPrimitive.To = requestPath.AbsolutePath;
- RequestPath = requestPath;
- return this;
- }
-
- public Request From(string from)
- {
- RequestPrimitive.Fr = from;
- return this;
- }
-
- public Request RequestIdentifier(string requestIdentifier)
- {
- RequestPrimitive.Rqi = requestIdentifier;
- return this;
- }
-
- public Request ResourceType(oneM2M.ResourceType resourceType)
- {
- RequestPrimitive.Ty = (int)resourceType;
- return this;
- }
-
- public Request AddPrimitiveContent(object obj)
- {
- RequestPrimitive.Pc.Items.Add(obj);
- return this;
- }
-
- public Request PrimitiveContent(primitiveContent primitiveContent)
- {
- RequestPrimitive.Pc = primitiveContent;
- return this;
- }
-
- public Request OriginatingTimestamp(oneM2M.Time originatingTimestamp)
- {
- RequestPrimitive.Ot = originatingTimestamp.ToString();
- return this;
- }
-
- public Request RequestExpirationTimestamp(oneM2M.Time requestExpirationTimestamp)
- {
- RequestPrimitive.Rqet = requestExpirationTimestamp.ToString();
- return this;
- }
- public Request ResultExpirationTimestamp(oneM2M.Time resultExpirationTimestamp)
- {
- RequestPrimitive.Rset = resultExpirationTimestamp.ToString();
- return this;
- }
- public Request OperationExecutionTime(oneM2M.Time operationExecutionTime)
- {
- RequestPrimitive.Oet = operationExecutionTime.ToString();
- return this;
- }
- public Request ResponseTypeValue(oneM2M.ResponseType responseTypeValue)
- {
- RequestPrimitive.Rt.Rtv = (int)responseTypeValue;
- return this;
- }
-
- public Request AddNotificationURI(string notificationURI)
- {
- RequestPrimitive.Rt.Nu.Add(notificationURI);
- return this;
- }
- public Request ResultPersistence(oneM2M.Time resultPersistence)
- {
- RequestPrimitive.Rp = resultPersistence.ToString();
- return this;
- }
-
- public Request ResultContent(oneM2M.ResultContent resultContent)
- {
- RequestPrimitive.Rcn = (int)resultContent;
- return this;
- }
-
- public Request EventCategory(oneM2M.StdEventCats eventCategory)
- {
- RequestPrimitive.Ec = eventCategory.ToString();
- return this;
- }
-
- public Request DeliveryAggregation(bool deliveryAggregation)
- {
- RequestPrimitive.Da = deliveryAggregation;
- return this;
- }
-
- public Request GroupRequestIdentifier(String groupRequestIdentifier)
- {
- RequestPrimitive.Gid = groupRequestIdentifier;
- return this;
- }
-
- public Request FilterCreatedBefore(oneM2M.Time createdBefore)
- {
- RequestPrimitive.Fc.Crb = createdBefore.ToString();
- return this;
- }
-
- public Request FilterCreatedAfter(oneM2M.Time createdAfter)
- {
- RequestPrimitive.Fc.Cra = createdAfter.ToString();
- return this;
- }
- public Request FilterModifiedSince(oneM2M.Time modifiedSince)
- {
- RequestPrimitive.Fc.Ms = modifiedSince.ToString();
- return this;
- }
-
- public Request FilterUnmodifiedSince(oneM2M.Time unmodifiedSince)
- {
- RequestPrimitive.Fc.Us = unmodifiedSince.ToString();
- return this;
- }
-
- public Request FilterStateTagSmaller(int stateTagSmaller)
- {
- RequestPrimitive.Fc.Sts = stateTagSmaller;
- return this;
- }
-
-
- public Request FilterStateTagBigger(int stateTagBigger)
- {
- RequestPrimitive.Fc.Stb = stateTagBigger;
- return this;
- }
-
- public Request FilterExpireBefore(oneM2M.Time expireBefore)
- {
- RequestPrimitive.Fc.Exb = expireBefore.ToString();
- return this;
- }
-
- public Request FilterExpireAfter(oneM2M.Time expireAfter)
- {
- RequestPrimitive.Fc.Exa = expireAfter.ToString();
- return this;
- }
-
- public Request AddFilterLabels(List<string> labels)
- {
- RequestPrimitive.Fc.Lbl = labels;
- return this;
- }
-
- public Request FilterResourceType(oneM2M.ResourceType resourceType)
- {
- RequestPrimitive.Fc.Ty = resourceType.ToString();
- return this;
- }
-
- public Request FilterSizeAbove(int sizeAbove)
- {
- RequestPrimitive.Fc.Sza = sizeAbove;
- return this;
- }
- public Request FilterSizeBelow(int sizeBelow)
- {
- RequestPrimitive.Fc.Szb = sizeBelow;
- return this;
- }
-
- public Request AddFilterContentType(string contentType)
- {
- RequestPrimitive.Fc.Cty.Add(contentType);
- return this;
- }
-
- public Request AddFilterAttribute(string name, object value)
- {
- attribute attribute = new attribute();
- attribute.Nm = name;
- attribute.Val = value;
- RequestPrimitive.Fc.Atr.Add(attribute);
- return this;
- }
- public Request FilterUsage(oneM2M.FilterUsage filterUsage)
- {
- RequestPrimitive.Fc.Fu = (int)filterUsage;
- return this;
- }
-
- public Request FilterLimit(int limit)
- {
- RequestPrimitive.Fc.Lim = limit;
- return this;
- }
-
- public Request DiscoveryResultType(oneM2M.DiscResType discoveryResultType)
- {
- RequestPrimitive.Drt = (int)discoveryResultType;
- return this;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Response.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Response.cs
deleted file mode 100644
index c67e21f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Client/Response.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using oneM2MClient.Protocols;
-using Newtonsoft.Json.Linq;
-using oneM2MClient.Utils;
-
-namespace oneM2MClient.Client
-{
- public abstract class Response
- {
- public oneM2M.ResponseStatusCodes ResponseStatusCode { get; set; }
- public primitiveContent PrimitiveContent { get; set; }
- public oneM2M.Time OriginatingTimestamp { get; set; }
- public oneM2M.Time ResultExpirationTimestamp { get; set; }
- public oneM2M.StdEventCats EventCategory { get; set; }
- public string To { get; set; }
- public string From { get; set; }
- public string RequestIdentifier { get; set; }
- public string ResponseBody { get; set; }
- public string ErrorMessage { get; set; }
-
- #region Special attributes of response primitive
- private List<string> urilField;
- public List<string> Uril {
- get
- {
- if ((this.urilField == null))
- {
- this.urilField = new List<string>();
- }
- return this.urilField;
- }
- set
- {
- this.urilField = value;
- }
- }
-
- #endregion
-
- public Response(oneM2M.ResponseStatusCodes responseStatusCode, string requestIdentifier, primitiveContent primitiveContent, string to, string from, oneM2M.Time originatingTimestamp, oneM2M.Time resultExpirationTimestamp, oneM2M.StdEventCats eventCategory, string responseBody)
- {
- this.ResponseStatusCode = responseStatusCode;
- this.RequestIdentifier = requestIdentifier;
- this.PrimitiveContent = primitiveContent;
- this.To = to;
- this.From = from;
- this.OriginatingTimestamp = originatingTimestamp;
- this.ResultExpirationTimestamp = resultExpirationTimestamp;
- this.EventCategory = eventCategory;
- this.ResponseBody = responseBody;
- }
-
- public Response()
- {
-
- }
-
- public object GetResource()
- {
- if (this.PrimitiveContent != null && this.PrimitiveContent.Items != null && this.PrimitiveContent.Items.Count > 0)
- {
- return this.PrimitiveContent.Items.FirstOrDefault();
- }
- return null;
- }
-
- public bool TryGetResource<TEntity>(out TEntity resource)
- {
- if (this.PrimitiveContent != null && this.PrimitiveContent.Items != null && this.PrimitiveContent.Items.Count > 0)
- {
- var obj = this.PrimitiveContent.Items.FirstOrDefault(r => r.GetType() == typeof(TEntity) || r.GetType().IsSubclassOf(typeof(TEntity)));
- if (obj != null)
- {
- resource = (TEntity)obj;
- return true;
- }
- }
- resource = default(TEntity);
- return false;
- }
-
- protected primitiveContent ExtractPrimitiveContent(JProperty jProp)
- {
- if (jProp != null)
- {
- string sPc = jProp.Value.ToString();
- return ExtractPrimitiveContent(sPc);
- }
- return null;
- }
-
- protected primitiveContent ExtractPrimitiveContent(string sPc)
- {
- if (sPc.TryParseJson(out JToken pcToken))
- {
- if (sPc.Contains(oneM2M.ERROR_INDICATOR))
- {
- ErrorMessage = ((pcToken as JObject).First as JProperty).Value.ToString();
- return null;
- }
- if (pcToken.Type == JTokenType.Object)
- {
- JToken root = (pcToken as JObject).Descendants().First();
- JToken first = root.First;
- string resourceTypeName = root.Path.Replace(oneM2M.NAMESPACE + oneM2M.NAMESPACE_DELIMITER, "");
- Type t = Type.GetType(oneM2M.PRIMITIVE_PACKAGE + resourceTypeName, false, true); //throwOnErrorTrue
- if (t == null)
- {
- if (!string.IsNullOrEmpty(resourceTypeName))
- {
- var prop = GetType().GetProperty(resourceTypeName.UppercaseFirst());
- if (prop != null)
- {
- var obj = first.ToObject(prop.PropertyType);
- prop.SetValue(this, obj);
- return null;
- }
- else
- {
- ErrorMessage = "Original-Content: " + sPc;
- throw new Exception("The resource could not be deserialized to property - property not found");
- }
- }
- else
- {
- ErrorMessage = "Original-Content: " + sPc;
- throw new Exception("resourceTypeName could not be identified or does not exist");
- }
- }
- else
- {
- object content = first.ToObject(t);
-
- if (content == null)
- {
- ErrorMessage = "Original-Content: " + sPc;
- throw new Exception("Failed to generate object from JSON");
- }
-
- primitiveContent pc = new primitiveContent();
- pc.Items.Add(content);
- return pc;
- }
- }
- else if (pcToken.Type == JTokenType.Array)
- {
- JArray jArr = (pcToken as JArray);
- primitiveContent pc = new primitiveContent();
- foreach (var child in jArr.Children())
- {
- string path = (child.First as JProperty).Name.Replace(oneM2M.NAMESPACE + oneM2M.NAMESPACE_DELIMITER, "");
- Type t = Type.GetType(oneM2M.PRIMITIVE_PACKAGE + path, true, true); //throwOnErrorTrue
- object content = null;
- try
- {
- content = child.First.First.ToObject(t);
- }
- catch { continue; }
-
- if (content == null)
- {
- ErrorMessage = "Original-Content: " + sPc;
- throw new Exception("Failed to generate object from JSON");
- }
- pc.Items.Add(content);
- }
- return pc;
- }
- }
- return null;
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/ClientFactory.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/ClientFactory.cs
deleted file mode 100644
index 0213473..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/ClientFactory.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using oneM2MClient.Client;
-using oneM2MClient.Client.Bindings;
-using System;
-
-namespace oneM2MClient
-{
- public static class ClientFactory
- {
- public enum Protocol
- {
- Http,
- Mqtt
- }
- public static IClient CreateClient(Protocol protocol, string clientId = null, BindingConfig config = null)
- {
- switch (protocol)
- {
- case Protocol.Http:
- return new HttpBinding();
- case Protocol.Mqtt:
- return new MqttBinding(clientId, config);
- default:
- return null;
- }
- }
-
- public static IClient CreateClient(string protocol, string clientId = null, BindingConfig config = null)
- {
- if (!string.IsNullOrEmpty(protocol))
- {
- switch (protocol.ToLower())
- {
- case "http": return CreateClient(Protocol.Http, clientId, config);
- case "mqtt": return CreateClient(Protocol.Mqtt, clientId, config);
- default:
- throw new InvalidOperationException("Protocol is not recognized: '" + protocol + "'");
- }
- }
- else
- throw new ArgumentNullException("protocol");
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType.cs
deleted file mode 100644
index fd67714..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum ItemsChoiceType {
-
- [System.Xml.Serialization.XmlEnumAttribute("##any:")]
- Item,
-
- [System.Xml.Serialization.XmlEnumAttribute("http://www.onem2m.org/xml/protocols:")]
- Item1,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType1.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType1.cs
deleted file mode 100644
index 9ba5550..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ItemsChoiceType1.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum ItemsChoiceType1 {
-
- [System.Xml.Serialization.XmlEnumAttribute(":dld")]
- dld,
-
- [System.Xml.Serialization.XmlEnumAttribute(":rbo")]
- rbo,
-
- [System.Xml.Serialization.XmlEnumAttribute(":rst")]
- rst,
-
- [System.Xml.Serialization.XmlEnumAttribute(":swin")]
- swin,
-
- [System.Xml.Serialization.XmlEnumAttribute(":swun")]
- swun,
-
- [System.Xml.Serialization.XmlEnumAttribute(":swup")]
- swup,
-
- [System.Xml.Serialization.XmlEnumAttribute(":uld")]
- uld,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlOperations.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlOperations.cs
deleted file mode 100644
index 481b8bb..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlOperations.cs
+++ /dev/null
@@ -1,202 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum accessControlOperations {
-
- [System.Xml.Serialization.XmlEnumAttribute("1")]
- Create = 1,
-
- [System.Xml.Serialization.XmlEnumAttribute("2")]
- Retrieve = 2,
-
- [System.Xml.Serialization.XmlEnumAttribute("3")]
- CreateRetrieve = 3,
-
- [System.Xml.Serialization.XmlEnumAttribute("4")]
- Update = 4,
-
- [System.Xml.Serialization.XmlEnumAttribute("5")]
- CreateUpdate = 5,
-
- [System.Xml.Serialization.XmlEnumAttribute("6")]
- RetrieveUpdate = 6,
-
- [System.Xml.Serialization.XmlEnumAttribute("7")]
- CreateRetrieveUpdate = 7,
-
- [System.Xml.Serialization.XmlEnumAttribute("8")]
- Delete = 8,
-
- [System.Xml.Serialization.XmlEnumAttribute("9")]
- CreateDelete = 9,
-
- [System.Xml.Serialization.XmlEnumAttribute("10")]
- RetrieveDelete = 10,
-
- [System.Xml.Serialization.XmlEnumAttribute("11")]
- CreateRetrieveDelete = 11,
-
- [System.Xml.Serialization.XmlEnumAttribute("12")]
- UpdateDelete = 12,
-
- [System.Xml.Serialization.XmlEnumAttribute("13")]
- CreateUpdateDelete = 13,
-
- [System.Xml.Serialization.XmlEnumAttribute("14")]
- RetrieveUpdateDelete = 14,
-
- [System.Xml.Serialization.XmlEnumAttribute("15")]
- CreateRetrieveUpdateDelete = 15,
-
- [System.Xml.Serialization.XmlEnumAttribute("16")]
- Notify = 16,
-
- [System.Xml.Serialization.XmlEnumAttribute("17")]
- CreateNotify = 17,
-
- [System.Xml.Serialization.XmlEnumAttribute("18")]
- RetrieveNotify = 18,
-
- [System.Xml.Serialization.XmlEnumAttribute("19")]
- CreateRetrieveNotify = 19,
-
- [System.Xml.Serialization.XmlEnumAttribute("20")]
- UpdateNotify = 20,
-
- [System.Xml.Serialization.XmlEnumAttribute("21")]
- CreateUpdateNotify = 21,
-
- [System.Xml.Serialization.XmlEnumAttribute("22")]
- RetrieveUpdateNotify = 22,
-
- [System.Xml.Serialization.XmlEnumAttribute("23")]
- CreateRetrieveUpdate2 = 23,
-
- [System.Xml.Serialization.XmlEnumAttribute("24")]
- DeleteNotify = 24,
-
- [System.Xml.Serialization.XmlEnumAttribute("25")]
- CreateDeleteNotify = 25,
-
- [System.Xml.Serialization.XmlEnumAttribute("26")]
- RetrieveDeleteNotify = 26,
-
- [System.Xml.Serialization.XmlEnumAttribute("27")]
- CreateRetrieveDeleteNotify = 27,
-
- [System.Xml.Serialization.XmlEnumAttribute("28")]
- UpdateDeleteNotify = 28,
-
- [System.Xml.Serialization.XmlEnumAttribute("29")]
- CreateUpdateDeleteNotify = 29,
-
- [System.Xml.Serialization.XmlEnumAttribute("30")]
- RetrieveUpdateDeleteNotify = 30,
-
- [System.Xml.Serialization.XmlEnumAttribute("31")]
- CreateRetrieveUpdateDeleteNotify = 31,
-
- [System.Xml.Serialization.XmlEnumAttribute("32")]
- Discover = 32,
-
- [System.Xml.Serialization.XmlEnumAttribute("33")]
- CreateDiscover = 33,
-
- [System.Xml.Serialization.XmlEnumAttribute("34")]
- RetrieveDiscover = 34,
-
- [System.Xml.Serialization.XmlEnumAttribute("35")]
- CreateRetrieveDiscover = 35,
-
- [System.Xml.Serialization.XmlEnumAttribute("36")]
- UpdateDiscover = 36,
-
- [System.Xml.Serialization.XmlEnumAttribute("37")]
- CreateUpdateDiscover = 37,
-
- [System.Xml.Serialization.XmlEnumAttribute("38")]
- RetrieveUpdateDiscover = 38,
-
- [System.Xml.Serialization.XmlEnumAttribute("39")]
- CreateRetrieveUpdateDiscover = 39,
-
- [System.Xml.Serialization.XmlEnumAttribute("40")]
- DeleteDiscover = 40,
-
- [System.Xml.Serialization.XmlEnumAttribute("41")]
- CreateDeleteDiscover = 41,
-
- [System.Xml.Serialization.XmlEnumAttribute("42")]
- RetrieveDeleteDiscover = 42,
-
- [System.Xml.Serialization.XmlEnumAttribute("43")]
- CreateRetrieveDeleteDiscover = 43,
-
- [System.Xml.Serialization.XmlEnumAttribute("44")]
- UpdateDeleteDiscover = 44,
-
- [System.Xml.Serialization.XmlEnumAttribute("45")]
- CreateUpdateDeleteDiscover = 45,
-
- [System.Xml.Serialization.XmlEnumAttribute("46")]
- RetrieveUpdateDeleteDiscover = 46,
-
- [System.Xml.Serialization.XmlEnumAttribute("47")]
- CreateRetrieveUpdateDeleteDiscover = 47,
-
- [System.Xml.Serialization.XmlEnumAttribute("48")]
- NotifyDiscover = 48,
-
- [System.Xml.Serialization.XmlEnumAttribute("49")]
- CreateNotifyDiscover = 49,
-
- [System.Xml.Serialization.XmlEnumAttribute("50")]
- RetrieveNotifyDiscover = 50,
-
- [System.Xml.Serialization.XmlEnumAttribute("51")]
- CreateRetrieveNotifyDiscover = 51,
-
- [System.Xml.Serialization.XmlEnumAttribute("52")]
- UpdateNotifyDiscover = 52,
-
- [System.Xml.Serialization.XmlEnumAttribute("53")]
- CreateUpdateNotifyDiscover = 53,
-
- [System.Xml.Serialization.XmlEnumAttribute("54")]
- RetrieveUpdateNotifyDiscover = 54,
-
- [System.Xml.Serialization.XmlEnumAttribute("55")]
- CreateRetrieveUpdateDiscover2 = 55,
-
- [System.Xml.Serialization.XmlEnumAttribute("56")]
- DeleteNotifyDiscover = 56,
-
- [System.Xml.Serialization.XmlEnumAttribute("57")]
- CreateDeleteNotifyDiscover = 57,
-
- [System.Xml.Serialization.XmlEnumAttribute("58")]
- RetrieveDeleteNotifyDiscover = 58,
-
- [System.Xml.Serialization.XmlEnumAttribute("59")]
- CreateRetrieveDeleteNotifyDiscover = 59,
-
- [System.Xml.Serialization.XmlEnumAttribute("60")]
- UpdateDeleteNotifyDiscover = 60,
-
- [System.Xml.Serialization.XmlEnumAttribute("61")]
- CreateUpdateDeleteNotifyDiscover = 61,
-
- [System.Xml.Serialization.XmlEnumAttribute("62")]
- RetrieveUpdateDeleteNotifyDiscover = 62,
-
- [System.Xml.Serialization.XmlEnumAttribute("63")]
- CreateRetrieveUpdateDeleteNotifyDiscover = 63,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRule.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRule.cs
deleted file mode 100644
index 661c8d5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRule.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace oneM2MClient.Protocols
-{
- using System.Collections.Generic;
- public partial class accessControlRule
- {
-
- private List<accessControlRuleAcco> accoField;
-
- private List<string> acorField;
-
- public List<string> Acor
- {
- get
- {
- if ((this.acorField == null))
- {
- this.acorField = new List<string>();
- }
- return this.acorField;
- }
- set
- {
- this.acorField = value;
- }
- }
-
- public int? Acop { get; set; }
-
- public bool? Acaf { get; set; }
-
- public List<accessControlRuleAcco> Acco
- {
- get
- {
- if ((this.accoField == null))
- {
- this.accoField = new List<accessControlRuleAcco>();
- }
- return this.accoField;
- }
- set
- {
- this.accoField = value;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAcco.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAcco.cs
deleted file mode 100644
index 7552bec..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAcco.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class accessControlRuleAcco {
-
- private List<string> actwField;
-
- private accessControlRuleAccoAcip acipField;
-
- private locationRegion aclrField;
-
- public List<string> Actw {
- get {
- if ((this.actwField == null)) {
- this.actwField = new List<string>();
- }
- return this.actwField;
- }
- set {
- this.actwField = value;
- }
- }
-
- public accessControlRuleAccoAcip Acip {
- get {
- if ((this.acipField == null)) {
- this.acipField = new accessControlRuleAccoAcip();
- }
- return this.acipField;
- }
- set {
- this.acipField = value;
- }
- }
-
- public locationRegion Aclr {
- get {
- if ((this.aclrField == null)) {
- this.aclrField = new locationRegion();
- }
- return this.aclrField;
- }
- set {
- this.aclrField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAccoAcip.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAccoAcip.cs
deleted file mode 100644
index 2462dc5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/accessControlRuleAccoAcip.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class accessControlRuleAccoAcip {
-
- public string Ipv4 {get; set;}
-
- public string Ipv6 {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acmp.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acmp.cs
deleted file mode 100644
index 919749c..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acmp.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class acmp : mgmtResource {
-
- public string Acmlk {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acp.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acp.cs
deleted file mode 100644
index 13cb416..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acp.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace oneM2MClient.Protocols
-{
- using System.Collections.Generic;
- using System.ComponentModel;
-
- public partial class acp : announceableSubordinateResource
- {
- private List<object> itemsField;
-
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public pv Pv { get; set; }
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public pv Pvs { get; set; }
-
- public List<object> Items
- {
- get
- {
- if ((this.itemsField == null))
- {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set
- {
- this.itemsField = value;
- }
- }
-
-
- }
-
- public class pv
- {
- private List<accessControlRule> acrField;
-
- public List<accessControlRule> Acr
- {
- get
- {
- if ((this.acrField == null))
- {
- this.acrField = new List<accessControlRule>();
- }
- return this.acrField;
- }
- set
- {
- this.acrField = value;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acpA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acpA.cs
deleted file mode 100644
index d6d7169..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/acpA.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class acpA : announcedSubordinateResource {
-
- private List<accessControlRule> pvField;
-
- private List<accessControlRule> pvsField;
-
- private List<object> itemsField;
-
- [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
- [System.Xml.Serialization.XmlArrayItemAttribute("acr", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
- public List<accessControlRule> Pv {
- get {
- if ((this.pvField == null)) {
- this.pvField = new List<accessControlRule>();
- }
- return this.pvField;
- }
- set {
- this.pvField = value;
- }
- }
-
- [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
- [System.Xml.Serialization.XmlArrayItemAttribute("acr", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
- public List<accessControlRule> Pvs {
- get {
- if ((this.pvsField == null)) {
- this.pvsField = new List<accessControlRule>();
- }
- return this.pvsField;
- }
- set {
- this.pvsField = value;
- }
- }
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/actionStatus.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/actionStatus.cs
deleted file mode 100644
index 247c950..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/actionStatus.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class actionStatus {
-
- public string Ac {get; set;}
-
- public System.Nullable<int> Sus {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> SusSpecified {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ae.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ae.cs
deleted file mode 100644
index fa95c32..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ae.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
- using System;
- using System.Diagnostics;
- using System.Xml.Serialization;
- using System.Collections;
- using System.Xml.Schema;
- using System.ComponentModel;
- using System.Xml;
- using System.Collections.Generic;
- public partial class ae : announceableResource
- {
-
- public string Apn { get; set; }
-
- public string Api { get; set; }
-
- public string Aei { get; set; }
-
- public string Poa { get; set; }
-
- public string Or { get; set; }
-
- public string Nl { get; set; }
-
- public bool? Rr { get; set; }
-
- public string Csz { get; set; }
-
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public e2eSecInfo Esi { get; set; }
-
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aeA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aeA.cs
deleted file mode 100644
index e292566..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aeA.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aeA : announcedResource {
-
-
- private List<object> itemsField;
-
- public string Apn {get; set;}
-
- public string Api {get; set;}
-
- public string Aei {get; set;}
-
- public string Poa {get; set;}
-
- public string Or {get; set;}
-
- public string Nl {get; set;}
-
- public System.Nullable<bool> Rr {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> RrSpecified {get; set;}
-
- public string Csz {get; set;}
-
-
- public e2eSecInfo Esi { get; set; }
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedNotification.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedNotification.cs
deleted file mode 100644
index 95a4faa..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedNotification.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aggregatedNotification {
-
- private List<notification> sgnField;
-
- public List<notification> Sgn {
- get {
- if ((this.sgnField == null)) {
- this.sgnField = new List<notification>();
- }
- return this.sgnField;
- }
- set {
- this.sgnField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequest.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequest.cs
deleted file mode 100644
index c0c828f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequest.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aggregatedRequest {
-
- private List<aggregatedRequestReq> reqField;
-
- public List<aggregatedRequestReq> Req {
- get {
- if ((this.reqField == null)) {
- this.reqField = new List<aggregatedRequestReq>();
- }
- return this.reqField;
- }
- set {
- this.reqField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequestReq.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequestReq.cs
deleted file mode 100644
index c7b0edb..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedRequestReq.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aggregatedRequestReq {
-
- private primitiveContent pcField;
-
- private metaInformation miField;
-
- public System.Nullable<int> Op {get; set;}
-
- public string To {get; set;}
-
- public string Fr {get; set;}
-
- public string Rqi {get; set;}
-
-
- public primitiveContent Pc {
- get {
- if ((this.pcField == null)) {
- this.pcField = new primitiveContent();
- }
- return this.pcField;
- }
- set {
- this.pcField = value;
- }
- }
-
- public metaInformation Mi {
- get {
- if ((this.miField == null)) {
- this.miField = new metaInformation();
- }
- return this.miField;
- }
- set {
- this.miField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedResponse.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedResponse.cs
deleted file mode 100644
index e0e4183..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aggregatedResponse.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aggregatedResponse {
-
- private List<rsp> rspField;
-
- public string Ri {get; set;}
-
-
- public List<rsp> Rsp {
- get {
- if ((this.rspField == null)) {
- this.rspField = new List<rsp>();
- }
- return this.rspField;
- }
- set {
- this.rspField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajap.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajap.cs
deleted file mode 100644
index 8fc6e56..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajap : flexContainerResource {
-
- private List<object> itemsField;
-
- public System.Nullable<int> Dir {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajapa.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajapa.cs
deleted file mode 100644
index 6a134e7..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajapa.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajapa : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public System.Nullable<int> Dir {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfw.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfw.cs
deleted file mode 100644
index 0541ec5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfw.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajfw : flexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfwa.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfwa.cs
deleted file mode 100644
index 76e5ce5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajfwa.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajfwa : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajif.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajif.cs
deleted file mode 100644
index c6235f1..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajif.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajif : flexContainerResource {
-
- private List<object> itemsField;
-
- public string Ajir {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajifa.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajifa.cs
deleted file mode 100644
index a78667b..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajifa.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajifa : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public string Ajir {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmc.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmc.cs
deleted file mode 100644
index a5f0cc8..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmc.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajmc : flexContainerResource {
-
- private List<object> itemsField;
-
- public string Inp {get; set;}
-
- public string Clst {get; set;}
-
- public string Out {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmca.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmca.cs
deleted file mode 100644
index 3bc755f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmca.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajmca : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmd.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmd.cs
deleted file mode 100644
index 1b7d068..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmd.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajmd : flexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmda.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmda.cs
deleted file mode 100644
index f285beb..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajmda.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajmda : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpr.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpr.cs
deleted file mode 100644
index eb98556..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpr.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajpr : flexContainerResource {
-
- private List<object> itemsField;
-
- public string Crv {get; set;}
-
- public string Rqv {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpra.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpra.cs
deleted file mode 100644
index 71988cb..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajpra.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajpra : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajso.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajso.cs
deleted file mode 100644
index 3ff045a..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajso.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajso : flexContainerResource {
-
- private List<object> itemsField;
-
- public string Ajop {get; set;}
-
- public System.Nullable<bool> Ena {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajsoa.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajsoa.cs
deleted file mode 100644
index f914719..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ajsoa.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ajsoa : announcedFlexContainerResource {
-
- private List<object> itemsField;
-
- public string Ajop {get; set;}
-
- public System.Nullable<bool> Ena {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> EnaSpecified {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/allJoynDirection.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/allJoynDirection.cs
deleted file mode 100644
index 0d9fe98..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/allJoynDirection.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum allJoynDirection {
-
- [System.Xml.Serialization.XmlEnumAttribute("1")]
- AllJoyn_to_oneM2M = 1,
-
- [System.Xml.Serialization.XmlEnumAttribute("2")]
- OneM2M_to_AllJoyn = 2,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andi.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andi.cs
deleted file mode 100644
index e554fa3..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andi.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class andi : mgmtResource {
-
- private List<object> itemsField;
-
- public string Dvd {get; set;}
-
- public string Dvt {get; set;}
-
- public string Awi {get; set;}
-
- public System.Nullable<int> Sli {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> SliSpecified {get; set;}
-
- public System.Nullable<int> Sld {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> SldSpecified {get; set;}
-
- public string Ss {get; set;}
-
- public string Lnh {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andiA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andiA.cs
deleted file mode 100644
index 8d0ccdb..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/andiA.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class andiA : announcedMgmtResource {
-
- private List<object> itemsField;
-
- public string Dvd {get; set;}
-
- public string Dvt {get; set;}
-
- public string Awi {get; set;}
-
- public System.Nullable<int> Sli {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> SliSpecified {get; set;}
-
- public System.Nullable<int> Sld {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> SldSpecified {get; set;}
-
- public string Ss {get; set;}
-
- public string Lnh {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ani.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ani.cs
deleted file mode 100644
index eb65e27..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/ani.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class ani : mgmtResource {
-
- private List<object> itemsField;
-
- public string Ant {get; set;}
-
- public string Ldv {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aniA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aniA.cs
deleted file mode 100644
index 9017612..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/aniA.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class aniA : announcedMgmtResource {
-
- private List<object> itemsField;
-
- public string Ant {get; set;}
-
- public string Ldv {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableResource.cs
deleted file mode 100644
index 8bb86a9..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableResource.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announceableResource : regularResource {
-
- public string At {get; set;}
-
- public string Aa {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableSubordinateResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableSubordinateResource.cs
deleted file mode 100644
index 2943669..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announceableSubordinateResource.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announceableSubordinateResource : resource {
-
- public string Et {get; set;}
-
- public string At {get; set;}
-
- public string Aa {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedFlexContainerResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedFlexContainerResource.cs
deleted file mode 100644
index 8464a99..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedFlexContainerResource.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announcedFlexContainerResource {
-
- public System.Nullable<int> Ty {get; set;}
-
- public string Ri {get; set;}
-
- public string Pi {get; set;}
-
- public string Ct {get; set;}
-
- public string Lt {get; set;}
-
- public string Lbl {get; set;}
-
- public string Acpi {get; set;}
-
- public string Et {get; set;}
-
- public string Lnk {get; set;}
-
- public string Daci {get; set;}
-
- public System.Nullable<int> St {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> StSpecified {get; set;}
-
- public string Cnd {get; set;}
-
- public string Or {get; set;}
-
- public string Rn {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedMgmtResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedMgmtResource.cs
deleted file mode 100644
index 5fb868e..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedMgmtResource.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announcedMgmtResource : announcedResource {
-
- public System.Nullable<int> Mgd {get; set;}
-
- public string Obis {get; set;}
-
- public string Obps {get; set;}
-
- public string Dc {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedResource.cs
deleted file mode 100644
index 6ce216c..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedResource.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announcedResource : resource {
-
- public string Acpi {get; set;}
-
- public string Et {get; set;}
-
- public string Lnk {get; set;}
-
- public string Daci {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedSubordinateResource.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedSubordinateResource.cs
deleted file mode 100644
index 18a6b27..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/announcedSubordinateResource.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class announcedSubordinateResource : resource {
-
- public string Et {get; set;}
-
- public string Lnk {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/anyArgType.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/anyArgType.cs
deleted file mode 100644
index 51e97ae..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/anyArgType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class anyArgType {
-
- public string Nm {get; set;}
-
- public object Val {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/asar.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/asar.cs
deleted file mode 100644
index 045820f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/asar.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class asar : regularResource {
-
- private List<object> itemsField;
-
- public string Apci {get; set;}
-
- public string Aai {get; set;}
-
- public string Aae {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/attribute.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/attribute.cs
deleted file mode 100644
index 507fdac..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/attribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class attribute {
-
- public string Nm {get; set;}
-
- public object Val {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParameters.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParameters.cs
deleted file mode 100644
index 748e665..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParameters.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class backOffParameters {
-
- private List<backOffParametersBops> bopsField;
-
- public List<backOffParametersBops> Bops {
- get {
- if ((this.bopsField == null)) {
- this.bopsField = new List<backOffParametersBops>();
- }
- return this.bopsField;
- }
- set {
- this.bopsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParametersBops.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParametersBops.cs
deleted file mode 100644
index e684354..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/backOffParametersBops.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class backOffParametersBops {
-
- public System.Nullable<int> Nwa {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> NwaSpecified {get; set;}
-
- public System.Nullable<int> Ibt {get; set;}
-
- public System.Nullable<int> Abt {get; set;}
-
- public System.Nullable<int> Mbt {get; set;}
-
- public System.Nullable<int> Rbt {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> RbtSpecified {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/bat.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/bat.cs
deleted file mode 100644
index 7826724..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/bat.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class bat : mgmtResource {
-
- private List<object> itemsField;
-
- public uint Btl {get; set;}
-
- public System.Nullable<int> Bts {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batA.cs
deleted file mode 100644
index 5abc848..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batA.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class batA : announcedMgmtResource {
-
- private List<object> itemsField;
-
- public uint Btl {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> BtlSpecified {get; set;}
-
- public System.Nullable<int> Bts {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> BtsSpecified {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batchNotify.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batchNotify.cs
deleted file mode 100644
index 5172e24..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batchNotify.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class batchNotify {
-
- public System.Nullable<int> Num {get; set;}
-
- public string Dur {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batteryStatus.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batteryStatus.cs
deleted file mode 100644
index a2f19a5..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/batteryStatus.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum batteryStatus {
-
- [System.Xml.Serialization.XmlEnumAttribute("1")]
- NORMAL = 1,
-
- [System.Xml.Serialization.XmlEnumAttribute("2")]
- CHARGING = 2,
-
- [System.Xml.Serialization.XmlEnumAttribute("3")]
- CHARGINGCOMPLETE = 3,
-
- [System.Xml.Serialization.XmlEnumAttribute("4")]
- DAMAGED = 4,
-
- [System.Xml.Serialization.XmlEnumAttribute("5")]
- LOWBATTERY = 5,
-
- [System.Xml.Serialization.XmlEnumAttribute("6")]
- NOTINSTALLED = 6,
-
- [System.Xml.Serialization.XmlEnumAttribute("7")]
- UNKNOWN = 7,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cb.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cb.cs
deleted file mode 100644
index e4f4db9..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cb.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-namespace oneM2MClient.Protocols
-{
- using System.Collections.Generic;
- using System.ComponentModel;
- public partial class cb : resource
- {
- private e2eSecInfo esiField;
-
- private List<object> itemsField;
-
- private List<string> acpiField;
-
- private List<string> poaField;
-
- public List<string> Acpi
- {
- get
- {
- if ((this.acpiField == null))
- {
- this.acpiField = new List<string>();
- }
- return this.acpiField;
- }
- set
- {
- this.acpiField = value;
- }
- }
-
- public string Cst { get; set; }
-
- public string Csi { get; set; }
-
- public List<int> Srt { get; set; }
-
- public List<string> Poa {
- get
- {
- if ((this.poaField == null))
- {
- this.poaField = new List<string>();
- }
- return this.poaField;
- }
- set
- {
- this.poaField = value;
- }
- }
-
- public string Nl { get; set; }
-
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public e2eSecInfo Esi
- {
- get
- {
- if ((this.esiField == null))
- {
- this.esiField = new e2eSecInfo();
- }
- return this.esiField;
- }
- set
- {
- this.esiField = value;
- }
- }
-
- public List<object> Items
- {
- get
- {
- if ((this.itemsField == null))
- {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set
- {
- this.itemsField = value;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/childResourceRef.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/childResourceRef.cs
deleted file mode 100644
index b1ba312..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/childResourceRef.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class childResourceRef {
-
- public string Nm {get; set;}
-
- public System.Nullable<int> Typ {get; set;}
-
- public string Spid {get; set;}
-
- [System.Xml.Serialization.XmlTextAttribute(DataType="anyURI")]
- public string Value {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cin.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cin.cs
deleted file mode 100644
index 1dd7239..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cin.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace oneM2MClient.Protocols
-{
- using System.Collections.Generic;
- using System.ComponentModel;
-
- public partial class cin : announceableSubordinateResource
- {
- private List<contentRefUrir> conrField;
-
- public int? St { get; set; }
-
- public string Cr { get; set; }
-
- public string Cnf { get; set; }
-
- public int? Cs { get; set; }
-
- public string Or { get; set; }
-
- public string Con { get; set; }
-
- public List<contentRefUrir> Conr
- {
- get
- {
- if ((this.conrField == null))
- {
- this.conrField = new List<contentRefUrir>();
- }
- return this.conrField;
- }
- set
- {
- this.conrField = value;
- }
- }
- }
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cinA.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cinA.cs
deleted file mode 100644
index e934309..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cinA.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cinA : announcedSubordinateResource {
-
- private List<object> itemsField;
-
- public System.Nullable<int> St {get; set;}
-
- public string Cnf {get; set;}
-
- public System.Nullable<int> Cs {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> CsSpecified {get; set;}
-
- public string Or {get; set;}
-
- public object Con {get; set;}
-
-
- public List<object> Items {
- get {
- if ((this.itemsField == null)) {
- this.itemsField = new List<object>();
- }
- return this.itemsField;
- }
- set {
- this.itemsField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmbf.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmbf.cs
deleted file mode 100644
index 0e22afc..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmbf.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmbf : mgmtResource {
-
- public string Aec {get; set;}
-
- public System.Nullable<int> Mbfs {get; set;}
-
- public System.Nullable<int> Sgp {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdType.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdType.cs
deleted file mode 100644
index a628d8f..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdType.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum cmdType {
-
- [System.Xml.Serialization.XmlEnumAttribute("1")]
- RESET = 1,
-
- [System.Xml.Serialization.XmlEnumAttribute("2")]
- REBOOT = 2,
-
- [System.Xml.Serialization.XmlEnumAttribute("3")]
- UPLOAD = 3,
-
- [System.Xml.Serialization.XmlEnumAttribute("4")]
- DOWNLOAD = 4,
-
- [System.Xml.Serialization.XmlEnumAttribute("5")]
- SOFTWAREINSTALL = 5,
-
- [System.Xml.Serialization.XmlEnumAttribute("6")]
- SOFTWAREUNINSTALL = 6,
-
- [System.Xml.Serialization.XmlEnumAttribute("7")]
- SOFTWAREUPDATE = 7,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdf.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdf.cs
deleted file mode 100644
index fc21294..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdf.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmdf : mgmtResource {
-
- private List<mgmtLinkRef> cmlkField;
-
- public List<mgmtLinkRef> Cmlk {
- get {
- if ((this.cmlkField == null)) {
- this.cmlkField = new List<mgmtLinkRef>();
- }
- return this.cmlkField;
- }
- set {
- this.cmlkField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdv.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdv.cs
deleted file mode 100644
index 00c2c10..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmdv.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmdv : mgmtResource {
-
- public System.Nullable<int> Od {get; set;}
-
- public string Dev {get; set;}
-
- public string Ror {get; set;}
-
- public object Rct {get; set;}
-
- public System.Nullable<bool> Rctn {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> RctnSpecified {get; set;}
-
- public object Rch {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cml.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cml.cs
deleted file mode 100644
index 0e8f48d..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cml.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cml : mgmtResource {
-
- public System.Nullable<int> Od {get; set;}
-
- public string Ror {get; set;}
-
- public object Rct {get; set;}
-
- public System.Nullable<bool> Rctn {get; set;}
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- public System.Nullable<bool> RctnSpecified {get; set;}
-
- public object Rch {get; set;}
-
- public string Lec {get; set;}
-
- public string Lqet {get; set;}
-
- public string Lset {get; set;}
-
- public string Loet {get; set;}
-
- public string Lrp {get; set;}
-
- public cmlLda Lda {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmlLda.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmlLda.cs
deleted file mode 100644
index f1977f7..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmlLda.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public enum cmlLda {
-
- [System.Xml.Serialization.XmlEnumAttribute("0")]
- Item0,
-
- [System.Xml.Serialization.XmlEnumAttribute("1")]
- Item1,
-
- [System.Xml.Serialization.XmlEnumAttribute("0 1")]
- Item01,
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmnr.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmnr.cs
deleted file mode 100644
index 7a4c577..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmnr.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmnr : mgmtResource {
-
- private List<mgmtLinkRef> cmlkField;
-
- public string Aecs {get; set;}
-
-
- public List<mgmtLinkRef> Cmlk {
- get {
- if ((this.cmlkField == null)) {
- this.cmlkField = new List<mgmtLinkRef>();
- }
- return this.cmlkField;
- }
- set {
- this.cmlkField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmp.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmp.cs
deleted file mode 100644
index f4da5aa..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmp.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmp : mgmtResource {
-
- private List<mgmtLinkRef> cmlkField;
-
- public string Cpn {get; set;}
-
-
- public List<mgmtLinkRef> Cmlk {
- get {
- if ((this.cmlkField == null)) {
- this.cmlkField = new List<mgmtLinkRef>();
- }
- return this.cmlkField;
- }
- set {
- this.cmlkField = value;
- }
- }
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmpv.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmpv.cs
deleted file mode 100644
index 2a5ed7a..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmpv.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmpv : mgmtResource {
-
- public string Aec {get; set;}
-
- public long Dqet {get; set;}
-
- public long Dset {get; set;}
-
- public long Doet {get; set;}
-
- public long Drp {get; set;}
-
- public System.Nullable<bool> Dda {get; set;}
-
-}
-}
diff --git a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmwr.cs b/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmwr.cs
deleted file mode 100644
index 0d72d12..0000000
--- a/sdks/csnet/BaSys40.Technologies.oneM2M/Protocols/cmwr.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-namespace oneM2MClient.Protocols
-{
-using System;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using System.Collections;
-using System.Xml.Schema;
-using System.ComponentModel;
-using System.Xml;
-using System.Collections.Generic;
-public partial class cmwr : mgmtResource {
-
- private List<backOffParametersBops> bopField;
-
- private mgmtLinkRef cmlkField;
-
- public string Ttn {get; set;}
-