diff --git a/bridge/src/lib/Bridge.sln b/bridge/src/lib/Bridge.sln new file mode 100644 index 0000000..7e63cc5 --- /dev/null +++ b/bridge/src/lib/Bridge.sln @@ -0,0 +1,64 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7B82912F-F739-411D-B3F1-ED7F9F04BD69}" + ProjectSection(SolutionItems) = preProject + Local.testsettings = Local.testsettings + NetProxy.vsmdi = NetProxy.vsmdi + TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "org.openengsb.loom.csharp.common.bridge.Interface", "org.openengsb.loom.csharp.common.bridge.Interface\org.openengsb.loom.csharp.common.bridge.Interface.csproj", "{5CCD2925-BB25-496E-824F-3894A4FBF968}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "org.openengsb.loom.csharp.common.bridge.Impl", "org.openengsb.loom.csharp.common.bridge.Implentation\org.openengsb.loom.csharp.common.bridge.Impl.csproj", "{CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "org.openengsb.loom.csharp.common.ServiceTestConsole", "org.openengsb.loom.csharp.common.bridge.ServiceTestConsole\org.openengsb.loom.csharp.common.ServiceTestConsole.csproj", "{6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}" +EndProject +Global + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = NetProxy.vsmdi + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|x86.ActiveCfg = Debug|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Any CPU.Build.0 = Release|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|x86.ActiveCfg = Release|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Any CPU.Build.0 = Release|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|x86.ActiveCfg = Release|Any CPU + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Any CPU.ActiveCfg = Debug|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|x86.ActiveCfg = Debug|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|x86.Build.0 = Debug|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Any CPU.ActiveCfg = Release|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Mixed Platforms.Build.0 = Release|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|x86.ActiveCfg = Release|x86 + {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/bridge/src/lib/DotNet-Lib.sln b/bridge/src/lib/DotNet-Lib.sln deleted file mode 100644 index 06017db..0000000 --- a/bridge/src/lib/DotNet-Lib.sln +++ /dev/null @@ -1,115 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetProxyTests", "NetProxyTests\NetProxyTests.csproj", "{36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7B82912F-F739-411D-B3F1-ED7F9F04BD69}" - ProjectSection(SolutionItems) = preProject - Local.testsettings = Local.testsettings - NetProxy.vsmdi = NetProxy.vsmdi - TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainService", "DomainService\DomainService.csproj", "{5CCD2925-BB25-496E-824F-3894A4FBF968}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MockupDomainService", "MockupDomainService\MockupDomainService.csproj", "{73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealDomainService", "RealDomainService\RealDomainService.csproj", "{CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestConsole", "TestConsole\TestConsole.csproj", "{2D480739-CAF4-4B1B-9503-63D1BB5C1E76}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceTestConsole", "ServiceTestConsole\ServiceTestConsole.csproj", "{6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceManager", "ServiceManager\ServiceManager.csproj", "{10E1E86A-BBE8-4F37-A1CC-1B1009830221}" - ProjectSection(ProjectDependencies) = postProject - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1} = {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1} - EndProjectSection -EndProject -Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = NetProxy.vsmdi - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Debug|x86.ActiveCfg = Debug|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Release|Any CPU.Build.0 = Release|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3}.Release|x86.ActiveCfg = Release|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Debug|x86.ActiveCfg = Debug|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Any CPU.Build.0 = Release|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5CCD2925-BB25-496E-824F-3894A4FBF968}.Release|x86.ActiveCfg = Release|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Debug|x86.ActiveCfg = Debug|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Release|Any CPU.Build.0 = Release|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC}.Release|x86.ActiveCfg = Release|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Debug|x86.ActiveCfg = Debug|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Any CPU.Build.0 = Release|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1}.Release|x86.ActiveCfg = Release|Any CPU - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Debug|Any CPU.ActiveCfg = Debug|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Debug|x86.ActiveCfg = Debug|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Debug|x86.Build.0 = Debug|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Release|Any CPU.ActiveCfg = Release|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Release|Mixed Platforms.Build.0 = Release|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Release|x86.ActiveCfg = Release|x86 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76}.Release|x86.Build.0 = Release|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Any CPU.ActiveCfg = Debug|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|x86.ActiveCfg = Debug|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Debug|x86.Build.0 = Debug|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Any CPU.ActiveCfg = Release|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|Mixed Platforms.Build.0 = Release|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|x86.ActiveCfg = Release|x86 - {6E73B7BD-2C7A-40CB-94FE-747D7ABDFBF9}.Release|x86.Build.0 = Release|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Debug|Any CPU.ActiveCfg = Debug|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Debug|x86.ActiveCfg = Debug|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Debug|x86.Build.0 = Debug|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Release|Any CPU.ActiveCfg = Release|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Release|Mixed Platforms.Build.0 = Release|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Release|x86.ActiveCfg = Release|x86 - {10E1E86A-BBE8-4F37-A1CC-1B1009830221}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/bridge/src/lib/MockupDomainService/AllMethodInfos.cs b/bridge/src/lib/MockupDomainService/AllMethodInfos.cs deleted file mode 100644 index 25f05ae..0000000 --- a/bridge/src/lib/MockupDomainService/AllMethodInfos.cs +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService; -using System.Reflection; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService -{ - public class AllMethodInfos - { - public int ID { get; set; } - public MethodInfo Info { get; set; } - public Type BaseType { get; set; } - public object ImplObject { get; set; } - public MethodType Type { get; set; } - } -} diff --git a/bridge/src/lib/MockupDomainService/DomainFactory.cs b/bridge/src/lib/MockupDomainService/DomainFactory.cs deleted file mode 100644 index ba15d14..0000000 --- a/bridge/src/lib/MockupDomainService/DomainFactory.cs +++ /dev/null @@ -1,162 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Org.OpenEngSB.DotNet.Lib.DomainService; -using System.Windows; -using System.Threading; -using Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService; -using System.ServiceModel; -using System.Reflection; -using System.Xml.Serialization; -using System.IO; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService -{ - public class DomainFactory : IDomainFactory, IMonitorServiceCallback, IDisposable - { - private static DomainFactory _me; - private String serviceId; - private int _objectId; - private object _objectIdLocker = new object(); - private String domainType; - private Dictionary _methods = new Dictionary(); - private MonitorServiceClient _monitor; - private Type domainEvents; - private DomainFactory() - { - InstanceContext ic = new InstanceContext(this); - _monitor = new MonitorServiceClient(ic); - } - - public static DomainFactory Instance - { - get - { - if (_me == null) - { - _me = new DomainFactory(); - } - - return _me; - } - } - - public T getEventhandler(string host) - { - Proxy proxy = new Proxy(_monitor); - T ret = proxy.GetTransparentProxy(); - - var ids = AddAllMethods(typeof(T), MethodType.Retrieved, ret); - proxy.IDs = ids; - - return ret; - } - - public void RegisterDomainService(string destination, T service, string domainType,Type domainEvents) - { - this.domainEvents = domainEvents; - this.domainType = domainType; - AddAllMethods(typeof(T), MethodType.Registered, service); - } - - private Dictionary AddAllMethods(Type type, MethodType methodType, object implObject) - { - try - { - Dictionary ret = new Dictionary(); - int id; - - foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) - { - id = GetNewID(implObject, methodType, method, type); - ret.Add(method, id); - - _monitor.AddMethod(id, new SimpleMethodInfo(method), methodType); - } - - return ret; - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, "Error communicating with the monitor.", MessageBoxButton.OK, MessageBoxImage.Error); - } - - return null; - } - - private int GetNewID(object implObject, MethodType methodType, MethodInfo method, Type type) - { - int myObjectId; - - lock (_objectIdLocker) - { - myObjectId = _objectId++; - } - - _methods.Add(myObjectId, new AllMethodInfos() { ID = myObjectId, ImplObject = implObject, Type = methodType, BaseType = type, Info = method }); - - return myObjectId; - } - - public object ExecuteMethod(int id, object[] parameters) - { - var method = _methods[id]; - ParameterInfo[] parameterDefinitions = method.Info.GetParameters(); - - for (int i = 0; i < parameters.Length; i++) - { - if (parameterDefinitions[i].ParameterType.IsEnum) - { - parameters[i] = Enum.Parse(parameterDefinitions[i].ParameterType, parameters[i].ToString()); - } - else if (!parameterDefinitions[i].ParameterType.IsPrimitive) - { - XmlSerializer serializer = new XmlSerializer(parameterDefinitions[i].ParameterType); - - // just test if the object is ok - parameters[i] = serializer.Deserialize(new StringReader(parameters[i].ToString())); - - } - } - - return method.Info.Invoke(method.ImplObject, parameters); - } - - public void Dispose() - { - if (_monitor != null) - { - _monitor.Unsubscribe(); - _monitor = null; - } - } - - public String getDomainTypServiceId() - { - return domainType + "+external-connector-proxy+" + serviceId; - } - - public void UnregisterDomainService(object service) - { - throw new NotImplementedException(); - } - } -} diff --git a/bridge/src/lib/MockupDomainService/MockupDataFinder.cs b/bridge/src/lib/MockupDomainService/MockupDataFinder.cs deleted file mode 100644 index d2af914..0000000 --- a/bridge/src/lib/MockupDomainService/MockupDataFinder.cs +++ /dev/null @@ -1,142 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using Innovatian.Configuration; -using System.Diagnostics; -using System.Xml; -using System.Reflection; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService -{ - public class MockupDataFinder - { - private readonly MockupDataIniConfiguration _configuration; - private readonly string _basePath; - - public MockupDataFinder(string configFile) - { - _basePath = Path.GetDirectoryName(configFile); - - _configuration = new MockupDataIniConfiguration(configFile); - } - - public string GetMockupData(Type targetType, MethodInfo method, object[] arguments) - { - string fileName = GetFile(targetType, method.Name); - string lowerFileName = fileName.ToLower(); - string ret; - - if (lowerFileName.EndsWith(".xml")) - ret = GetValueFromXml(fileName, targetType, method, arguments); - else if (lowerFileName.EndsWith(".bat")) - ret = GetValueFromBat(fileName, targetType, method.Name, arguments); - else - throw new ArgumentException(string.Format("The file {0} is of wrong type, only xml and bat is supported.", fileName)); - - ret = ret.Trim(); - - if (ret == "#NULL#") - return null; - else - return ret; - } - - private string GetValueFromXml(string fileName, Type targetType, MethodInfo method, object[] arguments) - { - XmlDocument doc = new XmlDocument(); - - doc.Load(fileName); - XmlNode methodNode = doc.DocumentElement.SelectSingleNode(string.Format("/root/{0}/{1}", targetType.FullName, method.Name)); - - if (methodNode == null) - throw new ArgumentException(string.Format("The node /root/{0}/{1} is missing in file {2}.", targetType.FullName, method.Name, fileName)); - - ParameterInfo[] parameters = method.GetParameters(); - int attributesNull, j; - - for (int i = 0; i <= arguments.Length; i++) - { - foreach (XmlNode node in methodNode.SelectNodes("add")) - { - attributesNull = 0; - - for (j = 0; j < parameters.Length; j++) - { - XmlAttribute att = node.Attributes[parameters[j].Name]; - - if (att == null) - { - attributesNull++; - - if (attributesNull > i) - break; - } - else - { - if (!(arguments[j] == null && att.InnerText == "#NULL#" || - arguments[j] != null && att.InnerText == arguments[j].ToString())) - break; - } - } - - if (j == parameters.Length) - return node.InnerText; - } - } - - throw new ArgumentException(string.Format("No matching add-node could be found in /root/{0}/{1} in file {2}.", targetType.FullName, method.Name, fileName)); - } - - private string GetValueFromBat(string fileName, Type targetType, string methodName, IEnumerable arguments) - { - StringBuilder argumentsBuilder = new StringBuilder(string.Format("{0} {1}", targetType.FullName, methodName)); - - foreach (var arg in arguments) - { - argumentsBuilder.Append(" "); - - if (arg == null) - argumentsBuilder.Append("#NULL#"); - else - argumentsBuilder.Append(arg.ToString()); - } - - ProcessStartInfo psi = new ProcessStartInfo(fileName, argumentsBuilder.ToString()) - {UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true}; - - Process p = new Process {StartInfo = psi}; - p.Start(); - - return p.StandardOutput.ReadToEnd(); - } - - private string GetFile(Type targetType, string methodName) - { - var fileName = _configuration.GetFileName(targetType, methodName); - var fullPath = Path.Combine(_basePath, fileName); - - if (!File.Exists(fullPath)) - throw new ArgumentException(string.Format("The file {0} doesn't exist.", fullPath)); - - return fullPath; - } - } -} diff --git a/bridge/src/lib/MockupDomainService/MockupDataIniConfiguration.cs b/bridge/src/lib/MockupDomainService/MockupDataIniConfiguration.cs deleted file mode 100644 index 4eaa0a2..0000000 --- a/bridge/src/lib/MockupDomainService/MockupDataIniConfiguration.cs +++ /dev/null @@ -1,69 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using Innovatian.Configuration; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService -{ - class MockupDataIniConfiguration - { - private readonly IConfigurationSource _configurationSource; - - public MockupDataIniConfiguration(string configFile) - { - _configurationSource = IniConfigurationSource.FromFile(configFile); - } - - public string GetFileName(Type targetType, string methodName) - { - IConfigurationSection section = GetSectionForType(targetType); - var fileName = GetValue(section, methodName); - - if (string.IsNullOrEmpty(fileName)) - throw new ArgumentException(string.Format("The value in section {0} with the key {1} is empty.", section.Name, - methodName)); - return fileName; - } - - private T GetValue(IConfigurationSection section, string method) - { - T value; - - bool sectionContainsMethod = section.TryGet(method, out value); - if (!sectionContainsMethod) - value = section.Get("*"); - - return value; - } - - private IConfigurationSection GetSectionForType(Type t) - { - return GetSectionByName(t.FullName); - } - - private IConfigurationSection GetSectionByName(string sectionName) - { - if (!_configurationSource.Sections.ContainsKey(sectionName)) - { - return _configurationSource.Sections["*"]; - } - - return _configurationSource.Sections[sectionName]; - } - } -} diff --git a/bridge/src/lib/MockupDomainService/MockupDomainService.csproj b/bridge/src/lib/MockupDomainService/MockupDomainService.csproj deleted file mode 100644 index 5755d2e..0000000 --- a/bridge/src/lib/MockupDomainService/MockupDomainService.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC} - Library - Properties - Org.OpenEngSB.DotNet.Lib.MockupDomainService - MockupDomainService - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - none - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\ThirdPartyAssemblies\Innovatian.Configuration.dll - - - - - - - - - - - - - - - - - - - - - - - - True - True - Reference.svcmap - - - - - - - - {5CCD2925-BB25-496E-824F-3894A4FBF968} - DomainService - - - - - - - - - - Designer - - - Designer - - - Designer - - - Designer - - - - - - - - - - - - - - - - - WCF Proxy Generator - Reference.cs - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Properties/AssemblyInfo.cs b/bridge/src/lib/MockupDomainService/Properties/AssemblyInfo.cs deleted file mode 100644 index e61a0ad..0000000 --- a/bridge/src/lib/MockupDomainService/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MockupDomainService")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("MockupDomainService")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6b1ff577-d198-436e-bf84-9fc6345e137c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bridge/src/lib/MockupDomainService/Proxy.cs b/bridge/src/lib/MockupDomainService/Proxy.cs deleted file mode 100644 index 90005d0..0000000 --- a/bridge/src/lib/MockupDomainService/Proxy.cs +++ /dev/null @@ -1,133 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.Remoting.Proxies; -using System.Runtime.Remoting.Messaging; -using Org.OpenEngSB.DotNet.Lib.DomainService; -using System.Reflection; -using Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService; -using System.Xml.Serialization; -using System.IO; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService -{ - public class Proxy : RealProxy - { - private MonitorServiceClient _monitor; - - public Dictionary IDs { get; set; } - - public Proxy(MonitorServiceClient monitor, Dictionary ids = null) : base(typeof(T)) - { - _monitor = monitor; - IDs = ids; - } - - public override IMessage Invoke(IMessage msg) - { - object retValue = default(T); - MessageMethodInvocation invocation = new MessageMethodInvocation(msg); - - // Implements basic object methods, mostly by using the type directly - if (invocation.TargetType == typeof(object)) - { - switch (invocation.MethodName) - { - case "GetType": - retValue = typeof(T); - break; - case "Equals": - if (invocation.Arguments[0] == null) - retValue = false; - else - retValue = typeof(T).Equals(invocation.Arguments[0].GetType()); - break; - default: - retValue = invocation.Invoke(typeof(T)); - break; - } - } - else // Impelenting the real mockup proxy - { - //string strRet = _mockupData.GetMockupData(invocation.TargetType, invocation.Method, invocation.Arguments); - //retValue = ConvertString(strRet, invocation.Method.ReturnType); - - XmlSerializer serializer; - object[] parameters = new object[invocation.Arguments.Length]; - - for (int i = 0; i < parameters.Length; i++) - { - serializer = new XmlSerializer(invocation.MethodSignature[i]); - StringWriter sw = new StringWriter(); - - serializer.Serialize(sw, invocation.Arguments[i]); - parameters[i] = sw.ToString(); - } - - retValue = _monitor.MethodExecuted(IDs[invocation.Method], parameters); - - if (retValue != null) - { - serializer = new XmlSerializer(invocation.Method.ReturnType); - StringReader sr = new StringReader(retValue.ToString()); - - retValue = serializer.Deserialize(sr); - } - } - - return invocation.ReturnValue(retValue); - } - - private object ConvertString(string val, Type targetType) - { - object ret = val; - bool isNullable = targetType.IsValueType; - - if (targetType == typeof(void)) - ret = null; - else if (targetType != typeof(string)) - { - if (targetType == typeof(Nullable<>)) - targetType = targetType.GetGenericArguments()[0]; - - if (isNullable && val == null) - return null; - else - { - Type convertType = typeof(Convert); - MethodInfo mi = convertType.GetMethod(string.Format("To{0}", targetType.Name), BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string) }, null); - - if (mi != null) - ret = mi.Invoke(null, new object[] { val }); - else - throw new NotImplementedException(); - } - } - - return ret; - } - - public new T GetTransparentProxy() - { - return (T)base.GetTransparentProxy(); - } - } -} diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/MainWindow.wsdl b/bridge/src/lib/MockupDomainService/Service References/MonitorService/MainWindow.wsdl deleted file mode 100644 index 1fb9a98..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/MainWindow.wsdl +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://localhost:8033/OpenEngSB/DotNet/Service/MonitorService - - LatitudeE6520\Peter - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.cs b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.cs deleted file mode 100644 index 32eafe4..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.cs +++ /dev/null @@ -1,493 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.225 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService { - using System.Runtime.Serialization; - using System; - - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name="SimpleMethodInfo", Namespace="http://schemas.datacontract.org/2004/07/Org.OpenEngSB.DotNet.Lib.MockupMonitor.Co" + - "mmunication")] - [System.SerializableAttribute()] - public partial class SimpleMethodInfo : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { - - [System.NonSerializedAttribute()] - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private string NameField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo[] ParametersField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType ReturnTypeField; - - [global::System.ComponentModel.BrowsableAttribute(false)] - public System.Runtime.Serialization.ExtensionDataObject ExtensionData { - get { - return this.extensionDataField; - } - set { - this.extensionDataField = value; - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public string Name { - get { - return this.NameField; - } - set { - if ((object.ReferenceEquals(this.NameField, value) != true)) { - this.NameField = value; - this.RaisePropertyChanged("Name"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo[] Parameters { - get { - return this.ParametersField; - } - set { - if ((object.ReferenceEquals(this.ParametersField, value) != true)) { - this.ParametersField = value; - this.RaisePropertyChanged("Parameters"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType ReturnType { - get { - return this.ReturnTypeField; - } - set { - if ((object.ReferenceEquals(this.ReturnTypeField, value) != true)) { - this.ReturnTypeField = value; - this.RaisePropertyChanged("ReturnType"); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected void RaisePropertyChanged(string propertyName) { - System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; - if ((propertyChanged != null)) { - propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name="SimpleType", Namespace="http://schemas.datacontract.org/2004/07/Org.OpenEngSB.DotNet.Lib.MockupMonitor.Co" + - "mmunication")] - [System.SerializableAttribute()] - public partial class SimpleType : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { - - [System.NonSerializedAttribute()] - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private string AssemblyQualifiedNameField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType BaseTypeField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool ContainsGenericParametersField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private string FullNameField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsArrayField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsClassField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsEnumField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsGenericTypeField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsInterfaceField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsPrimitiveField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsSerializableField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private bool IsValueTypeField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private string NamespaceField; - - [global::System.ComponentModel.BrowsableAttribute(false)] - public System.Runtime.Serialization.ExtensionDataObject ExtensionData { - get { - return this.extensionDataField; - } - set { - this.extensionDataField = value; - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public string AssemblyQualifiedName { - get { - return this.AssemblyQualifiedNameField; - } - set { - if ((object.ReferenceEquals(this.AssemblyQualifiedNameField, value) != true)) { - this.AssemblyQualifiedNameField = value; - this.RaisePropertyChanged("AssemblyQualifiedName"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType BaseType { - get { - return this.BaseTypeField; - } - set { - if ((object.ReferenceEquals(this.BaseTypeField, value) != true)) { - this.BaseTypeField = value; - this.RaisePropertyChanged("BaseType"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool ContainsGenericParameters { - get { - return this.ContainsGenericParametersField; - } - set { - if ((this.ContainsGenericParametersField.Equals(value) != true)) { - this.ContainsGenericParametersField = value; - this.RaisePropertyChanged("ContainsGenericParameters"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public string FullName { - get { - return this.FullNameField; - } - set { - if ((object.ReferenceEquals(this.FullNameField, value) != true)) { - this.FullNameField = value; - this.RaisePropertyChanged("FullName"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsArray { - get { - return this.IsArrayField; - } - set { - if ((this.IsArrayField.Equals(value) != true)) { - this.IsArrayField = value; - this.RaisePropertyChanged("IsArray"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsClass { - get { - return this.IsClassField; - } - set { - if ((this.IsClassField.Equals(value) != true)) { - this.IsClassField = value; - this.RaisePropertyChanged("IsClass"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsEnum { - get { - return this.IsEnumField; - } - set { - if ((this.IsEnumField.Equals(value) != true)) { - this.IsEnumField = value; - this.RaisePropertyChanged("IsEnum"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsGenericType { - get { - return this.IsGenericTypeField; - } - set { - if ((this.IsGenericTypeField.Equals(value) != true)) { - this.IsGenericTypeField = value; - this.RaisePropertyChanged("IsGenericType"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsInterface { - get { - return this.IsInterfaceField; - } - set { - if ((this.IsInterfaceField.Equals(value) != true)) { - this.IsInterfaceField = value; - this.RaisePropertyChanged("IsInterface"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsPrimitive { - get { - return this.IsPrimitiveField; - } - set { - if ((this.IsPrimitiveField.Equals(value) != true)) { - this.IsPrimitiveField = value; - this.RaisePropertyChanged("IsPrimitive"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsSerializable { - get { - return this.IsSerializableField; - } - set { - if ((this.IsSerializableField.Equals(value) != true)) { - this.IsSerializableField = value; - this.RaisePropertyChanged("IsSerializable"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public bool IsValueType { - get { - return this.IsValueTypeField; - } - set { - if ((this.IsValueTypeField.Equals(value) != true)) { - this.IsValueTypeField = value; - this.RaisePropertyChanged("IsValueType"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public string Namespace { - get { - return this.NamespaceField; - } - set { - if ((object.ReferenceEquals(this.NamespaceField, value) != true)) { - this.NamespaceField = value; - this.RaisePropertyChanged("Namespace"); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected void RaisePropertyChanged(string propertyName) { - System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; - if ((propertyChanged != null)) { - propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name="SimpleParameterInfo", Namespace="http://schemas.datacontract.org/2004/07/Org.OpenEngSB.DotNet.Lib.MockupMonitor.Co" + - "mmunication")] - [System.SerializableAttribute()] - public partial class SimpleParameterInfo : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { - - [System.NonSerializedAttribute()] - private System.Runtime.Serialization.ExtensionDataObject extensionDataField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private string NameField; - - [System.Runtime.Serialization.OptionalFieldAttribute()] - private Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType ParameterTypeField; - - [global::System.ComponentModel.BrowsableAttribute(false)] - public System.Runtime.Serialization.ExtensionDataObject ExtensionData { - get { - return this.extensionDataField; - } - set { - this.extensionDataField = value; - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public string Name { - get { - return this.NameField; - } - set { - if ((object.ReferenceEquals(this.NameField, value) != true)) { - this.NameField = value; - this.RaisePropertyChanged("Name"); - } - } - } - - [System.Runtime.Serialization.DataMemberAttribute()] - public Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType ParameterType { - get { - return this.ParameterTypeField; - } - set { - if ((object.ReferenceEquals(this.ParameterTypeField, value) != true)) { - this.ParameterTypeField = value; - this.RaisePropertyChanged("ParameterType"); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected void RaisePropertyChanged(string propertyName) { - System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; - if ((propertyChanged != null)) { - propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] - [System.Runtime.Serialization.DataContractAttribute(Name="MethodType", Namespace="http://schemas.datacontract.org/2004/07/Org.OpenEngSB.DotNet.Lib.MockupMonitor.Co" + - "mmunication")] - public enum MethodType : int { - - [System.Runtime.Serialization.EnumMemberAttribute()] - Registered = 0, - - [System.Runtime.Serialization.EnumMemberAttribute()] - Retrieved = 1, - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(ConfigurationName="MonitorService.IMonitorService", CallbackContract=typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.IMonitorServiceCallback))] - public interface IMonitorService { - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/TestMethod", ReplyAction="http://tempuri.org/IMonitorService/TestMethodResponse")] - string TestMethod(string value); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/AddMethod", ReplyAction="http://tempuri.org/IMonitorService/AddMethodResponse")] - void AddMethod(int id, Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleMethodInfo method, Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.MethodType type); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/RemoveMethod", ReplyAction="http://tempuri.org/IMonitorService/RemoveMethodResponse")] - void RemoveMethod(int id); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/MethodExecuted", ReplyAction="http://tempuri.org/IMonitorService/MethodExecutedResponse")] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleMethodInfo))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo[]))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.MethodType))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))] - object MethodExecuted(int id, object[] parameters); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/Unsubscribe", ReplyAction="http://tempuri.org/IMonitorService/UnsubscribeResponse")] - void Unsubscribe(); - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public interface IMonitorServiceCallback { - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IMonitorService/ExecuteMethod", ReplyAction="http://tempuri.org/IMonitorService/ExecuteMethodResponse")] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleMethodInfo))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo[]))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleParameterInfo))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleType))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.MethodType))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))] - object ExecuteMethod(int id, object[] parameters); - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public interface IMonitorServiceChannel : Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.IMonitorService, System.ServiceModel.IClientChannel { - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class MonitorServiceClient : System.ServiceModel.DuplexClientBase, Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.IMonitorService { - - public MonitorServiceClient(System.ServiceModel.InstanceContext callbackInstance) : - base(callbackInstance) { - } - - public MonitorServiceClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName) : - base(callbackInstance, endpointConfigurationName) { - } - - public MonitorServiceClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) : - base(callbackInstance, endpointConfigurationName, remoteAddress) { - } - - public MonitorServiceClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(callbackInstance, endpointConfigurationName, remoteAddress) { - } - - public MonitorServiceClient(System.ServiceModel.InstanceContext callbackInstance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : - base(callbackInstance, binding, remoteAddress) { - } - - public string TestMethod(string value) { - return base.Channel.TestMethod(value); - } - - public void AddMethod(int id, Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.SimpleMethodInfo method, Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService.MethodType type) { - base.Channel.AddMethod(id, method, type); - } - - public void RemoveMethod(int id) { - base.Channel.RemoveMethod(id); - } - - public object MethodExecuted(int id, object[] parameters) { - return base.Channel.MethodExecuted(id, parameters); - } - - public void Unsubscribe() { - base.Channel.Unsubscribe(); - } - } -} diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.svcmap b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.svcmap deleted file mode 100644 index eec6b19..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Reference.svcmap +++ /dev/null @@ -1,35 +0,0 @@ - - - - false - true - - false - false - false - - - true - Auto - true - true - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.disco b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.disco deleted file mode 100644 index 6000b5d..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.disco +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.xsd b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.xsd deleted file mode 100644 index fb826d9..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service1.xsd b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service1.xsd deleted file mode 100644 index d58e7f3..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service1.xsd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service2.xsd b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service2.xsd deleted file mode 100644 index 4e6748b..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service2.xsd +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service3.xsd b/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service3.xsd deleted file mode 100644 index d1c9842..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/Service3.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration.svcinfo b/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration.svcinfo deleted file mode 100644 index 78fe7dd..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration.svcinfo +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration91.svcinfo b/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration91.svcinfo deleted file mode 100644 index 43745fc..0000000 --- a/bridge/src/lib/MockupDomainService/Service References/MonitorService/configuration91.svcinfo +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - WSDualHttpBinding_IMonitorService - - - 00:01:00 - - - 00:01:00 - - - 00:10:00 - - - 00:01:00 - - - False - - - - - - False - - - StrongWildcard - - - 524288 - - - 65536 - - - Text - - - - - - System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement - - - 32 - - - 8192 - - - 16384 - - - 4096 - - - 16384 - - - System.ServiceModel.Configuration.StandardBindingReliableSessionElement - - - True - - - 00:10:00 - - - System.ServiceModel.Configuration.WSDualHttpSecurityElement - - - Message - - - System.ServiceModel.Configuration.MessageSecurityOverHttpElement - - - Windows - - - True - - - Default - - - System.Text.UTF8Encoding - - - True - - - - - - - - - http://localhost:8033/OpenEngSB/DotNet/Service/MonitorService - - - - - - wsDualHttpBinding - - - WSDualHttpBinding_IMonitorService - - - MonitorService.IMonitorService - - - System.ServiceModel.Configuration.AddressHeaderCollectionElement - - - <Header /> - - - System.ServiceModel.Configuration.IdentityElement - - - System.ServiceModel.Configuration.UserPrincipalNameElement - - - LatitudeE6520\Peter - - - System.ServiceModel.Configuration.ServicePrincipalNameElement - - - - - - System.ServiceModel.Configuration.DnsElement - - - - - - System.ServiceModel.Configuration.RsaElement - - - - - - System.ServiceModel.Configuration.CertificateElement - - - - - - System.ServiceModel.Configuration.CertificateReferenceElement - - - My - - - LocalMachine - - - FindBySubjectDistinguishedName - - - - - - False - - - WSDualHttpBinding_IMonitorService - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/MockupDomainService/SimpleMethodInfo.cs b/bridge/src/lib/MockupDomainService/SimpleMethodInfo.cs deleted file mode 100644 index 40b6570..0000000 --- a/bridge/src/lib/MockupDomainService/SimpleMethodInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService -{ - public partial class SimpleMethodInfo - { - public SimpleMethodInfo() { } - - public SimpleMethodInfo(MethodInfo method) - { - this.Name = method.Name; - this.ReturnType = new SimpleType(method.ReturnType); - - ParameterInfo[] parameters = method.GetParameters(); - - if (parameters != null) - { - this.Parameters = new SimpleParameterInfo[parameters.Length]; - - for (int i = 0; i < parameters.Length; i++) - { - this.Parameters[i] = new SimpleParameterInfo(parameters[i]); - } - } - } - } -} diff --git a/bridge/src/lib/MockupDomainService/SimpleType.cs b/bridge/src/lib/MockupDomainService/SimpleType.cs deleted file mode 100644 index ba5ade3..0000000 --- a/bridge/src/lib/MockupDomainService/SimpleType.cs +++ /dev/null @@ -1,53 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; - -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService -{ - public partial class SimpleType - { - public SimpleType() { } - - public SimpleType(Type baseType) - { - if (baseType != null) - { - Type typeOfType = typeof(Type); - - foreach (var prop in GetType().GetProperties()) - { - PropertyInfo pi = typeOfType.GetProperty(prop.Name); - - if (pi != null) - { - if (pi.PropertyType == prop.PropertyType) - prop.SetValue(this, pi.GetValue(baseType, null), null); - else if (prop.PropertyType == typeof(SimpleType) && pi.PropertyType == typeof(Type)) - prop.SetValue(this, new SimpleType((Type)pi.GetValue(baseType, null)), null); - else - throw new NotImplementedException(); - } - } - } - } - } -} diff --git a/bridge/src/lib/MockupDomainService/app.config b/bridge/src/lib/MockupDomainService/app.config deleted file mode 100644 index 17f99c9..0000000 --- a/bridge/src/lib/MockupDomainService/app.config +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/NetProxyTests/MockupProxyFactoryTest.cs b/bridge/src/lib/NetProxyTests/MockupProxyFactoryTest.cs deleted file mode 100644 index 50fa0ca..0000000 --- a/bridge/src/lib/NetProxyTests/MockupProxyFactoryTest.cs +++ /dev/null @@ -1,246 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -//using NetProxy.Mockup; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; - -namespace NetProxyTests -{ - - - /// - ///This is a test class for MockupProxyFactoryTest and is intended - ///to contain all MockupProxyFactoryTest Unit Tests - /// - [TestClass()] - public class MockupProxyFactoryTest - { - - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - - //You can use the following additional attributes as you write your tests: - - //Use ClassInitialize to run code before running the first test in the class - [ClassInitialize()] - public static void MyClassInitialize(TestContext testContext) - { - //MockupProxyFactory.Initialize(@"..\..\..\..\testDaten\netProxyMockups\MockupConfig.ini"); - } - - //Use ClassCleanup to run code after all tests in a class have run - [ClassCleanup()] - public static void MyClassCleanup() - { - } - - //Use TestInitialize to run code before running each test - [TestInitialize()] - public void MyTestInitialize() - { - } - - //Use TestCleanup to run code after each test has run - [TestCleanup()] - public void MyTestCleanup() - { - } - - #endregion - - #region Tests for common object-methods - - /// - ///A test for CreateNewProxy - /// - public T CreateNewProxyTestHelper() where T : class - { - //MockupProxyFactory target = MockupProxyFactory.Instance; - //T actual = target.CreateNewProxy(); - - //Assert.IsNotNull(actual); - //Assert.IsInstanceOfType(actual, typeof(T)); - //return actual; - return null; - } - - /// - /// Test if a proxy can be created - /// - [TestMethod] - public void CreateNewProxyTest() - { - //CreateNewProxyTestHelper(); - } - - /// - /// Test if GetType returns the correct type - /// - [TestMethod] - public void GetTypeTest() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual(typeof(InterfaceTest1), helper.GetType()); - } - - /// - /// Test if ToString returns the default ToString (Type.ToString()) - /// - [TestMethod] - public void ToStringTest() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual(typeof(InterfaceTest1).ToString(), helper.ToString()); - } - - /// - /// Test if a HashCode is calculated, the HashCode should be the same as the Type-HashCode - /// - [TestMethod] - public void GetHashCodeTest() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual(typeof(InterfaceTest1).GetHashCode(), helper.GetHashCode()); - } - - /// - /// Helper to test all possible equals-constilations - /// - public void EqualsTestHelper(object o1, object o2, bool? expectedValue = null) - { - Assert.AreEqual(o1.Equals(o2), o2.Equals(o1)); - - if (expectedValue.HasValue) - { - Assert.AreEqual(o1.Equals(o2), expectedValue.Value); - } - } - - /// - /// Tests if Equals with two proxies of the same type works - /// - [TestMethod] - public void EqualsTest() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - //InterfaceTest1 helper2 = CreateNewProxyTestHelper(); - //EqualsTestHelper(helper, helper2, true); - } - - /// - /// Tests if Equals with null returns false - /// - [TestMethod] - public void EqualsTestNull() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - //Assert.IsFalse(helper.Equals(null)); - } - - /// - /// Tests if Equals with the type of the proxie is allways the same (doesn't matter if true or false) - /// - [TestMethod] - public void EqualsTestType() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - //EqualsTestHelper(helper, typeof(InterfaceTest1)); - } - - /// - /// Tests if Equals with some random string returns false - /// - [TestMethod] - public void EqualsTestFalse() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - //EqualsTestHelper(helper, "testString", false); - } - - #endregion - - [TestMethod] - public void GetVal1Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual("my First testValue", helper.getVal1()); - } - - [TestMethod] - public void GetVal2Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual(42, helper.getVal2()); - } - - [TestMethod] - public void GetVal3Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //Assert.AreEqual(71, helper.getVal3()); - } - - [TestMethod] - public void SetVal1Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //helper.setVal1("string1"); - } - - [TestMethod] - public void SetVal13Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //helper.setVal13("string2", 42); - } - - [TestMethod] - public void SetVal2Test() - { - //InterfaceTest1 helper = CreateNewProxyTestHelper(); - - //helper.setVal2(71); - } - } -} diff --git a/bridge/src/lib/NetProxyTests/NetProxyTests.csproj b/bridge/src/lib/NetProxyTests/NetProxyTests.csproj deleted file mode 100644 index 4985d3a..0000000 --- a/bridge/src/lib/NetProxyTests/NetProxyTests.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {36CCCDE9-3E0B-40C0-B27D-FA1BDD898FE3} - Library - Properties - NetProxyTests - NetProxyTests - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - 3.5 - - - - - - - - - False - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/NetProxyTests/Properties/AssemblyInfo.cs b/bridge/src/lib/NetProxyTests/Properties/AssemblyInfo.cs deleted file mode 100644 index db3f96c..0000000 --- a/bridge/src/lib/NetProxyTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NetProxyTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("NetProxyTests")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3fda7dc3-d764-4dda-aa06-9475370410f0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bridge/src/lib/RealDomainService/App.config b/bridge/src/lib/RealDomainService/App.config deleted file mode 100644 index 7ce2b0d..0000000 --- a/bridge/src/lib/RealDomainService/App.config +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodCallMessage.cs b/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodCallMessage.cs deleted file mode 100644 index 02fe8d4..0000000 --- a/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodCallMessage.cs +++ /dev/null @@ -1,53 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Apache.NMS; -using Newtonsoft.Json; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote; - -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Json -{ - public class JsonMethodCallMessage - { - public MethodCallWrapper MethodCallWrap { get; set; } - - public string ReplyID - { - get - { - if (MethodCallWrap != null) - return MethodCallWrap.callId; - else - return ""; - } - } - - public JsonMethodCallMessage(string tm) - { - MethodCallWrap = null; - Parse(tm); - } - - private void Parse(string tm) - { - MethodCallWrap = JsonConvert.DeserializeObject(tm); - } - } -} diff --git a/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodReturnMessage.cs b/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodReturnMessage.cs deleted file mode 100644 index 1c6b24b..0000000 --- a/bridge/src/lib/RealDomainService/Communication/Json/JsonMethodReturnMessage.cs +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Newtonsoft.Json; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote; - -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Json -{ - public class JsonMethodReturnMessage - { - public string Text { get; set; } - - public MethodReturnWrapper ReturnMessage { get; set; } - - public JsonMethodReturnMessage(MethodReturnWrapper.RETURN_TYPE type, object returnValue) - { - ReturnMessage = new MethodReturnWrapper(); - ReturnMessage.type = type.ToString(); - ReturnMessage.arg = returnValue; - - if (returnValue == null) - ReturnMessage.className = "null"; - else - ReturnMessage.className = returnValue.GetType().Name; - - ReturnMessage.metaData = ""; - ToJson(); - } - - private void ToJson() - { - Text = JsonConvert.SerializeObject(ReturnMessage); - } - } -} diff --git a/bridge/src/lib/RealDomainService/DomainFactoryProvider.cs b/bridge/src/lib/RealDomainService/DomainFactoryProvider.cs deleted file mode 100644 index 5eb6fe4..0000000 --- a/bridge/src/lib/RealDomainService/DomainFactoryProvider.cs +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using Org.OpenEngSB.DotNet.Lib.DomainService; -using Org.OpenEngSB.DotNet.Lib.RealDomainService; -using Org.OpenEngSB.DotNet.Lib.MockupDomainService; - -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService -{ - public class DomainFactoryProvider - { - private static string CONFIGURATION_DIRECTORY = "conf"; - private static string CONFIGURATION_MOCK_FILE = "mocking.provider"; - - public static IDomainFactory GetDomainFactoryInstance() - { - string mockFilePath = Path.Combine(CONFIGURATION_DIRECTORY, CONFIGURATION_MOCK_FILE); - - if (File.Exists(mockFilePath)) - return DomainFactory.Instance; - - return new RealDomainFactory(); - } - } -} diff --git a/bridge/src/lib/RealDomainService/RealDomainService.csproj b/bridge/src/lib/RealDomainService/RealDomainService.csproj deleted file mode 100644 index a8017ea..0000000 --- a/bridge/src/lib/RealDomainService/RealDomainService.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1} - Library - Properties - Org.OpenEngSB.DotNet.Lib.RealDomainService - RealDomainService - v4.0 - 512 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - none - true - bin\Release\ - TRACE - prompt - 4 - - - - lib\Apache.NMS.dll - - - lib\Apache.NMS.ActiveMQ.dll - - - False - ..\ThirdPartyAssemblies\fastJSON.dll - - - False - ..\ThirdPartyAssemblies\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5CCD2925-BB25-496E-824F-3894A4FBF968} - DomainService - - - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC} - MockupDomainService - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/ServiceManager/App.xaml b/bridge/src/lib/ServiceManager/App.xaml deleted file mode 100644 index c17d568..0000000 --- a/bridge/src/lib/ServiceManager/App.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/bridge/src/lib/ServiceManager/Core/ConfigurationDirectory.cs b/bridge/src/lib/ServiceManager/Core/ConfigurationDirectory.cs deleted file mode 100644 index c3083c1..0000000 --- a/bridge/src/lib/ServiceManager/Core/ConfigurationDirectory.cs +++ /dev/null @@ -1,55 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace ServiceManager.Core -{ - public class ConfigurationDirectory - { - public static string CONFIG_FILE_EXTENSION = ".conf"; - - private string _path; - - public ConfigurationDirectory(string path) - { - CheckDirectory(path); - _path = path; - } - - public IList LoadConfigurations() - { - IList configurations = new List(); - foreach (string filePath in Directory.GetFiles(_path, "*"+CONFIG_FILE_EXTENSION)) - { - ConfigurationReader reader = new ConfigurationReader(filePath); - configurations.Add(reader.LoadConfiguration()); - } - return configurations; - } - - private void CheckDirectory(string path) - { - if (!Directory.Exists(path)) - throw new ApplicationException("Path doesn't point to a directory: " + path); - } - } -} diff --git a/bridge/src/lib/ServiceManager/Core/ConfigurationReader.cs b/bridge/src/lib/ServiceManager/Core/ConfigurationReader.cs deleted file mode 100644 index b98e7c9..0000000 --- a/bridge/src/lib/ServiceManager/Core/ConfigurationReader.cs +++ /dev/null @@ -1,86 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace ServiceManager.Core -{ - public class ConfigurationReader - { - private static string CONFIG_DOMAIN_TYPE = "domainType"; - private static string CONFIG_DESTINATION = "destination"; - private static string CONFIG_ASSEMBLY_PATH = "assemblyPath"; - private static string CONFIG_CLASS_NAME = "className"; - - private static char CONFIG_SEPARATOR = '='; - - public string FilePath { get; set; } - - public ConfigurationReader(string filePath) - { - FilePath = filePath; - } - - public ServiceConfiguration LoadConfiguration() - { - IDictionary config = new Dictionary(); - StreamReader reader = File.OpenText(FilePath); - string line = ""; - string[] tokens = null; - - while ((line = reader.ReadLine()) != null) - { - if (string.IsNullOrWhiteSpace(line)) - continue; - - tokens = line.Split(CONFIG_SEPARATOR); - - if(tokens.Length != 2) - throw new ApplicationException("invalid line in configuration file: " + FilePath); - - - config[tokens[0].Trim()] = tokens[1].Trim(); - } - - if (config.Count != 4 || !CheckConfiguration(config)) - throw new ApplicationException("invalid configuration file: " + FilePath); - - return new ServiceConfiguration(config[CONFIG_DOMAIN_TYPE], - config[CONFIG_ASSEMBLY_PATH], - config[CONFIG_DESTINATION], - config[CONFIG_CLASS_NAME]); - } - - private bool CheckConfiguration(IDictionary configuration) - { - if (!configuration.ContainsKey(CONFIG_ASSEMBLY_PATH) || - !configuration.ContainsKey(CONFIG_CLASS_NAME) || - !configuration.ContainsKey(CONFIG_DESTINATION) || - !configuration.ContainsKey(CONFIG_DOMAIN_TYPE)) - return false; - - if (!File.Exists(configuration[CONFIG_ASSEMBLY_PATH])) - return false; - - return true; - } - } -} diff --git a/bridge/src/lib/ServiceManager/Core/ServiceConfiguration.cs b/bridge/src/lib/ServiceManager/Core/ServiceConfiguration.cs deleted file mode 100644 index e060dc1..0000000 --- a/bridge/src/lib/ServiceManager/Core/ServiceConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; -using System.IO; - -namespace ServiceManager.Core -{ - public class ServiceConfiguration - { - public string DomainType { get; set; } - public string AssemblyPath { get; set; } - public string DestinationString { get; set; } - public string ServiceClassName { get; set; } - - private object _serviceInstance; - - public ServiceConfiguration( string domainType, string assemblyPath, - string destinationString, string serviceClassName) - { - DomainType = domainType; - AssemblyPath = assemblyPath; - DestinationString = destinationString; - ServiceClassName = serviceClassName; - _serviceInstance = null; - } - - public object GetServiceInstance() - { - if (_serviceInstance != null) - return _serviceInstance; - - Assembly asm = Assembly.LoadFile(Path.GetFullPath(AssemblyPath)); - Type type = asm.GetType(ServiceClassName); - _serviceInstance = Activator.CreateInstance(type); - return _serviceInstance; - } - } -} diff --git a/bridge/src/lib/ServiceManager/Core/ServiceConnectorManager.cs b/bridge/src/lib/ServiceManager/Core/ServiceConnectorManager.cs deleted file mode 100644 index ad23be0..0000000 --- a/bridge/src/lib/ServiceManager/Core/ServiceConnectorManager.cs +++ /dev/null @@ -1,102 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Org.OpenEngSB.DotNet.Lib.RealDomainService; -using Org.OpenEngSB.DotNet.Lib.DomainService; - -namespace ServiceManager.Core -{ - public class ServiceConnectorManager - { - private static string CONFIG_DIRECTORY = "conf"; - private enum State { CONNECTED, DISCONNECTED } - private State _State; - - public bool IsConnected { get { return _State == State.CONNECTED; } } - - public IList _configurations; - - IDomainFactory _domainFactory; - - public ServiceConnectorManager() - { - _configurations = null; - _domainFactory = DomainFactoryProvider.GetDomainFactoryInstance(); - _State = State.DISCONNECTED; - } - - public void Connect() - { - if (_State == State.CONNECTED) - return; - - if (_configurations == null) - LoadConfigurations(); - - RegisterServices(); - - _State = State.CONNECTED; - } - - private void LoadConfigurations() - { - ConfigurationDirectory dir = new ConfigurationDirectory(CONFIG_DIRECTORY); - _configurations = dir.LoadConfigurations(); - } - //TODO Adapt RegisterServices - private void RegisterServices() - { - if (_configurations == null) - return; - - foreach (ServiceConfiguration config in _configurations) - { - _domainFactory.RegisterDomainService(config.DestinationString, - config.GetServiceInstance(), - config.DomainType,null); - } - } - - private void UnregisterServices() - { - if (_configurations == null) - return; - - foreach (ServiceConfiguration config in _configurations) - { - _domainFactory.UnregisterDomainService(config.GetServiceInstance()); - } - } - - public void Disconnect() - { - if (_State == State.DISCONNECTED) - return; - - if (_configurations == null) - return; - - UnregisterServices(); - - _State = State.DISCONNECTED; - } - } -} diff --git a/bridge/src/lib/ServiceManager/Gui/ServiceManagerTray.cs b/bridge/src/lib/ServiceManager/Gui/ServiceManagerTray.cs deleted file mode 100644 index f1c6f44..0000000 --- a/bridge/src/lib/ServiceManager/Gui/ServiceManagerTray.cs +++ /dev/null @@ -1,156 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Drawing; -using System.IO; -using ServiceManager.Core; - -namespace ServiceManager.Gui -{ - public class ServiceManagerTray - { - /// - /// Callback for closing the application - /// - public delegate void ShutdownEventHandler(); - public event ShutdownEventHandler OnShutdown; - - /// - /// The relative folder name, which contains the icon files for - /// the system tray. - /// - private static string DIR_ICONS = "img"; - private static string FILENAME_ICON_CONNECTED = "connected.ico"; - private string FILENAME_ICON_DISCONNECTED = "disconnected.ico"; - - private NotifyIcon _TrayIcon; - private Icon _IconConnected; - private Icon _IconDisconnected; - private ServiceConnectorManager _ServiceConnector; - - public ServiceManagerTray() - { - Init(); - } - - private void Init() - { - InitIcons(); - _ServiceConnector = new ServiceConnectorManager(); - _TrayIcon = new NotifyIcon(); - _TrayIcon.ContextMenu = CreateContextMenu(); - _TrayIcon.Visible = true; - RefreshIcon(); - } - - /// - /// Creates the icons. - /// Icons will be set to NULL if the corresponding files can't be found - /// - private void InitIcons() - { - string path = Path.Combine(DIR_ICONS, FILENAME_ICON_CONNECTED); - if (File.Exists(path)) - _IconConnected = new Icon(path); - else - _IconConnected = null; - - path = Path.Combine(DIR_ICONS, FILENAME_ICON_DISCONNECTED); - if (File.Exists(path)) - _IconDisconnected = new Icon(path); - else - _IconDisconnected = null; - } - - /// - /// Create menu entries for the tray. - /// - /// - private ContextMenu CreateContextMenu() - { - ContextMenu menu = new ContextMenu(); - - MenuItem item = this.CreateMenuItem("Close", 0); - - // handle close application event - item.Click += (sender, e) => { Shutdown(); }; - - menu.MenuItems.Add(item); - - item = this.CreateMenuItem("Disconnect", 1); - item.Click += (sender, e) => { Disconnect(); }; - menu.MenuItems.Add(item); - - item = this.CreateMenuItem("Connect", 2); - item.Click += (sender, e) => { Connect(); }; - menu.MenuItems.Add(item); - - return menu; - } - - private MenuItem CreateMenuItem(string name, int index) - { - MenuItem item = new MenuItem(name); - item.Index = index; - return item; - } - - private void Connect() - { - _ServiceConnector.Connect(); - RefreshIcon(); - } - - private void Disconnect() - { - _ServiceConnector.Disconnect(); - RefreshIcon(); - } - - /// - /// Reset the icon corresponding to the state of ServiceConnector. - /// - private void RefreshIcon() - { - if (_ServiceConnector.IsConnected) - { - if (_IconConnected != null) - _TrayIcon.Icon = _IconConnected; - } - else - { - if (_IconDisconnected != null) - _TrayIcon.Icon = _IconDisconnected; - } - - } - - /// - /// Close Application requested. - /// - private void Shutdown() - { - Disconnect(); - OnShutdown(); - } - } -} diff --git a/bridge/src/lib/ServiceManager/MainWindow.xaml b/bridge/src/lib/ServiceManager/MainWindow.xaml deleted file mode 100644 index 5fe538e..0000000 --- a/bridge/src/lib/ServiceManager/MainWindow.xaml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/bridge/src/lib/ServiceManager/MainWindow.xaml.cs b/bridge/src/lib/ServiceManager/MainWindow.xaml.cs deleted file mode 100644 index 0fa6f18..0000000 --- a/bridge/src/lib/ServiceManager/MainWindow.xaml.cs +++ /dev/null @@ -1,61 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using ServiceManager.Gui; - -namespace ServiceManager -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - ServiceManagerTray _tray; - - public MainWindow() - { - InitializeComponent(); - Init(); - } - - private void Init() - { - _tray = new ServiceManagerTray(); - _tray.OnShutdown += () => this.Close(); - } - - private void Window_Loaded(object sender, RoutedEventArgs e) - { - // This should be an SystemTray-only application, - // the MainWindow has be hidden therefore - this.Hide(); - } - } -} diff --git a/bridge/src/lib/ServiceManager/app.config b/bridge/src/lib/ServiceManager/app.config deleted file mode 100644 index 7ce2b0d..0000000 --- a/bridge/src/lib/ServiceManager/app.config +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/ServiceManager/conf/example.conf b/bridge/src/lib/ServiceManager/conf/example.conf deleted file mode 100644 index fd5776f..0000000 --- a/bridge/src/lib/ServiceManager/conf/example.conf +++ /dev/null @@ -1,4 +0,0 @@ -domainType=example -destination=tcp://localhost:6549 -className=org.openengsb.domain.ExampleDomain -assemblyPath=conf\example.dll \ No newline at end of file diff --git a/bridge/src/lib/ServiceManager/conf/example.dll b/bridge/src/lib/ServiceManager/conf/example.dll deleted file mode 100644 index abbc841..0000000 Binary files a/bridge/src/lib/ServiceManager/conf/example.dll and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/conf/mocking.provider b/bridge/src/lib/ServiceManager/conf/mocking.provider deleted file mode 100644 index e69de29..0000000 diff --git a/bridge/src/lib/ServiceManager/img/connected.ico b/bridge/src/lib/ServiceManager/img/connected.ico deleted file mode 100644 index c49fd5e..0000000 Binary files a/bridge/src/lib/ServiceManager/img/connected.ico and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/img/disconnected.ico b/bridge/src/lib/ServiceManager/img/disconnected.ico deleted file mode 100644 index 274ed4f..0000000 Binary files a/bridge/src/lib/ServiceManager/img/disconnected.ico and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/lib/Apache.NMS.ActiveMQ.dll b/bridge/src/lib/ServiceManager/lib/Apache.NMS.ActiveMQ.dll deleted file mode 100644 index 363ecf3..0000000 Binary files a/bridge/src/lib/ServiceManager/lib/Apache.NMS.ActiveMQ.dll and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/lib/Apache.NMS.dll b/bridge/src/lib/ServiceManager/lib/Apache.NMS.dll deleted file mode 100644 index e252d57..0000000 Binary files a/bridge/src/lib/ServiceManager/lib/Apache.NMS.dll and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/lib/Newtonsoft.Json.dll b/bridge/src/lib/ServiceManager/lib/Newtonsoft.Json.dll deleted file mode 100644 index 282f3b3..0000000 Binary files a/bridge/src/lib/ServiceManager/lib/Newtonsoft.Json.dll and /dev/null differ diff --git a/bridge/src/lib/ServiceManager/lib/log4net.dll b/bridge/src/lib/ServiceManager/lib/log4net.dll deleted file mode 100644 index ffc57e1..0000000 Binary files a/bridge/src/lib/ServiceManager/lib/log4net.dll and /dev/null differ diff --git a/bridge/src/lib/ServiceTestConsole/app.config b/bridge/src/lib/ServiceTestConsole/app.config deleted file mode 100644 index 6cad51f..0000000 --- a/bridge/src/lib/ServiceTestConsole/app.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/bridge/src/lib/TestConsole/Program.cs b/bridge/src/lib/TestConsole/Program.cs deleted file mode 100644 index 7c2f726..0000000 --- a/bridge/src/lib/TestConsole/Program.cs +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * Licensed to the Austrian Association for Software Tool Integration (AASTI) - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. The AASTI licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using org.openengsb.domain.example; -using Org.OpenEngSB.DotNet.Lib.MockupDomainService; -using System.Threading; -using System.ComponentModel; - -namespace TestConsole -{ - class Program : IExampleDomain - { - [STAThread] - static void Main(string[] args) - { - IExampleDomain iex1 = DomainFactory.Instance.getEventhandler(""); - - Console.WriteLine(iex1.DoSomething("Hello, i'm here!")); - - IExampleDomain iexService1 = new Program(); - SignalDomainEvents signalDomainEvents=new SignalDomainEvents(); - DomainFactory.Instance.RegisterDomainService("", iexService1, "", signalDomainEvents.GetType()); - - Console.ReadLine(); - - DomainFactory.Instance.Dispose(); - } - - public string DoSomething(ExampleDomain1ExampleEnum arg0) - { - return "Argument retrieved: " + arg0.ToString(); - } - - public string DoSomething(string arg0) - { - return "Argument retrieved: " + arg0.ToString(); - } - - public string DoSomethingWithLogEvent(org.openengsb.domain.example._event.LogEvent arg0) - { - return "Retrieved log-event (" + arg0.Level + " - " + arg0.Message + ")"; - } - } -} diff --git a/bridge/src/lib/TestConsole/Properties/AssemblyInfo.cs b/bridge/src/lib/TestConsole/Properties/AssemblyInfo.cs deleted file mode 100644 index f9259b4..0000000 --- a/bridge/src/lib/TestConsole/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestConsole")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("TestConsole")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("36651c08-ba8d-48d9-9d97-f479409535a2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bridge/src/lib/TestConsole/TestConsole.csproj b/bridge/src/lib/TestConsole/TestConsole.csproj deleted file mode 100644 index e189072..0000000 --- a/bridge/src/lib/TestConsole/TestConsole.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {2D480739-CAF4-4B1B-9503-63D1BB5C1E76} - Exe - Properties - TestConsole - TestConsole - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\ThirdPartyAssemblies\openengsbDomains.dll - - - ..\..\..\..\..\..\..\Desktop\wsdl\SignalDomain.dll - - - ..\..\..\..\..\..\..\Desktop\wsdl\SignalDomainEvents.dll - - - - - - - - - - - - - - - - - {5CCD2925-BB25-496E-824F-3894A4FBF968} - DomainService - - - {73E33F49-C323-40D3-88ED-ADB2FE0C8FFC} - MockupDomainService - - - - - Designer - - - - - \ No newline at end of file diff --git a/bridge/src/lib/TestConsole/app.config b/bridge/src/lib/TestConsole/app.config deleted file mode 100644 index 17f99c9..0000000 --- a/bridge/src/lib/TestConsole/app.config +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.dll b/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.dll deleted file mode 100644 index e935982..0000000 Binary files a/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.dll and /dev/null differ diff --git a/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.xml b/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.xml deleted file mode 100644 index 2d3d46f..0000000 --- a/bridge/src/lib/ThirdPartyAssemblies/Innovatian.Configuration.xml +++ /dev/null @@ -1,1239 +0,0 @@ - - - - Innovatian.Configuration - - - - - Defines a named section of a configuration exposing key value setting - pairs. All settings are stored as strings until requested. - - - - - Returns the value of the setting name as a - T instance. - - - The type needed by the user. - - - The name of the setting. - - returns the setting value as a T instance or - defatult(T) if the key does not exist. - - - - - Returns true if the value of the setting name - exists and sets the T instance via the out parameter. If the key - was not found, false is returned and the out value is set to default(T). - - - The type needed by the user. - - - The name of the setting. - - - The value to set if the key exists. - - returns true if the setting exists and sets the value as a T instance or - false if the key does not exist and sets the out value to default(T). - - - - - Returns the value of the setting name as a - T instance. - - - The type needed by the user. - - - The name of the setting. - - - The default value. - - returns the setting value as a T instance or if the key does not exist. - - - - - Removes the specified key and its value from the section. - - - The name of the setting. - - - true if the setting named existed and was - removed; false otherwise. - - - - - Sets the value of the setting name . If the setting - does not exist, it is created. - - - The type of the setting being saved. - - - The name of the setting. - - - The value to save in this section. - - - - - The name of the section. - - - - - - - - - - AbstractConfigurationSource provides a skeleton implementation of - which provides all merging, adding, - and expanding features. Inheritors provide implementation specific loading - and saving functionality. - - - - - Defines methods and properties representing a configuration data source. - - - - - Adds a named configuration section to this source. If the section - name is already in this source, the values from the new source will - override and be added. - - The named section to add. - - - - Processes all sections expanding configuration variables and saving - the new values. - - - - - Merges the sources into this instance. Each source's sections will - be added and merged. If the sources contain duplicate sections, they - will be merged. - - - - - - Discards all sections and merged sources and reloads a fresh set of - settings. - - - - - Saves all sections. All data merged from other merged sources will - be included. - - - - - Clears all sections, their values, and calls Clear on all internal - configuration sources. - - - - - if is true, the inheritor should save - every time a key is updated; otherwise, updates should be ignored. - - - - - Provides user access to named configuration sections. - - - - - Initializes a new instance of the class. - - - - - Merges the sources into this instance. Each source's sections will - be added and merged. If the sources contain duplicate sections, they - will be merged. - - - - - - Saves all sections. All data merged from other merged sources will - be included. - - - - - Discards all sections and merged sources and reloads a fresh set of - settings. - - - - - Adds a named configuration section to this source. If the section - name is already in this source, the values from the new source will - override and be added. - - The named section to add. - - - - Processes all sections expanding configuration variables and saving - the new values. - - - - - Clears the sections and sources of this instance. - - - - - Called when [property changed]. - - The section. - The key. - - - - Returns an enumerator that iterates through the collection. - - - A that can - be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - An object that can - be used to iterate through the collection. - - 2 - - - - Provides access to the base configuration sources to inheritors. - - - - - Gets the sync root for modifying the internal configuration sources and sections. - - The sync root. - - - - if is true, the inheritor should save - every time a key is updated; otherwise, updates should be ignored. - - - - - - Provides user access to named configuration sections. - - - - - - Initializes a new instance of the class. - - - Name of the file. - - - If you specify invalid scope for your application, you will get an . - - - - - Initializes a new instance of the class. - - - The scope for the isolated storage file. - - - Name of the file. - - - If you specify invalid scope for your application, you will get an . - - - - - Saves all sections. All data merged from other merged sources will - be included. - - - - - Discards all sections and merged sources and reloads a fresh set of - settings. - - - - - Gets or sets the full path to the isolated storage file. - - The full path. - - - - Gets or sets the IsolatedStorageScope for this configuration source. - - The scope. - - - - AbstractFileConfigurationSource add helper functions to load configuration sources from file - that are not needed in general implementations of . - - - - - Initializes a new instance of the class. - - - - - Loads the current instance from the given file. - - - The name of the file to load into this instance. - - - - - Loads an from the given file. - - - The name of the file to load into a new instance. - - - - - - Saves all sections. All data merged from other merged sources will - be included. - - - - - If this instance has a file associated with it - then the settings are cleared and reloaded from file. - If, however, there is no set, then - nothing is done. - - - - - Gets or sets the default file encoding. - - The default encoding. - - - - The file used to store the configuration on disk. - - - - - - - - - - - - - - - Initializes a new instance of the class. - - The XML source. - - - - Initializes a new instance of the class. - - - - - Creates a new instance from the file specified. - - - The file to load. - - - - - - Parses the specified XML. - - The XML. - - - - Loads the current instance from the given file. - - The name of the file to load into this instance. - - - - Processes the specified document. - - The document. - - - - Converts the given to an XML representation. - - - The section to convert to XML. - - - A XML representation of the . - - - - - Converts the given s to an XML representation. - - - The sections to convert to XML. - - - A XML representation of the s. - - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Initializes a new instance of the class. - - The XML source. - - - - Initializes a new instance of the class. - - - - - Froms the file. - - Name of the file. - - - - - Processes the specified document. - - The document. - - - - Converts the given to an XML representation. - - - The section to convert to XML. - - - A XML representation of the . - - - - - Converts the given s to an XML representation. - - - The sections to convert to XML. - - - A XML representation of the s. - - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - - An that provides a format context. - A that represents the type you want to convert from. - - true if this converter can perform the conversion; otherwise, false. - - - - - Converts the given object to the type of this converter, using the specified context and culture information. - - An that provides a format context. - The to use as the current culture. - The to convert. - - An that represents the converted value. - - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - The to convert the parameter to. - - An that represents the converted value. - - The parameter is null. - The conversion cannot be performed. - - - - Gets an instance of T from string. - - - - The value to convert. - - as an instance of T or an exception if - the conversion is not possible. - - - - - Gets a string from an instance of T. - - - The value. - - T as a string. - - - If you are using a custom or special type, you should make sure that - there is a registered for it. - - - - - Converts the string value to a boolean. Int32 values are able to be - parsed. - - - - - - - - Determines if T is of type . - - - - - - - Determines if T is of type . - - - - - - - Determines if T is of type . - - - - - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - - An that provides a format context. - A that represents the type you want to convert from. - - true if this converter can perform the conversion; otherwise, false. - - - - - Converts the given object to the type of this converter, using the specified context and culture information. - - An that provides a format context. - The to use as the current culture. - The to convert. - - An that represents the converted value. - - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - The to convert the parameter to. - - An that represents the converted value. - - The parameter is null. - The conversion cannot be performed. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to There is no TypeConverter registered that can save type {0} to a string and back.. - - - - - Looks up a localized string similar to Destination file name must be set before saving.. - - - - - Looks up a localized string similar to Document root must not be null.. - - - - - Looks up a localized string similar to Expand key not found: {0}.. - - - - - Looks up a localized string similar to Expand section not found: {0}.. - - - - - Looks up a localized string similar to Failed to convert string [{0}] to type [{1}].. - - - - - Looks up a localized string similar to The short name may only be 1 or 2 characters. - - - - - Looks up a localized string similar to You must provide valid scope for settings.. - - - - - Looks up a localized string similar to Key not found: [{0}] in current section: [{1}].. - - - - - Looks up a localized string similar to Key cannot have a expand value of itself: {0}.. - - - - - Looks up a localized string similar to Sections cannot have empty names.. - - - - - Looks up a localized string similar to There is no TypeConverter registered that can restore type {0} from a string. Please create a TypeConverter for type {0} that can save and restore from string.. - - - - - Looks up a localized string similar to {0} cannot be reloaded.. - - - - - Looks up a localized string similar to {0} cannot be saved.. - - - - - - - - - - Initializes a new instance of the class. - - The data. - - - - Initializes a new instance of the class. - - The data. - - - - - - Initializes a new instance of the class. - - - - - Creates a new instance from the file specified. - - - The file to load. - - - - - - Loads the current instance from the given file. - - The name of the file to load into this instance. - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Gets the comment string for the ini file. - - The comment. - - - - Gets the key/value pair delimiter used in the ini file. - - The delimiter. - - - - - - - - - Initializes a new instance of the - class. - - Name of the section. - - - - Returns the value of the setting name as a - T instance. - - The type needed by the user. - The name of the setting. - - returns the setting value as a T instance or defatult(T) if - the key does not exist. - - - - - Returns true if the value of the setting name - exists and sets the T instance via the out parameter. If the key - was not found, false is returned and the out value is set to default(T). - - - The type needed by the user. - - - The name of the setting. - - - The value to set if the key exists. - - returns true if the setting exists and sets the value as a T instance or - false if the key does not exist and sets the out value to default(T). - - - - - Returns the value of the setting name as a - T instance. - - The type needed by the user. - The name of the setting. - The default value. - - returns the setting value as a T instance or if the key does not exist. - - - - - Removes the specified key and its value from the section. - - The name of the setting. - - true if the setting named existed and - was - removed; false otherwise. - - - - - Sets the value of the setting name . If the setting - does not exist, it is created. - - The type of the setting being saved. - The name of the setting. - The value to save in this section. - - - - Returns an enumerator that iterates through the collection. - - - A that can - be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - An object that can - be used to iterate through the collection. - - 2 - - - - Indicates whether the current object is equal to another object of - the same type. - - - true if the current object is equal to the - parameter; otherwise, false. - - - An object to compare with this object. - - - - - Determines whether the specified is - equal to the current . - - - true if the specified is equal to the - current ; otherwise, false. - - - The to compare with the current . - - - The parameter is null. - 2 - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - 2 - - - - Implements the operator ==. - - The left. - The right. - The result of the operator. - - - - Implements the operator !=. - - The left. - The right. - The result of the operator. - - - - Returns a that represents the current - . - - - A that represents the current . - - 2 - - - - Adds an item to the . - - - The object to add to the . - - - The is - read-only. - - - - - Removes all items from the . - - - The is - read-only. - - - - - Determines whether the contains a - specific value. - - - true if is found in the ; otherwise, - false. - - - The object to locate in the . - - - - - Copies the elements of the to an , starting at a particular index. - - - The one-dimensional that is the - destination of the elements copied from . The must have zero-based indexing. - - - The zero-based index in at which copying - begins. - - is null. - - is less than 0. - - is multidimensional. -or- is equal - to or greater than the length of . -or- The - number of elements in the source is greater than - the available space from to the end - of the destination . -or- Type cannot be cast automatically to the type of the - destination . - - - - - Removes the first occurrence of a specific object from the . - - - true if was successfully removed from the - ; - otherwise, false. This method also returns false if is not found in the original . - - - The object to remove from the . - - - The is - read-only. - - - - - Occurs when a property value changes. - - - - - The name of the section. - - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - - - - - - Initializes a new instance of the class. - - - The arguments to procces. - - - - - Initializes a new instance of the class. - - - The arguments to procces. - - - Name of the section to add the settings into. - - - The arguments switches to match against the arguments. The values - may be accessed through these switches. - - - - - Initializes a new instance of the class. - - - The arguments to procces. - - - Name of the section to add the settings into. - - - The arguments switches to match against the arguments. The values - may be accessed through these switches. - - - - - Adds the switch to match against the arguments mapping the short - name value to the long name (and short name) keys if possible. - - - Name of the section to add the settings into. - - - The long name of the switch. - - - The short name of the switch. This must be 1 or 2 characters in - length. - - - - - Adds the switch to match against the arguments mapping each switch. - - - Name of the section to add the settings into. - - - The arguments switches to match against the arguments. The values - may be accessed through these switches. - - - - - Adds the switch to match against the arguments mapping each switch. - - - Name of the section to add the settings into. - - - The arguments switches to match against the arguments. The values - may be accessed through these switches. - - - - - Determins whether the specified switch name has a corresponding value in a section. - - - Name of the switch. - - - true if any section contains the switch; false otherwise. - - - - - Saves this instance. - - - - - Reloads this instance. - - - - - - - - - - Initializes a new instance of the class. - - The root key to load settings from. - - - - Initializes a new instance of the class. - - The root key to load settings from. - - - - Initializes a new instance of the class. - - The root key to load settings from. - if the recursively process subkeys. Default is true. - - - - Initializes a new instance of the class. - - The root key to load settings from. - if the recursively process subkeys. Default is true. - - - - From the root key, create sections for every sub-key containing its values. - - - - - Recursively creates full key name for all subkeys of the root. - - - - - Saves all sections. All data merged from other merged sources will - be included. - - - - - Discards all sections and merged sources and reloads a fresh set of - settings. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - 2 - - - - Gets or sets the root registry key used by this source. - - The root. - - - - Whether this instance processes registry keys recusively or just load the root values. - - - - - Returns whether this is has been disposed. - - - - diff --git a/bridge/src/lib/ThirdPartyAssemblies/fastJSON.dll b/bridge/src/lib/ThirdPartyAssemblies/fastJSON.dll deleted file mode 100644 index 3ebea19..0000000 Binary files a/bridge/src/lib/ThirdPartyAssemblies/fastJSON.dll and /dev/null differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll new file mode 100644 index 0000000..52974b7 Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll new file mode 100644 index 0000000..f6642df Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll differ diff --git a/bridge/src/lib/ThirdPartyAssemblies/Newtonsoft.Json.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Newtonsoft.Json-5.0_1-SNAPSHOT/Newtonsoft.Json.dll similarity index 100% rename from bridge/src/lib/ThirdPartyAssemblies/Newtonsoft.Json.dll rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/Newtonsoft.Json-5.0_1-SNAPSHOT/Newtonsoft.Json.dll diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll new file mode 100644 index 0000000..e27e312 Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/log4net-1.2.11_1-SNAPSHOT/log4net.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/log4net-1.2.11_1-SNAPSHOT/log4net.dll new file mode 100644 index 0000000..d1a9101 Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/.references/org.openengsb.wrapped.csharp/log4net-1.2.11_1-SNAPSHOT/log4net.dll differ diff --git a/bridge/src/lib/RealDomainService/Common/IStoppable.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Common/IStoppable.cs similarity index 80% rename from bridge/src/lib/RealDomainService/Common/IStoppable.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Common/IStoppable.cs index 5a7f762..42201d1 100644 --- a/bridge/src/lib/RealDomainService/Common/IStoppable.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Common/IStoppable.cs @@ -20,10 +20,14 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Common +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Common { - interface IStoppable + /// + /// Interfacedescription for stopping a Thread + /// + public interface IStoppable { + //Description to stop a Thread void Stop(); } } diff --git a/bridge/src/lib/RealDomainService/Communication/IIncomingPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IIncomingPort.cs similarity index 76% rename from bridge/src/lib/RealDomainService/Communication/IIncomingPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IIncomingPort.cs index b6d1a3f..c35f0a8 100644 --- a/bridge/src/lib/RealDomainService/Communication/IIncomingPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IIncomingPort.cs @@ -20,10 +20,17 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication { + /// + /// Definiton, to receive a message + /// interface IIncomingPort: IPort { + /// + /// Used to receive messages from a desination + /// + /// received message string Receive(); } } diff --git a/bridge/src/lib/RealDomainService/Communication/IMarshaller.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IMarshaller.cs similarity index 70% rename from bridge/src/lib/RealDomainService/Communication/IMarshaller.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IMarshaller.cs index e1bc024..e5c8126 100644 --- a/bridge/src/lib/RealDomainService/Communication/IMarshaller.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IMarshaller.cs @@ -19,9 +19,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication { /// /// This interface specifies operations for marshalling objects @@ -30,8 +29,18 @@ namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication /// interface IMarshaller { + /// + /// Serialize a object + /// + /// Object to serialize + /// Serialized string string MarshallObject(object obj); - + /// + /// Deserialze a object + /// + /// Json object in string format + /// Type of the object to return + /// The deserialized object object UnmarshallObject(string jsonText, Type objectType); } } diff --git a/bridge/src/lib/RealDomainService/Communication/IOutgoingPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IOutgoingPort.cs similarity index 84% rename from bridge/src/lib/RealDomainService/Communication/IOutgoingPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IOutgoingPort.cs index 9c573d1..7cd4789 100644 --- a/bridge/src/lib/RealDomainService/Communication/IOutgoingPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IOutgoingPort.cs @@ -19,7 +19,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication { /// /// This interfaces specifies the operations for a communication port. @@ -27,6 +27,10 @@ namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication /// public interface IOutgoingPort: IPort { + /// + /// Definition to send a message + /// + /// message to send void Send(string Text); } } diff --git a/bridge/src/lib/RealDomainService/Communication/IPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IPort.cs similarity index 84% rename from bridge/src/lib/RealDomainService/Communication/IPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IPort.cs index 9abb42b..6baaaa9 100644 --- a/bridge/src/lib/RealDomainService/Communication/IPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/IPort.cs @@ -20,10 +20,14 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication { + /// + /// Specification + /// public interface IPort { + //Close the corresponding Port void Close(); } } diff --git a/bridge/src/lib/RealDomainService/Communication/Jms/Destination.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/Destination.cs similarity index 68% rename from bridge/src/lib/RealDomainService/Communication/Jms/Destination.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/Destination.cs index 2d68156..7ca0276 100644 --- a/bridge/src/lib/RealDomainService/Communication/Jms/Destination.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/Destination.cs @@ -20,13 +20,37 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms { + /// + /// Type for URLS + /// public class Destination { + #region Constructor + /// + /// Default constructor + /// + /// Url of the Destination + public Destination(string destination) + { + string[] parts = destination.Split('?'); + + if (parts.Length != 2) + throw new ApplicationException("JMSPort Destination string invalid!"); + + Host = parts[0].Trim(); + Queue = parts[1].Trim(); + } + #endregion + #region Variables public string Host { get; set; } public string Queue { get; set; } - + #endregion + #region Propreties + /// + /// Get the hole URL String + /// public string FullDestination { get @@ -36,21 +60,18 @@ public string FullDestination return Host + "?" + Queue; } } - - public Destination(string destination) - { - string[] parts = destination.Split('?'); - - if (parts.Length != 2) - throw new ApplicationException("JMSPort Destination string invalid!"); - - Host = parts[0].Trim(); - Queue = parts[1].Trim(); - } - + #endregion + #region Public static Methods + /// + /// Combines host and queue + /// + /// Host + /// Queue + /// Combination of the host and queue public static string CreateDestinationString(string host, string queue) { return host + "?" + queue; } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Communication/Jms/JMSPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JMSPort.cs similarity index 72% rename from bridge/src/lib/RealDomainService/Communication/Jms/JMSPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JMSPort.cs index ddf2827..14264f5 100644 --- a/bridge/src/lib/RealDomainService/Communication/Jms/JMSPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JMSPort.cs @@ -21,10 +21,14 @@ using System.Text; using Apache.NMS; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms { + /// + /// Abstract class to connect to a destination + /// public abstract class JmsPort { + #region Variables /// /// ActiveMQ NMS /// @@ -32,7 +36,12 @@ public abstract class JmsPort protected IConnectionFactory _factory; protected ISession _session; protected IDestination _destination; - + #endregion + #region Constructor + /// + /// Default constructor + /// + /// Destionation to connect with OpenEngSB protected JmsPort(string destination) { _connection = null; @@ -41,7 +50,12 @@ protected JmsPort(string destination) _destination = null; Configure(destination); } - + #endregion + #region private Methods + /// + /// Configurate the Connection + /// + /// Destionation private void Configure(string destination) { Destination dest = new Destination(destination); @@ -53,10 +67,15 @@ private void Configure(string destination) _connection.Start(); _destination = _session.GetDestination(dest.Queue); } - + #endregion + #region Protected Methods + /// + /// Close the connection + /// protected void Close() { _connection.Close(); } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Communication/Jms/JmsIncomingPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsIncomingPort.cs similarity index 77% rename from bridge/src/lib/RealDomainService/Communication/Jms/JmsIncomingPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsIncomingPort.cs index 3af5189..5992f2e 100644 --- a/bridge/src/lib/RealDomainService/Communication/Jms/JmsIncomingPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsIncomingPort.cs @@ -20,17 +20,27 @@ using System.Linq; using System.Text; using Apache.NMS; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms { + /// + /// Receive the datas + /// public class JmsIncomingPort : JmsPort, IIncomingPort { + #region variables IMessageConsumer _consumer; - + #endregion + #region Constructor + /// + /// Default constructor + /// + /// URL to OpenEngSB public JmsIncomingPort(string destination) : base(destination) { _consumer = _session.CreateConsumer(_destination); } - + #endregion + #region Public Methods /// /// Waits for a message on the preconfigured queue. /// Blocks until a message in received or the connection is closed. @@ -44,11 +54,14 @@ public string Receive() return null; return message.Text; } - + /// + /// Close the Connection + /// public new void Close() { base.Close(); _consumer.Close(); } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Communication/Jms/JmsOutgoingPort.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsOutgoingPort.cs similarity index 77% rename from bridge/src/lib/RealDomainService/Communication/Jms/JmsOutgoingPort.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsOutgoingPort.cs index c85a55c..3a93b41 100644 --- a/bridge/src/lib/RealDomainService/Communication/Jms/JmsOutgoingPort.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Jms/JmsOutgoingPort.cs @@ -20,18 +20,28 @@ using System.Text; using Apache.NMS; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms { + /// + /// Send Message + /// public class JmsOutgoingPort : JmsPort, IOutgoingPort { + #region Variables IMessageProducer _producer; - + #endregion + #region Constructor + /// + /// Default constructor + /// + /// URL to OpenEngSB public JmsOutgoingPort(string destination): base(destination) { _producer = _session.CreateProducer(_destination); _producer.DeliveryMode = MsgDeliveryMode.Persistent; } - + #endregion + #region Public Methods /// /// Send an string over NMS. /// @@ -43,10 +53,14 @@ public void Send(string text) _producer.Send(message); } + /// + /// Close the Connection + /// public new void Close() { base.Close(); _producer.Close(); } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Communication/Json/JsonMarshaller.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Json/JsonMarshaller.cs similarity index 94% rename from bridge/src/lib/RealDomainService/Communication/Json/JsonMarshaller.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Json/JsonMarshaller.cs index b231694..52070e2 100644 --- a/bridge/src/lib/RealDomainService/Communication/Json/JsonMarshaller.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Communication/Json/JsonMarshaller.cs @@ -18,12 +18,12 @@ using System; using System.Collections.Generic; using System.Linq; + using System.Text; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote; using System.IO; using Newtonsoft.Json; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Json +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Json { /// /// This class converts any given object to an json-message. diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/DomainFactoryProvider.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/DomainFactoryProvider.cs new file mode 100644 index 0000000..d27952a --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/DomainFactoryProvider.cs @@ -0,0 +1,71 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Exceptions; +using System.Net; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation +{ + /// + /// Factory Provider + /// + public class DomainFactoryProvider + { + /// + /// Retrieve a factory, depending on the openEngSB version + /// + /// Version of the OpenEngSB-framework in String format + /// Factory + public static IDomainFactory GetDomainFactoryInstance(String stringVersion) + { + try + { + String versionnbr = stringVersion.Replace(".", ""); + versionnbr = stringVersion.Replace("-SNAPSHOT", ""); + int version = int.Parse(versionnbr); + if (version >= 300) return new Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.RealDomainFactory(); + if (version >= 240) return new Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.RealDomainFactory(); + return null; + } + catch + { + throw new ConnectOpenEngSBException("Unable to receive the actually version from: "+stringVersion); + } + } + /// + /// Retrieve a factory, depending on the openEngSB version + /// + /// Version of the OpenEngSB-framework in url format + /// factory + public static IDomainFactory GetDomainFactoryInstance(Uri urlVersion) + { + Uri uri = urlVersion; + if (!uri.ToString().Contains("system/framework.version.info")) uri = new Uri(uri.ToString() + "system/framework.version.info"); + WebClient myWebClient = new WebClient(); + Byte[] myDataBuffer = myWebClient.DownloadData(uri); + String stringVersion = Encoding.ASCII.GetString(myDataBuffer); + return GetDomainFactoryInstance(stringVersion); + } + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Exceptions/ConnectOpenEngSBException.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Exceptions/ConnectOpenEngSBException.cs new file mode 100644 index 0000000..b3805b0 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Exceptions/ConnectOpenEngSBException.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Exceptions +{ + /// + /// Exception for Problems with the OpenEngSB Connection + /// + public class ConnectOpenEngSBException : Exception + { + /// + /// Default constructor + /// + public ConnectOpenEngSBException() { } + /// + /// Consructor + /// + /// Exception message + public ConnectOpenEngSBException(string message) : base(message) { } + /// + /// Constructor + /// + /// Exception Message + /// Inner Exception + public ConnectOpenEngSBException(string message, Exception inner) + : base(message, inner) { } + } +} diff --git a/bridge/src/lib/RealDomainService/RealDomainFactory.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/RealDomainFactory.cs similarity index 55% rename from bridge/src/lib/RealDomainService/RealDomainFactory.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/RealDomainFactory.cs index 69eef23..fd4089b 100644 --- a/bridge/src/lib/RealDomainService/RealDomainFactory.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/RealDomainFactory.cs @@ -19,11 +19,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Org.OpenEngSB.DotNet.Lib.DomainService; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Common; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Common; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0 { /// /// This class produces and manages proxies. @@ -33,7 +33,7 @@ public class RealDomainFactory : IDomainFactory private Dictionary _proxies; private String serviceId; private String domainType; - private Type domainEvents; + public RealDomainFactory() { Reset(); @@ -53,16 +53,33 @@ private void Reset() /// /// local domain /// remote domain - public void RegisterDomainService(string destination, T domainService, String domainType, Type domainEvents) + public void RegisterDomainService(string destination, T domainService, String domainType) { - this.domainEvents = domainEvents; this.domainType = domainType; this.serviceId = Guid.NewGuid().ToString(); - DomainReverseProxy proxy = new DomainReverseProxy(domainService, destination, serviceId, domainType, domainEvents); + DomainReverseProxy proxy = new DomainReverseProxy(domainService, destination, serviceId, domainType); + _proxies.Add(domainService, proxy); + proxy.Start(); + } + /// + /// Creates, registers and starts a reverse proxy. + /// + /// + /// + /// + /// + /// local domain + /// remote domain + /// Username for the authentification + /// Password for the authentification + public void RegisterDomainService(string destination, T domainService, String domainType, String username,String password) + { + this.domainType = domainType; + this.serviceId = Guid.NewGuid().ToString(); + DomainReverseProxy proxy = new DomainReverseProxy(domainService, destination, serviceId, domainType); _proxies.Add(domainService, proxy); proxy.Start(); } - /// /// Deletes and stops the reverse proxy. /// @@ -76,7 +93,24 @@ public void UnregisterDomainService(object service) _proxies.Remove(service); } } - + /// + /// Get Eventhandler from the spezified Domain T with authentification + /// + /// Remote Domain + /// Host + /// Username for the authentification + /// Password for the authentificaiton + /// Eventhandler + public T getEventhandler(string host,String username,String password) + { + return new DomainProxy(host, getDomainTypServiceId(), domainType).GetTransparentProxy(); + } + /// + /// Get Eventhandler from the spezified Domain T + /// + /// Remote Domain + /// Host + /// Eventhandler public T getEventhandler(string host) { return new DomainProxy(host, getDomainTypServiceId(),domainType).GetTransparentProxy(); diff --git a/bridge/src/lib/RealDomainService/Remote/DomainProxy.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainProxy.cs similarity index 77% rename from bridge/src/lib/RealDomainService/Remote/DomainProxy.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainProxy.cs index a84b34f..36d6005 100644 --- a/bridge/src/lib/RealDomainService/Remote/DomainProxy.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainProxy.cs @@ -20,14 +20,14 @@ using System.Text; using System.Runtime.Remoting.Proxies; using System.Runtime.Remoting.Messaging; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Json; using System.Web.Services.Protocols; using System.Reflection; using System.IO; using System.Xml.Serialization; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Json; +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// This class generates generic proxies. All method calls will be forwared to the configured server. @@ -44,7 +44,7 @@ public class DomainProxy : RealProxy /// /// Id identifying the service instance on the bus. /// - private string _serviceId; + private string serviceId; /// /// Domain type /// @@ -53,47 +53,45 @@ public class DomainProxy : RealProxy /// /// Host string of the server. /// - private string _host; + private string host; - private IMarshaller _marshaller; + private IMarshaller marshaller; #endregion #region Constructors + /// + /// Defautl constrcutor + /// + /// Host + /// ServiceId + /// DomainType public DomainProxy(string host, string serviceId,String domainType) : base(typeof(T)) { - _serviceId = serviceId; + this.serviceId = serviceId; this.domainType = domainType; - _host = host; ; - _marshaller = new JsonMarshaller(); + this.host = host; ; + this.marshaller = new JsonMarshaller(); } #endregion #region Public Methods /// /// Will be invoked when a call to the proxy has been made. /// - /// - /// + /// Message, which contains the Parameters of the Method + /// Received Method public override IMessage Invoke(IMessage msg) { - IMethodCallMessage callMessage = msg as IMethodCallMessage; - MethodCallRequest methodCallRequest = ToMethodCallRequest(callMessage); - - string methodCallMsg = _marshaller.MarshallObject(methodCallRequest); - - IOutgoingPort portOut = new JmsOutgoingPort(Destination.CreateDestinationString(_host, HOST_QUEUE)); - - portOut.Send(methodCallMsg); - - IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(_host, methodCallRequest.message.callId)); - + string methodCallMsg = marshaller.MarshallObject(methodCallRequest); + IOutgoingPort portOut = new JmsOutgoingPort(Destination.CreateDestinationString(host, HOST_QUEUE)); + portOut.Send(methodCallMsg); + IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(host, methodCallRequest.message.callId)); string methodReturnMsg = portIn.Receive(); - - MethodResultMessage methodReturn = _marshaller.UnmarshallObject(methodReturnMsg, typeof(MethodResultMessage)) as MethodResultMessage; - + MethodResultMessage methodReturn = marshaller.UnmarshallObject(methodReturnMsg, typeof(MethodResultMessage)) as MethodResultMessage; return ToMessage(methodReturn.message.result, callMessage); } + public new T GetTransparentProxy() { return (T)base.GetTransparentProxy(); @@ -104,8 +102,8 @@ public override IMessage Invoke(IMessage msg) /// Builds an IMessage using MethodReturn. /// /// Servers return message - /// - /// + /// Method Information + /// The result of the Message private IMessage ToMessage(MethodResult methodReturn, IMethodCallMessage callMessage) { IMethodReturnMessage returnMessage = null; @@ -151,11 +149,10 @@ private String reverseURL(String url) /// Packagename private String getPackageName(String fieldname) { - Boolean ismethod = false; Type type = typeof(T); MethodInfo method = type.GetMethod(fieldname); - ismethod = method != null; - if (ismethod) + //Tests if it is a Mehtod or a Type + if (method != null) { SoapDocumentMethodAttribute soapAttribute; foreach (Attribute attribute in method.GetCustomAttributes(false)) @@ -180,7 +177,7 @@ private String getPackageName(String fieldname) } } } - return fieldname; + throw new MethodAccessException("Fieldname doesn't have a corresponding attribute (Namepspace) or the attribute couldn't be found"); } /// /// Makes the first character to a upper character @@ -197,22 +194,24 @@ private String firstLetterToUpper(String element) } /// /// Builds an MethodCall using IMethodCallMessage. - /// TODO if bug ??? is fixed replace classes.Add(getPackageName(type.RemoteTypeFullName) + ".event." + firstLetterToUpper(type.RemoteTypeFullName)); with classes.Add(getPackageName(type.RemoteTypeFullName) + "." + firstLetterToUpper(type.RemoteTypeFullName)); + /// In the of the OpenEngSB version 3.0.0 classes.Add(getPackageName(type.RemoteTypeFullName) + ".event." + firstLetterToUpper(type.RemoteTypeFullName)); with classes.Add(getPackageName(type.RemoteTypeFullName) + "." + firstLetterToUpper(type.RemoteTypeFullName)) is removed; /// - /// - /// + /// Information, to create a MethodCallRequest + /// A new instance of methodCallrequest private MethodCallRequest ToMethodCallRequest(IMethodCallMessage msg) { Guid id = Guid.NewGuid(); string methodName = msg.MethodName; Dictionary metaData = new Dictionary(); - metaData.Add("serviceId", "domain."+domainType+".events"); + //The structure is always domain.DOMAINTYPE.events + metaData.Add("serviceId", "domain." + domainType + ".events"); - // arbitrary string, maybe not necessary + // Arbitrary string, maybe not necessary metaData.Add("contextId", "foo"); List classes = new List(); + //RealClassImplementation is optinal List realClassImplementation = new List(); foreach (object arg in msg.Args) { @@ -226,7 +225,7 @@ private MethodCallRequest ToMethodCallRequest(IMethodCallMessage msg) Data data = Data.CreateInstance("admin", "password"); Authentification authentification = Authentification.createInstance(classname, data, BinaryData.CreateInstance()); Message message = Message.createInstance(call, id.ToString(), true, ""); - return MethodCallRequest.CreateInstance(authentification,message); + return MethodCallRequest.CreateInstance(authentification, message); } #endregion diff --git a/bridge/src/lib/RealDomainService/Remote/DomainReverseProxy.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainReverseProxy.cs similarity index 63% rename from bridge/src/lib/RealDomainService/Remote/DomainReverseProxy.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainReverseProxy.cs index 0d939c1..369fad0 100644 --- a/bridge/src/lib/RealDomainService/Remote/DomainReverseProxy.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/DomainReverseProxy.cs @@ -20,110 +20,155 @@ using System.Text; using System.Threading; using System.Reflection; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Jms; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Communication.Json; -using Org.OpenEngSB.DotNet.Lib.RealDomainService.Common; using System.IO; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Json; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Common; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// This class builds reverse proxies for resources (class instances) on the /// client side for the bus. /// /// - public class DomainReverseProxy: IStoppable + public class DomainReverseProxy : IStoppable { + #region Const. private const string _CREATION_QUEUE = "receive"; - private const string _CREATION_SERVICE_ID = "connectorManager"; + private const string CREATION_SERVICE_ID = "connectorManager"; private const string _CREATION_METHOD_NAME = "create"; private const string _CREATION_DELETE_METHOD_NAME = "delete"; private const string _CREATION_PORT = "jms-json"; private const string _CREATION_CONNECTOR_TYPE = "external-connector-proxy"; - - + #endregion + #region Variables + /// + /// Username for the authentification + /// + private String username; + /// + /// Username for the password + /// + private String password; // Thread listening for messages - private Thread _queueThread; + private Thread queueThread; // IO port - private IIncomingPort _portIn; + private IIncomingPort portIn; - private string _destination; + private string destination; - private Type domainEvents; /// /// ServiceId of the proxy on the bus /// - private string _serviceId; + private string serviceId; /// /// DomainType string required for OpenengSb /// - private string _domainType; + private string domainType; /// /// domain-instance to act as reverse-proxy for /// - private T _domainService; - public T DomainService - { - get { return _domainService; } - } - + private T domainService; /// /// flag indicating if the listening thread should run /// - private bool _isEnabled; + private bool isEnabled; - private IMarshaller _marshaller; + private IMarshaller marshaller; /// /// Identifies the service-instance. /// - private ConnectorId _connectorId; - - public DomainReverseProxy(T domainService, string host, string serviceId, string domainType,Type domainEvents) + private ConnectorId connectorId; + #endregion + #region Propreties + public T DomainService { - this.domainEvents=domainEvents; - _marshaller = new JsonMarshaller(); - _isEnabled = true; - _domainService = domainService; - _destination = Destination.CreateDestinationString(host, serviceId); - _queueThread = null; - _serviceId = serviceId; - _domainType = domainType; - _portIn = new JmsIncomingPort(_destination); - _connectorId = null; + get { return domainService; } } - + #endregion + #region Constructors + /// + /// Default constructor + /// + /// LocalDomain + /// Host + /// ServiceId + /// name of the remote Domain + /// Type of the remoteDomainEvents + public DomainReverseProxy(T localDomainService, string host, string serviceId, string domainType) + { + this.marshaller = new JsonMarshaller(); + this.isEnabled = true; + this.domainService = localDomainService; + this.destination = Destination.CreateDestinationString(host, serviceId); + this.queueThread = null; + this.serviceId = serviceId; + this.domainType = domainType; + this.portIn = new JmsIncomingPort(destination); + this.connectorId = null; + this.username = "admin"; + this.password = "password"; + } + /// + /// Default constructor + /// + /// LocalDomain + /// Host + /// ServiceId + /// name of the remote Domain + /// Type of the remoteDomainEvents + /// Username for the authentification + /// Password for the authentification + public DomainReverseProxy(T localDomainService, string host, string serviceId, string domainType, String username, String password) + { + this.marshaller = new JsonMarshaller(); + this.isEnabled = true; + this.domainService = localDomainService; + this.destination = Destination.CreateDestinationString(host, serviceId); + this.queueThread = null; + this.serviceId = serviceId; + this.domainType = domainType; + this.portIn = new JmsIncomingPort(destination); + this.connectorId = null; + this.username = username; + this.password = password; + } + #endregion + #region Public Methods /// /// Starts a thread which waits for messages. /// An exception will be thrown, if the method has already been called. /// public void Start() { - if (_queueThread != null) + if (queueThread != null) throw new ApplicationException("QueueThread already started!"); - _isEnabled = true; + isEnabled = true; CreateRemoteProxy(); // start thread which waits for messages - _queueThread = new Thread( + queueThread = new Thread( new ThreadStart(Listen) ); - _queueThread.Start(); + queueThread.Start(); } - + #endregion + #region Private Methods /// /// Creates an Proxy on the bus. /// private void CreateRemoteProxy() { IDictionary metaData = new Dictionary(); - metaData.Add("serviceId", _CREATION_SERVICE_ID); + metaData.Add("serviceId", CREATION_SERVICE_ID); Guid id = Guid.NewGuid(); String classname = "org.openengsb.core.api.security.model.UsernamePasswordAuthenticationInfo"; @@ -133,21 +178,19 @@ private void CreateRemoteProxy() IList classes = new List(); classes.Add("org.openengsb.core.api.model.ConnectorId"); classes.Add("org.openengsb.core.api.model.ConnectorDescription"); - Destination tmp = new Destination(_destination); - tmp.Queue = id.ToString(); - //_destination = tmp.FullDestination; + IList args = new List(); ConnectorDescription connectorDescription = new ConnectorDescription(); - connectorDescription.attributes.Add("serviceId", _serviceId); + connectorDescription.attributes.Add("serviceId", serviceId); connectorDescription.attributes.Add("portId", _CREATION_PORT); - connectorDescription.attributes.Add("destination", _destination); + connectorDescription.attributes.Add("destination", destination); - _connectorId = new ConnectorId(); - _connectorId.connectorType = _CREATION_CONNECTOR_TYPE; - _connectorId.instanceId = _serviceId; - _connectorId.domainType = _domainType; + connectorId = new ConnectorId(); + connectorId.connectorType = _CREATION_CONNECTOR_TYPE; + connectorId.instanceId = serviceId; + connectorId.domainType = domainType; - args.Add(_connectorId); + args.Add(connectorId); args.Add(connectorDescription); MethodCall creationCall = MethodCall.CreateInstance(_CREATION_METHOD_NAME, args, metaData, classes,null); @@ -157,11 +200,11 @@ private void CreateRemoteProxy() MethodCallRequest callRequest = MethodCallRequest.CreateInstance(authentification, message); callRequest.message.methodCall = creationCall; - Destination destination = new Destination(_destination); - destination.Queue = _CREATION_QUEUE; + Destination destinationinfo = new Destination(destination); + destinationinfo.Queue = _CREATION_QUEUE; - IOutgoingPort portOut = new JmsOutgoingPort(destination.FullDestination); - string request = _marshaller.MarshallObject(callRequest); + IOutgoingPort portOut = new JmsOutgoingPort(destinationinfo.FullDestination); + string request = marshaller.MarshallObject(callRequest); portOut.Send(request); } @@ -171,13 +214,13 @@ private void CreateRemoteProxy() private void DeleteRemoteProxy() { IDictionary metaData = new Dictionary(); - metaData.Add("serviceId", _CREATION_SERVICE_ID); + metaData.Add("serviceId", CREATION_SERVICE_ID); IList classes = new List(); classes.Add("org.openengsb.core.api.model.ConnectorId"); IList args = new List(); - args.Add(_connectorId); + args.Add(connectorId); MethodCall deletionCall = MethodCall.CreateInstance(_CREATION_DELETE_METHOD_NAME, args, metaData, classes,null); @@ -189,17 +232,17 @@ private void DeleteRemoteProxy() Message message = Message.createInstance(deletionCall, id.ToString(), true, ""); MethodCallRequest callRequest = MethodCallRequest.CreateInstance(authentification,message); - Destination destination = new Destination(_destination); - destination.Queue = _CREATION_QUEUE; + Destination destinationinfo = new Destination(destination); + destinationinfo.Queue = _CREATION_QUEUE; - IOutgoingPort portOut = new JmsOutgoingPort(destination.FullDestination); - string request = _marshaller.MarshallObject(callRequest); + IOutgoingPort portOut = new JmsOutgoingPort(destinationinfo.FullDestination); + string request = marshaller.MarshallObject(callRequest); portOut.Send(request); - IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(destination.Host, callRequest.message.callId)); + IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(destinationinfo.Host, callRequest.message.callId)); string reply = portIn.Receive(); - MethodResultMessage result = _marshaller.UnmarshallObject(reply, typeof(MethodResultMessage)) as MethodResultMessage; + MethodResultMessage result = marshaller.UnmarshallObject(reply, typeof(MethodResultMessage)) as MethodResultMessage; if (result.message.result.type == MethodResult.ReturnType.Exception) throw new ApplicationException("Remote Exception while deleting service proxy"); } @@ -209,21 +252,21 @@ private void DeleteRemoteProxy() /// private void Listen() { - while (_isEnabled) + while (isEnabled) { - String textMsg = _portIn.Receive(); + String textMsg = portIn.Receive(); if (textMsg == null) continue; - MethodCallRequest methodCallRequest = _marshaller.UnmarshallObject(textMsg, typeof(MethodCallRequest)) as MethodCallRequest; + MethodCallRequest methodCallRequest = marshaller.UnmarshallObject(textMsg, typeof(MethodCallRequest)) as MethodCallRequest; MethodResultMessage methodReturnMessage = CallMethod(methodCallRequest); if (methodCallRequest.message.answer) { - string returnMsg = _marshaller.MarshallObject(methodReturnMessage); - Destination dest = new Destination(_destination); + string returnMsg = marshaller.MarshallObject(methodReturnMessage); + Destination dest = new Destination(destination); IOutgoingPort portOut = new JmsOutgoingPort(Destination.CreateDestinationString(dest.Host, methodCallRequest.message.callId)); portOut.Send(returnMsg); } @@ -246,7 +289,7 @@ private MethodResultMessage CallMethod(MethodCallRequest request) object returnValue = null; try { - returnValue = methInfo.Invoke(_domainService, arguments); + returnValue = methInfo.Invoke(domainService, arguments); } catch (Exception ex) { @@ -266,9 +309,9 @@ private MethodResultMessage CallMethod(MethodCallRequest request) /// /// Builds an return message. /// - /// - /// - /// + /// Type + /// Return Value + /// Correlation Id /// private MethodResultMessage CreateMethodReturn(MethodResult.ReturnType type, object returnValue, string correlationId) { @@ -299,7 +342,7 @@ private object[] CreateMethodArguments(MethodCall methodCall) { IList args = new List(); - Assembly asm = domainEvents.GetType().Assembly; + Assembly asm = typeof(T).GetType().Assembly; for (int i = 0; i < methodCall.args.Count; ++i) { object arg = methodCall.args[i]; @@ -323,7 +366,7 @@ private object[] CreateMethodArguments(MethodCall methodCall) } else { - obj = _marshaller.UnmarshallObject(arg.ToString(), type); + obj = marshaller.UnmarshallObject(arg.ToString(), type); } args.Add(obj); } @@ -335,34 +378,34 @@ private object[] CreateMethodArguments(MethodCall methodCall) /// Tries to find the method that should be called. /// TODO remove " if (methodCallWrapper.args.Count > methodCallWrapper.classes.Count)" if the Bug OPENENGSB-2423/OPENENGSB-2429 is fixed /// - /// - /// - private MethodInfo FindMethodInDomain(MethodCall methodCallWrapper) + /// Method Call information + /// MethodInfo + private MethodInfo FindMethodInDomain(MethodCall methodCall) { - if (methodCallWrapper.args.Count > methodCallWrapper.classes.Count) + if (methodCall.args.Count > methodCall.classes.Count) { - int tmp=methodCallWrapper.args.Count - methodCallWrapper.classes.Count; + int tmp=methodCall.args.Count - methodCall.classes.Count; int i; Object[] tmttt = new object[1]; String test = tmttt.GetType().ToString(); for (i = 0;i /// Tests if the list of type names are equal to the types of the method parameter. /// - /// - /// - /// + /// TypeSting + /// Parameter Infos + /// If types are equal private bool TypesAreEqual(IList typeStrings, ParameterInfo[] parameterInfos) { if (typeStrings.Count != parameterInfos.Length) @@ -399,9 +442,9 @@ private bool TypesAreEqual(IList typeStrings, ParameterInfo[] parameterI /// Test if two types are equal /// TODO remove "null" if the Bug OPENENGSB-2423/OPENENGSB-2429 is fixed /// - /// - /// - /// + /// Remote Type + /// Local Type + /// If to types are equal private bool TypeIsEqual(string remoteType, Type localType) { if (remoteType.Equals("null")) return true; @@ -415,10 +458,10 @@ private bool TypeIsEqual(string remoteType, Type localType) /// public void Stop() { - if (_queueThread != null) + if (queueThread != null) { - _isEnabled = false; - _portIn.Close(); + isEnabled = false; + portIn.Close(); DeleteRemoteProxy(); } } diff --git a/bridge/src/lib/RealDomainService/Remote/LocalType.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/LocalType.cs similarity index 94% rename from bridge/src/lib/RealDomainService/Remote/LocalType.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/LocalType.cs index b17887e..faf07fe 100644 --- a/bridge/src/lib/RealDomainService/Remote/LocalType.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/LocalType.cs @@ -19,7 +19,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// This class maps remote types on the bus to local types. diff --git a/bridge/src/lib/RealDomainService/Remote/Authentification.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Authentification.cs similarity index 90% rename from bridge/src/lib/RealDomainService/Remote/Authentification.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Authentification.cs index 7a79325..f62f9cc 100644 --- a/bridge/src/lib/RealDomainService/Remote/Authentification.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Authentification.cs @@ -20,17 +20,19 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// Container for the Authentification /// public class Authentification { + #region Variables public String className { get; set; } public Data data { get; set; } public BinaryData binaryData { get; set; } - + #endregion + #region Public static Mehtod /// /// Creates a new instance of the Authentification /// @@ -46,5 +48,6 @@ public static Authentification createInstance(String className, Data data, Binar instance.binaryData = binaryData; return instance; } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Remote/BinaryData.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/BinaryData.cs similarity index 79% rename from bridge/src/lib/RealDomainService/Remote/BinaryData.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/BinaryData.cs index 564cdfd..52ad4dc 100644 --- a/bridge/src/lib/RealDomainService/Remote/BinaryData.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/BinaryData.cs @@ -20,16 +20,22 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// Container for the Binary Data /// public class BinaryData { + #region Public static Methods + /// + /// Creates an Instance of BinaryData + /// + /// A new instance of BinarayData public static BinaryData CreateInstance() { return new BinaryData(); } + #endregion } } diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorDescription.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorDescription.cs new file mode 100644 index 0000000..a30d526 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorDescription.cs @@ -0,0 +1,45 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote +{ + /// + /// This class represents an Connector instance on the bus. + /// + public class ConnectorDescription + { + #region Variables + public IDictionary properties { get; set; } + public IDictionary attributes { get; set; } + #endregion + #region Constructor + /// + /// Default constructor + /// + public ConnectorDescription() + { + attributes = new Dictionary(); + properties = new Dictionary(); + } + #endregion + } +} diff --git a/bridge/src/lib/ServiceManager/App.xaml.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorId.cs similarity index 71% rename from bridge/src/lib/ServiceManager/App.xaml.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorId.cs index 4114fa6..2d80337 100644 --- a/bridge/src/lib/ServiceManager/App.xaml.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/ConnectorId.cs @@ -17,17 +17,20 @@ using System; using System.Collections.Generic; -using System.Configuration; -using System.Data; using System.Linq; -using System.Windows; +using System.Text; -namespace ServiceManager +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// - /// Interaction logic for App.xaml + /// This class indentifies an Connector instance on the bus. /// - public partial class App : Application + public class ConnectorId { + #region Variables + public String domainType { get; set; } + public String connectorType { get; set; } + public String instanceId { get; set; } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Remote/Data.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Data.cs similarity index 89% rename from bridge/src/lib/RealDomainService/Remote/Data.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Data.cs index ef73d1e..9c21962 100644 --- a/bridge/src/lib/RealDomainService/Remote/Data.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Data.cs @@ -19,16 +19,18 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// Container for the datas /// public class Data { + #region Variables public String username { get; set; } public String password { get; set; } - + #endregion + #region Public static Methods /// /// Creates a new instance of Data /// @@ -42,5 +44,6 @@ public static Data CreateInstance(String username, String password) instance.password = password; return instance; } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Remote/Message.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Message.cs similarity index 91% rename from bridge/src/lib/RealDomainService/Remote/Message.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Message.cs index 6b41702..32c2425 100644 --- a/bridge/src/lib/RealDomainService/Remote/Message.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/Message.cs @@ -20,18 +20,20 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// Container for Message /// public class Message { + #region Variables public MethodCall methodCall { get; set; } public string callId { get; set; } public bool answer { get; set; } public string destination { get; set; } - + #endregion + #region Public static Methods /// /// Creates a new instance of Message /// @@ -49,5 +51,6 @@ public static Message createInstance(MethodCall methodCall, string callId, bool instance.destination = destination; return instance; } + #endregion } } diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MessageResult.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MessageResult.cs new file mode 100644 index 0000000..af9b846 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MessageResult.cs @@ -0,0 +1,50 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote +{ + /// + /// Container for MessageResult + /// + public class MessageResult + { + #region Variables + public MethodResult result { get; set; } + public string callId { get; set; } + #endregion + #region Public static Method + /// + /// Creates a new instance of MessageResult + /// + /// Result + /// CallId + /// returns a new instance of MessageResult + public static MessageResult CreateInstance(MethodResult result, string callId) + { + MessageResult msg = new MessageResult(); + msg.result = result; + msg.callId = callId; + return msg; + } + #endregion + } +} diff --git a/bridge/src/lib/RealDomainService/Remote/MethodCall.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCall.cs similarity index 92% rename from bridge/src/lib/RealDomainService/Remote/MethodCall.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCall.cs index 52494a7..d6b6eb0 100644 --- a/bridge/src/lib/RealDomainService/Remote/MethodCall.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCall.cs @@ -19,13 +19,14 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// This class represents a RPC with its parameters, return types etc. /// public class MethodCall { + #region Variables /// /// Fully qualified class names of the arguments. /// @@ -48,7 +49,8 @@ public class MethodCall /// Include the packagestruktur on the java side /// public IList realClassImplementation { get; set; } - + #endregion + #region Public static Methods public static MethodCall CreateInstance(string methodName, IList args, IDictionary metaData, IList classes, IList realClassImplementation) { MethodCall call = new MethodCall(); @@ -59,5 +61,6 @@ public static MethodCall CreateInstance(string methodName, IList args, I call.realClassImplementation = realClassImplementation; return call; } + #endregion } } diff --git a/bridge/src/lib/RealDomainService/Remote/MethodCallRequest.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCallRequest.cs similarity index 90% rename from bridge/src/lib/RealDomainService/Remote/MethodCallRequest.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCallRequest.cs index 4b60b65..82b9bc6 100644 --- a/bridge/src/lib/RealDomainService/Remote/MethodCallRequest.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodCallRequest.cs @@ -20,17 +20,19 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// Container for MethodCallRequest /// public class MethodCallRequest { + #region Variables public Authentification authenticationData { get; set; } public Message message { get; set; } public long timestamp{get;set;} - + #endregion + #region Public static Methods /// /// Creates a new instance of MessageCallRequest /// @@ -45,5 +47,6 @@ public static MethodCallRequest CreateInstance(Authentification authenticationDa request.timestamp = DateTime.Now.Ticks; return request; } + #endregion } } diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResult.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResult.cs new file mode 100644 index 0000000..f133f03 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResult.cs @@ -0,0 +1,72 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote +{ + /// + /// This class represents the return value of an RPC. + /// + public class MethodResult + { + #region Variables + public enum ReturnType { Void, Object, Exception } + + /// + /// Type of the return value. + /// + public ReturnType type { get; set; } + + /// + /// Return value of the RPC. + /// + public object arg { get; set; } + + /// + /// Metadata + /// + public IDictionary metaData { get; set; } + + /// + /// Fully qualified class name of the return value. + /// + public string className { get; set; } + #endregion + #region Public static Methods + /// + /// Creates an instance + /// + /// Returntype + /// Arguments + /// MetaDatas + /// ClassName + /// New instance of MethodResult + public static MethodResult CreateInstance(ReturnType type, object arg, IDictionary metaData, string className) + { + MethodResult result = new MethodResult(); + result.type = type; + result.arg = arg; + result.metaData = metaData; + result.className = className; + return result; + } + #endregion + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResultMessage.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResultMessage.cs new file mode 100644 index 0000000..1eabe5a --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteObjects/MethodResultMessage.cs @@ -0,0 +1,47 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote +{ + /// + /// Container for MethodResultMessage + /// + public class MethodResultMessage + { + #region Variables + public MessageResult message { get; set; } + #endregion + #region Public static Methods + /// + /// Creates a new instance of MethodResultMessage + /// + /// Message + /// Returns a new instance of MethodResultMessage + public static MethodResultMessage CreateInstance(MessageResult message) + { + MethodResultMessage instance=new MethodResultMessage(); + instance.message = message; + return instance; + } + #endregion + } +} diff --git a/bridge/src/lib/RealDomainService/Remote/RemoteType.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteType.cs similarity index 82% rename from bridge/src/lib/RealDomainService/Remote/RemoteType.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteType.cs index 925dee6..22d4bf5 100644 --- a/bridge/src/lib/RealDomainService/Remote/RemoteType.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB2_4_0/Remote/RemoteType.cs @@ -20,26 +20,36 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB2_4_0.Remote { /// /// This class maps a local type to a bus side type. /// public class RemoteType { + #region Propreties public string FullName { get; set; } public string Name { get; set; } public string LocalTypeFullName { get; set; } - + #endregion + #region Constructor + /// + /// Default constructor + /// + /// Type in a String format public RemoteType(string typeString) { FullName = typeString; Name = FullName.Split('.').Last().Trim(); SetLocalTypeFullName(); } - + #endregion + #region Public Methods + /// + /// Find the name of the local Type + /// public void SetLocalTypeFullName() { // Workaround: built-in types. @@ -66,5 +76,6 @@ public void SetLocalTypeFullName() // Workaround: event-keyword LocalTypeFullName = builder.ToString().Replace(".event","._event"); } + #endregion } } diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/RealDomainFactory.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/RealDomainFactory.cs new file mode 100644 index 0000000..30ece3b --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/RealDomainFactory.cs @@ -0,0 +1,122 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Common; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0 +{ + /// + /// This class produces and manages proxies. + /// + public class RealDomainFactory : IDomainFactory + { + private Dictionary _proxies; + private String serviceId; + private String domainType; + public RealDomainFactory() + { + Reset(); + } + + private void Reset() + { + _proxies = new Dictionary(); + } + + /// + /// Creates, registers and starts a reverse proxy. + /// + /// + /// + /// + /// + /// local domain + /// remote domain + public void RegisterDomainService(string destination, T domainService, String domainType) + { + this.domainType = domainType; + this.serviceId = Guid.NewGuid().ToString(); + DomainReverseProxy proxy = new DomainReverseProxy(domainService, destination, serviceId, domainType); + _proxies.Add(domainService, proxy); + proxy.Start(); + } + /// + /// Creates, registers and starts a reverse proxy. + /// + /// + /// + /// + /// + /// local domain + /// remote domain + /// Username for the authentification + /// Password for the authentification + public void RegisterDomainService(string destination, T domainService, String domainType,String username,String password) + { + this.domainType = domainType; + this.serviceId = Guid.NewGuid().ToString(); + DomainReverseProxy proxy = new DomainReverseProxy(domainService, destination, serviceId, domainType,username,password); + _proxies.Add(domainService, proxy); + proxy.Start(); + } + /// + /// Deletes and stops the reverse proxy. + /// + /// + public void UnregisterDomainService(object service) + { + IStoppable stoppable = null; + if(_proxies.TryGetValue(service, out stoppable)) + { + stoppable.Stop(); + _proxies.Remove(service); + } + } + /// + /// Get Eventhandler from the spezified Domain T with authentification + /// + /// Remote Domain + /// Host + /// Username for the authentification + /// Password for the authentificaiton + /// Eventhandler + public T getEventhandler(string host,String username,String password) + { + return new DomainProxy(host, getDomainTypServiceId(), domainType,username,password).GetTransparentProxy(); + } + /// + /// Get Eventhandler from the spezified Domain T + /// + /// Remote Domain + /// Host + /// Eventhandler + public T getEventhandler(string host) + { + return new DomainProxy(host, getDomainTypServiceId(),domainType).GetTransparentProxy(); + } + public String getDomainTypServiceId() + { + return domainType + "+external-connector-proxy+" + serviceId; + } + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainProxy.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainProxy.cs new file mode 100644 index 0000000..96c87c0 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainProxy.cs @@ -0,0 +1,251 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.Remoting.Proxies; +using System.Runtime.Remoting.Messaging; +using System.Web.Services.Protocols; +using System.Reflection; +using System.IO; +using System.Xml.Serialization; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Json; +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote +{ + /// + /// This class generates generic proxies. All method calls will be forwared to the configured server. + /// + /// Type to proxy. + public class DomainProxy : RealProxy + { + #region Variables + /// + /// Username for the authentification + /// + private String username; + /// + /// Password for the authentification + /// + private String password; + /// + /// Name of the queue the server listens to for calls. + /// + private const string HOST_QUEUE = "receive"; + + /// + /// Id identifying the service instance on the bus. + /// + private string serviceId; + /// + /// Domain type + /// + private string domainType; + + /// + /// Host string of the server. + /// + private string host; + + private IMarshaller marshaller; + #endregion + #region Constructors + public DomainProxy(string host, string serviceId, String domainType) + : base(typeof(T)) + { + this.serviceId = serviceId; + this.domainType = domainType; + this.host = host; ; + this.marshaller = new JsonMarshaller(); + this.username = "admin"; + this.password = "password"; + } + public DomainProxy(string host, string serviceId, String domainType,String username,String password) + : base(typeof(T)) + { + this.serviceId = serviceId; + this.domainType = domainType; + this.host = host; ; + this.marshaller = new JsonMarshaller(); + this.username = username; + this.password = password; + } + #endregion + #region Public Methods + /// + /// Will be invoked when a call to the proxy has been made. + /// + /// + /// + public override IMessage Invoke(IMessage msg) + { + IMethodCallMessage callMessage = msg as IMethodCallMessage; + SecureMethodCallRequest methodCallRequest = ToMethodCallRequest(callMessage); + string methodCallMsg = marshaller.MarshallObject(methodCallRequest); + IOutgoingPort portOut = new JmsOutgoingPort(Destination.CreateDestinationString(host, HOST_QUEUE)); + portOut.Send(methodCallMsg); + IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(host, methodCallRequest.message.callId)); + string methodReturnMsg = portIn.Receive(); + MethodResultMessage methodReturn = marshaller.UnmarshallObject(methodReturnMsg, typeof(MethodResultMessage)) as MethodResultMessage; + return ToMessage(methodReturn.message.result, callMessage); + } + public new T GetTransparentProxy() + { + return (T)base.GetTransparentProxy(); + } + #endregion + #region Private methods + /// + /// Builds an IMessage using MethodReturn. + /// + /// Servers return message + /// + /// + private IMessage ToMessage(MethodResult methodReturn, IMethodCallMessage callMessage) + { + IMethodReturnMessage returnMessage = null; + switch (methodReturn.type) + { + case MethodResult.ReturnType.Exception: + returnMessage = new ReturnMessage((Exception)methodReturn.arg, callMessage); + break; + case MethodResult.ReturnType.Void: + case MethodResult.ReturnType.Object: + returnMessage = new ReturnMessage(methodReturn.arg, null, 0, null, callMessage); + break; + default: + return null; + } + return returnMessage; + } + + /// + /// Takes a Namespace as input, reverse the elements and returns the package structure from java + /// + /// Namespace URL + /// Java Package structure + private String reverseURL(String url) + { + String tmp=url.Replace("http://",""); + tmp=tmp.Replace("/",""); + String[] elements = tmp.Split('.'); + int i; + String result=""; + for (i = elements.Length-1; i >= 0; i--) + { + if (i != 0) result += elements[i] + "."; + else result += elements[i]; + } + return result; + } + + /// + /// Search in the interface for the Namespace (equal to the package structure in java) + /// + /// Method name or Parameter name + /// Packagename + private String getPackageName(String fieldname) + { + Type type = typeof(T); + MethodInfo method = type.GetMethod(fieldname); + //Tests if it is a Mehtod or a Type + if (method != null) + { + SoapDocumentMethodAttribute soapAttribute; + foreach (Attribute attribute in method.GetCustomAttributes(false)) + { + if (attribute is SoapDocumentMethodAttribute) + { + soapAttribute = attribute as SoapDocumentMethodAttribute; + return reverseURL(soapAttribute.RequestNamespace); + } + } + } + else + { + Assembly ass = typeof(T).Assembly; + type = ass.GetType(fieldname); + foreach (Attribute attribute in Attribute.GetCustomAttributes(type)) + { + if (attribute is XmlTypeAttribute) + { + XmlTypeAttribute xmltype = attribute as XmlTypeAttribute; + return reverseURL(xmltype.Namespace); + } + } + } + throw new MethodAccessException("Fieldname doesn't have a corresponding attribute (Namepspace) or the attribute couldn't be found"); + } + /// + /// Makes the first character to a upper character + /// + /// Element to edit + /// String with the first character upper + private String firstLetterToUpper(String element) + { + if (element.Length <= 1) return element.ToUpper(); + String first = element.Substring(0, 1); + first = first.ToUpper(); + String tmp = element.Substring(1); + return first + tmp; + } + + /// + /// Builds an MethodCall using IMethodCallMessage. + /// TODO if bug ??? is fixed replace classes.Add(getPackageName(type.RemoteTypeFullName) + ".event." + firstLetterToUpper(type.RemoteTypeFullName)); with classes.Add(getPackageName(type.RemoteTypeFullName) + "." + firstLetterToUpper(type.RemoteTypeFullName)); + /// + /// + /// + /// MethodCallRequest + private SecureMethodCallRequest ToMethodCallRequest(IMethodCallMessage msg) + { + Guid id = Guid.NewGuid(); + + string methodName = msg.MethodName; + Dictionary metaData = new Dictionary(); + //The structure is always domain.DOMAINTYPE.events + metaData.Add("serviceId", "domain." + domainType + ".events"); + + // arbitrary string, maybe not necessary + metaData.Add("contextId", "foo"); + + List classes = new List(); + //realClassImplementation is optinal + + //List realClassImplementation = new List(); + + foreach (object arg in msg.Args) + { + LocalType type = new LocalType(arg.GetType()); + // realClassImplementation.Add(getPackageName(type.RemoteTypeFullName)); + classes.Add(getPackageName(type.RemoteTypeFullName) + "." + firstLetterToUpper(type.RemoteTypeFullName)); + } + + RemoteMethodCall call = RemoteMethodCall.CreateInstance(methodName, msg.Args, metaData, classes); + String classname = "org.openengsb.connector.usernamepassword.Password"; + Data data = Data.CreateInstance("password"); + AuthenticationInfo authentification = AuthenticationInfo.createInstance(classname,data); + Message message = Message.createInstance(call, id.ToString(), true, ""); + return SecureMethodCallRequest.createInstance("admin",authentification, message); + } + #endregion + + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainReverseProxy.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainReverseProxy.cs new file mode 100644 index 0000000..1d42d7c --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/DomainReverseProxy.cs @@ -0,0 +1,460 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Reflection; +using System.IO; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Json; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication.Jms; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Communication; +using Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.Common; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote +{ + /// + /// This class builds reverse proxies for resources (class instances) on the + /// client side for the bus. + /// + /// + public class DomainReverseProxy: IStoppable + { + private const string _CREATION_QUEUE = "receive"; + private const string CREATION_SERVICE_ID = "connectorManager"; + private const string _CREATION_METHOD_NAME = "create"; + private const string _CREATION_DELETE_METHOD_NAME = "delete"; + private const string _CREATION_PORT = "jms-json"; + private const string _CREATION_CONNECTOR_TYPE = "external-connector-proxy"; + + /// + /// Username for the authentification + /// + private String username; + /// + /// Username for the password + /// + private String password; + // Thread listening for messages + private Thread queueThread; + + // IO port + private IIncomingPort portIn; + + private string destination; + + /// + /// ServiceId of the proxy on the bus + /// + private string serviceId; + + /// + /// DomainType string required for OpenengSb + /// + private string domainType; + + /// + /// domain-instance to act as reverse-proxy for + /// + private T domainService; + public T DomainService + { + get { return domainService; } + } + + /// + /// flag indicating if the listening thread should run + /// + + private bool isEnabled; + + private IMarshaller marshaller; + + /// + /// Identifies the service-instance. + /// + private ConnectorId connectorId; + /// + /// Default constructor + /// + /// LocalDomain + /// Host + /// ServiceId + /// name of the remote Domain + /// Type of the remoteDomainEvents + public DomainReverseProxy(T localDomainService, string host, string serviceId, string domainType) + { + this.marshaller = new JsonMarshaller(); + this.isEnabled = true; + this.domainService = localDomainService; + this.destination = Destination.CreateDestinationString(host, serviceId); + this.queueThread = null; + this.serviceId = serviceId; + this.domainType = domainType; + this.portIn = new JmsIncomingPort(destination); + this.connectorId = null; + this.username = "admin"; + this.password = "password"; + } + /// + /// Default constructor + /// + /// LocalDomain + /// Host + /// ServiceId + /// name of the remote Domain + /// Type of the remoteDomainEvents + /// Username for the authentification + /// Password for the authentification + public DomainReverseProxy(T localDomainService, string host, string serviceId, string domainType,String username,String password) + { + this.marshaller = new JsonMarshaller(); + this.isEnabled = true; + this.domainService = localDomainService; + this.destination = Destination.CreateDestinationString(host, serviceId); + this.queueThread = null; + this.serviceId = serviceId; + this.domainType = domainType; + this.portIn = new JmsIncomingPort(destination); + this.connectorId = null; + this.username = username; + this.password = password; + } + + /// + /// Starts a thread which waits for messages. + /// An exception will be thrown, if the method has already been called. + /// + public void Start() + { + if (queueThread != null) + throw new ApplicationException("QueueThread already started!"); + + isEnabled = true; + CreateRemoteProxy(); + // start thread which waits for messages + queueThread = new Thread( + new ThreadStart(Listen) + ); + + queueThread.Start(); + } + + /// + /// Creates an Proxy on the bus. + /// TODO Change hardcoded Password and Username + /// + private void CreateRemoteProxy() + { + IDictionary metaData = new Dictionary(); + metaData.Add("serviceId", CREATION_SERVICE_ID); + Guid id = Guid.NewGuid(); + + String classname = "org.openengsb.connector.usernamepassword.Password"; + + IList classes = new List(); + classes.Add("org.openengsb.core.api.model.ConnectorId"); + classes.Add("org.openengsb.core.api.model.ConnectorDescription"); + + IList args = new List(); + ConnectorDescription connectorDescription = new ConnectorDescription(); + connectorDescription.attributes.Add("serviceId", serviceId); + connectorDescription.attributes.Add("portId", _CREATION_PORT); + connectorDescription.attributes.Add("destination", destination); + + connectorId = new ConnectorId(); + connectorId.connectorType = _CREATION_CONNECTOR_TYPE; + connectorId.instanceId = serviceId; + connectorId.domainType = domainType; + + args.Add(connectorId); + args.Add(connectorDescription); + + RemoteMethodCall creationCall = RemoteMethodCall.CreateInstance(_CREATION_METHOD_NAME, args, metaData, classes); + Message message = Message.createInstance(creationCall, id.ToString(), true, ""); + + Destination destinationinfo = new Destination(destination); + destinationinfo.Queue = _CREATION_QUEUE; + + Data data=Data.CreateInstance(password); + AuthenticationInfo autinfo=AuthenticationInfo.createInstance(classname,data); + SecureMethodCallRequest secureRequest = SecureMethodCallRequest.createInstance(username, autinfo, message); + IOutgoingPort portOut = new JmsOutgoingPort(destinationinfo.FullDestination); + string request = marshaller.MarshallObject(secureRequest); + portOut.Send(request); + } + + /// + /// Deletes the created remote proxy on the bus. + /// + private void DeleteRemoteProxy() + { + IDictionary metaData = new Dictionary(); + metaData.Add("serviceId", CREATION_SERVICE_ID); + + IList classes = new List(); + classes.Add("org.openengsb.core.api.model.ConnectorId"); + + IList args = new List(); + args.Add(connectorId); + + RemoteMethodCall deletionCall = RemoteMethodCall.CreateInstance(_CREATION_DELETE_METHOD_NAME, args, metaData, classes); + + Guid id = Guid.NewGuid(); + String classname = "org.openengsb.connector.usernamepassword.Password"; + Data data = Data.CreateInstance(password); + AuthenticationInfo authentification = AuthenticationInfo.createInstance(classname, data); + + Message message = Message.createInstance(deletionCall, id.ToString(), true, ""); + SecureMethodCallRequest callRequest = SecureMethodCallRequest.createInstance(username,authentification,message); + + Destination destinationinfo = new Destination(destination); + destinationinfo.Queue = _CREATION_QUEUE; + + IOutgoingPort portOut = new JmsOutgoingPort(destinationinfo.FullDestination); + string request = marshaller.MarshallObject(callRequest); + portOut.Send(request); + + IIncomingPort portIn = new JmsIncomingPort(Destination.CreateDestinationString(destinationinfo.Host, callRequest.message.callId)); + string reply = portIn.Receive(); + + MethodResultMessage result = marshaller.UnmarshallObject(reply, typeof(MethodResultMessage)) as MethodResultMessage; + if (result.message.result.type == MethodResult.ReturnType.Exception) + throw new ApplicationException("Remote Exception while deleting service proxy"); + } + + /// + /// Blocks an waits for messages. + /// + private void Listen() + { + while (isEnabled) + { + String textMsg = portIn.Receive(); + + if (textMsg == null) + continue; + SecureMethodCallRequest methodCallRequest = marshaller.UnmarshallObject(textMsg, typeof(SecureMethodCallRequest)) as SecureMethodCallRequest; + + MethodResultMessage methodReturnMessage = CallMethod(methodCallRequest); + + if (methodCallRequest.message.answer) + { + string returnMsg = marshaller.MarshallObject(methodReturnMessage); + Destination dest = new Destination(destination); + IOutgoingPort portOut = new JmsOutgoingPort(Destination.CreateDestinationString(dest.Host, methodCallRequest.message.callId)); + portOut.Send(returnMsg); + } + } + } + + /// + /// Calls a method according to MethodCall. + /// + /// Description of the call. + /// + private MethodResultMessage CallMethod(SecureMethodCallRequest request) + { + MethodInfo methInfo = FindMethodInDomain(request.message.methodCall); + if (methInfo == null) + throw new ApplicationException("No corresponding method found"); + + object[] arguments = CreateMethodArguments(request.message.methodCall); + + object returnValue = null; + try + { + returnValue = methInfo.Invoke(domainService, arguments); + } + catch (Exception ex) + { + return CreateMethodReturn(MethodResult.ReturnType.Exception, ex, request.message.callId); + } + + MethodResultMessage returnMsg = null; + + if (returnValue == null) + returnMsg = CreateMethodReturn(MethodResult.ReturnType.Void, "null", request.message.callId); + else + returnMsg = CreateMethodReturn(MethodResult.ReturnType.Object, returnValue, request.message.callId); + + return returnMsg; + } + + /// + /// Builds an return message. + /// + /// + /// + /// + /// + private MethodResultMessage CreateMethodReturn(MethodResult.ReturnType type, object returnValue, string correlationId) + { + MethodResult methodResult = new MethodResult(); + methodResult.type = type; + methodResult.arg = returnValue; + MethodResultMessage methodResultMessage = new MethodResultMessage(); + methodResultMessage.message=new MessageResult(); + methodResultMessage.message.callId = correlationId; + + if (returnValue == null) + methodResult.className = "null"; + else + methodResult.className = new LocalType(returnValue.GetType()).RemoteTypeFullName; + + methodResult.metaData = new Dictionary(); + + methodResultMessage.message.result = methodResult; + return methodResultMessage; + } + + /// + /// Unmarshalls the arguments of a MethodCall. + /// + /// MethodCall + /// Arguments + private object[] CreateMethodArguments(RemoteMethodCall methodCall) + { + IList args = new List(); + + Assembly asm = typeof(T).GetType().Assembly; + for (int i = 0; i < methodCall.args.Count; ++i) + { + object arg = methodCall.args[i]; + RemoteType remoteType = new RemoteType(methodCall.classes[i]); + Type type = asm.GetType(remoteType.LocalTypeFullName); + + if (type == null) + type = Type.GetType(remoteType.LocalTypeFullName); + + if (type == null) + throw new ApplicationException("no corresponding local type found"); + + object obj = null; + if (type.IsPrimitive || type.Equals(typeof(string))) + { + obj = arg; + } + else if (type.IsEnum) + { + obj = Enum.Parse(type,(string) arg); + } + else + { + obj = marshaller.UnmarshallObject(arg.ToString(), type); + } + args.Add(obj); + } + + return args.ToArray(); + } + + /// + /// Tries to find the method that should be called. + /// TODO remove " if (methodCallWrapper.args.Count > methodCallWrapper.classes.Count)" if the Bug OPENENGSB-2423/OPENENGSB-2429 is fixed + /// + /// + /// + private MethodInfo FindMethodInDomain(RemoteMethodCall methodCallWrapper) + { + if (methodCallWrapper.args.Count > methodCallWrapper.classes.Count) + { + int tmp=methodCallWrapper.args.Count - methodCallWrapper.classes.Count; + int i; + Object[] tmttt = new object[1]; + String test = tmttt.GetType().ToString(); + for (i = 0;i + /// Tests if the list of type names are equal to the types of the method parameter. + /// + /// + /// + /// + private bool TypesAreEqual(IList typeStrings, ParameterInfo[] parameterInfos) + { + if (typeStrings.Count != parameterInfos.Length) + throw new ApplicationException("length of type-string-arrays are not equal"); + + for (int i = 0; i < parameterInfos.Length; ++i) + { + if (!TypeIsEqual(typeStrings[i], parameterInfos[i].ParameterType)) + { + return false; + } + } + + return true; + } + + /// + /// Test if two types are equal + /// TODO remove "null" if the Bug OPENENGSB-2423/OPENENGSB-2429 is fixed + /// + /// + /// + /// + private bool TypeIsEqual(string remoteType, Type localType) + { + if (remoteType.Equals("null")) return true; + RemoteType remote_typ = new RemoteType(remoteType); + // leading underscore fix + return (remote_typ.LocalTypeFullName == localType.FullName); + } + + /// + /// Stops the queue listening for messages and deletes the proxy on the bus. + /// + public void Stop() + { + if (queueThread != null) + { + isEnabled = false; + portIn.Close(); + DeleteRemoteProxy(); + } + } + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/LocalType.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/LocalType.cs new file mode 100644 index 0000000..a94da96 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/LocalType.cs @@ -0,0 +1,48 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote +{ + /// + /// This class maps remote types on the bus to local types. + /// + public class LocalType + { + public string RemoteTypeFullName + { + get + { + if (_type.Equals(typeof(string))) + { + return "java.lang.String"; + } + return _type.FullName; + } + } + + private Type _type; + + public LocalType(Type type) + { + _type = type; + } + } +} diff --git a/bridge/src/lib/RealDomainService/Remote/MethodCallWrapper.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/MethodCallWrapper.cs similarity index 100% rename from bridge/src/lib/RealDomainService/Remote/MethodCallWrapper.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/MethodCallWrapper.cs diff --git a/bridge/src/lib/RealDomainService/Remote/MethodReturnWrapper.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/MethodReturnWrapper.cs similarity index 100% rename from bridge/src/lib/RealDomainService/Remote/MethodReturnWrapper.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/MethodReturnWrapper.cs diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/AuthenticationInfo.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/AuthenticationInfo.cs new file mode 100644 index 0000000..f09f0df --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/AuthenticationInfo.cs @@ -0,0 +1,52 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects +{ + /// + /// Container for the Authentification + /// + public class AuthenticationInfo + { + #region variables + public String className { get; set; } + public Data data { get; set; } + #endregion + #region Public static Methods + /// + /// Creates a new instance of the Authentification + /// + /// ClassName + /// Data + /// Binary Data + /// A new instance of Authentification + public static AuthenticationInfo createInstance(String className, Data data)//, BinaryData binaryData) + { + AuthenticationInfo instance = new AuthenticationInfo(); + instance.className = className; + instance.data = data; + //instance.binaryData = binaryData; + return instance; + } + #endregion + } +} diff --git a/bridge/src/lib/RealDomainService/Remote/ConnectorDescription.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorDescription.cs similarity index 93% rename from bridge/src/lib/RealDomainService/Remote/ConnectorDescription.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorDescription.cs index 6148c96..797acb8 100644 --- a/bridge/src/lib/RealDomainService/Remote/ConnectorDescription.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorDescription.cs @@ -20,7 +20,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { /// /// This class represents an Connector instance on the bus. diff --git a/bridge/src/lib/RealDomainService/Remote/ConnectorId.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorId.cs similarity index 92% rename from bridge/src/lib/RealDomainService/Remote/ConnectorId.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorId.cs index 83eacf5..554142d 100644 --- a/bridge/src/lib/RealDomainService/Remote/ConnectorId.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/ConnectorId.cs @@ -20,7 +20,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { /// /// This class indentifies an Connector instance on the bus. diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Data.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Data.cs new file mode 100644 index 0000000..6daa576 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Data.cs @@ -0,0 +1,45 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects +{ + /// + /// Container for the datas + /// + public class Data + { + // public String username { get; set; } + public String value { get; set; } + + /// + /// Creates a new instance of Data + /// + /// username + /// password + /// New instance of Data + public static Data CreateInstance(String value) + { + Data instance = new Data(); + instance.value= value; + return instance; + } + } +} diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Message.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Message.cs new file mode 100644 index 0000000..51a6300 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/Message.cs @@ -0,0 +1,53 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects +{ + /// + /// Container for Message + /// + public class Message + { + public RemoteMethodCall methodCall { get; set; } + public string callId { get; set; } + public bool answer { get; set; } + public string destination { get; set; } + + /// + /// Creates a new instance of Message + /// + /// MethodCall + /// CallId + /// Answer + /// Destination + /// returns a new Message of CreateInstance + public static Message createInstance(RemoteMethodCall methodCall, string callId, bool answer, string destination) + { + Message instance = new Message(); + instance.methodCall = methodCall; + instance.callId = callId; + instance.answer = answer; + instance.destination = destination; + return instance; + } + } +} diff --git a/bridge/src/lib/RealDomainService/Remote/MessageResult.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MessageResult.cs similarity index 94% rename from bridge/src/lib/RealDomainService/Remote/MessageResult.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MessageResult.cs index 1c55b21..a6e361c 100644 --- a/bridge/src/lib/RealDomainService/Remote/MessageResult.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MessageResult.cs @@ -20,7 +20,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { /// /// Container for MessageResult diff --git a/bridge/src/lib/RealDomainService/Remote/MethodResult.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResult.cs similarity index 95% rename from bridge/src/lib/RealDomainService/Remote/MethodResult.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResult.cs index 497f92d..a8f4e3c 100644 --- a/bridge/src/lib/RealDomainService/Remote/MethodResult.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResult.cs @@ -19,7 +19,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { /// /// This class represents the return value of an RPC. diff --git a/bridge/src/lib/RealDomainService/Remote/MethodResultMessage.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResultMessage.cs similarity index 93% rename from bridge/src/lib/RealDomainService/Remote/MethodResultMessage.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResultMessage.cs index 108e9f7..d155ce3 100644 --- a/bridge/src/lib/RealDomainService/Remote/MethodResultMessage.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/MethodResultMessage.cs @@ -20,7 +20,7 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.RealDomainService.Remote +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { /// /// Container for MethodResultMessage diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/RemoteMethodCall.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/RemoteMethodCall.cs new file mode 100644 index 0000000..e030080 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/RemoteMethodCall.cs @@ -0,0 +1,63 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects +{ + /// + /// This class represents a RPC with its parameters, return types etc. + /// + public class RemoteMethodCall + { + /// + /// Fully qualified class names of the arguments. + /// + public IList classes { get; set; } + /// + /// Name of the method to be called. + /// + public string methodName { get; set; } + + /// + /// Arguments of the call. + /// + public IList args { get; set; } + + /// + /// Metadata + /// + public IDictionary metaData { get; set; } + /// + /// Include the packagestruktur on the java side + /// + // public IList realClassImplementation { get; set; } + + public static RemoteMethodCall CreateInstance(string methodName, IList args, IDictionary metaData, IList classes)//, IList realClassImplementation) + { + RemoteMethodCall call = new RemoteMethodCall(); + call.methodName = methodName; + call.args = args; + call.metaData = metaData; + call.classes = classes; + //call.realClassImplementation = realClassImplementation; + return call; + } + } +} diff --git a/bridge/src/lib/MockupDomainService/SimpleParameterInfo.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/SecureMethodCallRequest.cs similarity index 55% rename from bridge/src/lib/MockupDomainService/SimpleParameterInfo.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/SecureMethodCallRequest.cs index dc8ce19..0a6e51c 100644 --- a/bridge/src/lib/MockupDomainService/SimpleParameterInfo.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteObjects/SecureMethodCallRequest.cs @@ -14,23 +14,28 @@ * See the License for the specific language governing permissions and * limitations under the License. ***/ - using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Reflection; -namespace Org.OpenEngSB.DotNet.Lib.MockupDomainService.MonitorService +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote.RemoteObjects { - public partial class SimpleParameterInfo + public class SecureMethodCallRequest { - public SimpleParameterInfo() { } + public String principal { get; set; } + public AuthenticationInfo credentials { get; set; } + public long timestamp { get; set; } + public Message message { get; set; } - public SimpleParameterInfo(ParameterInfo parameter) + public static SecureMethodCallRequest createInstance(String principal, AuthenticationInfo credentials, Message message) { - this.Name = parameter.Name; - this.ParameterType = new SimpleType(parameter.ParameterType); + SecureMethodCallRequest instance = new SecureMethodCallRequest(); + instance.principal = principal; + instance.credentials = credentials; + instance.timestamp = DateTime.Now.Ticks; + instance.message = message; + return instance; } } } diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteType.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteType.cs new file mode 100644 index 0000000..e4ff14c --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/OpenEngSB3_0_0/Remote/RemoteType.cs @@ -0,0 +1,81 @@ +/*** + * Licensed to the Austrian Association for Software Tool Integration (AASTI) + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. The AASTI licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Implementation.OpenEngSB3_0_0.Remote +{ + /// + /// This class maps a local type to a bus side type. + /// + public class RemoteType + { + #region Propreties + public string FullName { get; set; } + + public string Name { get; set; } + + public string LocalTypeFullName { get; set; } + #endregion + #region Constructor + /// + /// Default constructor + /// + /// Type in a String format + public RemoteType(string typeString) + { + FullName = typeString; + Name = FullName.Split('.').Last().Trim(); + SetLocalTypeFullName(); + } + #endregion + #region Public Methods + /// + /// Find the name of the local Type + /// + public void SetLocalTypeFullName() + { + // Workaround: built-in types. + if (Name == "String") + { + LocalTypeFullName = "System.String"; + return; + } + + StringBuilder builder = new StringBuilder(); + int counter = 1; + for (int i = 0; i < FullName.Length; ++i) + { + if (FullName[i] == '$') + { + builder.Append(counter.ToString()); + } + else + { + builder.Append(FullName[i]); + } + } + + // Workaround: event-keyword + LocalTypeFullName = builder.ToString().Replace(".event","._event"); + } + #endregion + } +} diff --git a/bridge/src/lib/RealDomainService/Properties/AssemblyInfo.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Properties/AssemblyInfo.cs similarity index 88% rename from bridge/src/lib/RealDomainService/Properties/AssemblyInfo.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Properties/AssemblyInfo.cs index cfc16bf..c5e597e 100644 --- a/bridge/src/lib/RealDomainService/Properties/AssemblyInfo.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/Properties/AssemblyInfo.cs @@ -31,6 +31,7 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +// [assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0-SNAPSHOT")] diff --git a/bridge/src/lib/RealDomainService/lib/Apache.NMS.ActiveMQ.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Apache.NMS.ActiveMQ.dll similarity index 100% rename from bridge/src/lib/RealDomainService/lib/Apache.NMS.ActiveMQ.dll rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Apache.NMS.ActiveMQ.dll diff --git a/bridge/src/lib/RealDomainService/lib/Apache.NMS.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Apache.NMS.dll similarity index 100% rename from bridge/src/lib/RealDomainService/lib/Apache.NMS.dll rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Apache.NMS.dll diff --git a/bridge/src/lib/RealDomainService/lib/Newtonsoft.Json.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Newtonsoft.Json.dll similarity index 100% rename from bridge/src/lib/RealDomainService/lib/Newtonsoft.Json.dll rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/Newtonsoft.Json.dll diff --git a/bridge/src/lib/RealDomainService/lib/log4net.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/log4net.dll similarity index 100% rename from bridge/src/lib/RealDomainService/lib/log4net.dll rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/lib/log4net.dll diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/org.openengsb.loom.csharp.common.bridge.Impl.csproj b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/org.openengsb.loom.csharp.common.bridge.Impl.csproj new file mode 100644 index 0000000..2310d77 --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/org.openengsb.loom.csharp.common.bridge.Impl.csproj @@ -0,0 +1,119 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {CE47C6A2-2E5E-466F-B10C-B2B82DE3F7E1} + Library + Properties + org.openengsb.loom.csharp.common.bridge.Implementation + org.openengsb.loom.csharp.common.bridge.Implementation + v4.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + none + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + .references\org.openengsb.wrapped.csharp\log4net-1.2.11_1-SNAPSHOT\log4net.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {5CCD2925-BB25-496E-824F-3894A4FBF968} + org.openengsb.loom.csharp.common.bridge.Interface + + + + + + \ No newline at end of file diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/pom.xml b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/pom.xml new file mode 100644 index 0000000..719811e --- /dev/null +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Implentation/pom.xml @@ -0,0 +1,122 @@ + + + + Bridge-parent + Bridge + 1.0.0-SNAPSHOT + ..\pom.xml + + 4.0.0 + org.openengsb.loom.csharp.common.bridge.Implementation + library + Bridge : org.openengsb.loom.csharp.common.bridge.Implementation + + ./ + + + org.apache.npanday.plugins + maven-compile-plugin + true + + 4.0 + + OpenEngSB2_4_0\RealDomainFactory.cs + OpenEngSB3_0_0\Communication\IIncomingPort.cs + OpenEngSB3_0_0\Communication\IMarshaller.cs + OpenEngSB3_0_0\Communication\IPort.cs + OpenEngSB3_0_0\Communication\Jms\JmsIncomingPort.cs + OpenEngSB3_0_0\Communication\Jms\JmsPort.cs + OpenEngSB3_0_0\Communication\Json\JsonMarshaller.cs + DomainFactoryProvider.cs + Common\IStoppable.cs + OpenEngSB2_4_0\Communication\IIncomingPort.cs + OpenEngSB2_4_0\Communication\IMarshaller.cs + OpenEngSB2_4_0\Communication\IOutgoingPort.cs + OpenEngSB2_4_0\Communication\IPort.cs + OpenEngSB2_4_0\Communication\Jms\Destination.cs + OpenEngSB2_4_0\Communication\Jms\JmsIncomingPort.cs + OpenEngSB2_4_0\Communication\Jms\JmsOutgoingPort.cs + OpenEngSB2_4_0\Communication\Jms\JMSPort.cs + OpenEngSB2_4_0\Communication\Json\JsonMarshaller.cs + OpenEngSB2_4_0\Communication\Json\JsonMethodCallMessage.cs + OpenEngSB2_4_0\Communication\Json\JsonMethodReturnMessage.cs + OpenEngSB2_4_0\Remote\Authentification.cs + OpenEngSB2_4_0\Remote\BinaryData.cs + OpenEngSB2_4_0\Remote\ConnectorDescription.cs + OpenEngSB2_4_0\Remote\ConnectorId.cs + OpenEngSB2_4_0\Remote\Data.cs + OpenEngSB2_4_0\Remote\DomainProxy.cs + OpenEngSB2_4_0\Remote\DomainReverseProxy.cs + OpenEngSB2_4_0\Remote\LocalType.cs + OpenEngSB2_4_0\Remote\Message.cs + OpenEngSB2_4_0\Remote\MessageResult.cs + OpenEngSB2_4_0\Remote\MethodCall.cs + OpenEngSB2_4_0\Remote\MethodCallRequest.cs + OpenEngSB2_4_0\Remote\MethodCallWrapper.cs + OpenEngSB2_4_0\Remote\MethodResult.cs + OpenEngSB2_4_0\Remote\MethodResultMessage.cs + OpenEngSB2_4_0\Remote\MethodReturnWrapper.cs + OpenEngSB2_4_0\Remote\RemoteType.cs + OpenEngSB3_0_0\Remote\RemoteObjects\AuthenticationInfo.cs + OpenEngSB3_0_0\Remote\RemoteObjects\ConnectorDescription.cs + OpenEngSB3_0_0\Remote\RemoteObjects\ConnectorId.cs + OpenEngSB3_0_0\Communication\Jms\Destination.cs + OpenEngSB3_0_0\Remote\RemoteObjects\Data.cs + OpenEngSB3_0_0\Remote\DomainProxy.cs + OpenEngSB3_0_0\Remote\LocalType.cs + OpenEngSB3_0_0\Remote\DomainReverseProxy.cs + OpenEngSB3_0_0\Communication\IOutgoingPort.cs + OpenEngSB3_0_0\Communication\Jms\JmsOutgoingPort.cs + Properties\AssemblyInfo.cs + OpenEngSB3_0_0\RealDomainFactory.cs + OpenEngSB3_0_0\Remote\RemoteObjects\Message.cs + OpenEngSB3_0_0\Remote\RemoteObjects\MessageResult.cs + OpenEngSB3_0_0\Remote\RemoteObjects\RemoteMethodCall.cs + OpenEngSB3_0_0\Remote\RemoteObjects\MethodResult.cs + OpenEngSB3_0_0\Remote\RemoteObjects\MethodResultMessage.cs + OpenEngSB3_0_0\Remote\RemoteObjects\SecureMethodCallRequest.cs + OpenEngSB3_0_0\Remote\RemoteType.cs + + + + + + + + Bridge + org.openengsb.loom.csharp.common.bridge.Interface + 1.0.0-SNAPSHOT + library + + + org.openengsb.wrapped.csharp + log4net + 1.2.11_1-SNAPSHOT + dotnet-library + + + org.openengsb.wrapped.csharp + Apache.NMS + 1.5.0_1-SNAPSHOT + dotnet-library + + + org.openengsb.wrapped.csharp + Apache.NMS.ActiveMQ + 1.5.0_1-SNAPSHOT + dotnet-library + + + org.openengsb.wrapped.csharp + fastJSON + 1.9.6_1-SNAPSHOT + dotnet-library + + + org.openengsb.wrapped.csharp + Newtonsoft.Json + 5.0_1-SNAPSHOT + dotnet-library + + + \ No newline at end of file diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll new file mode 100644 index 0000000..52974b7 Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS-1.5.0_1-SNAPSHOT/Apache.NMS.dll differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll new file mode 100644 index 0000000..f6642df Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Apache.NMS.ActiveMQ-1.5.0_1-SNAPSHOT/Apache.NMS.ActiveMQ.dll differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Newtonsoft.Json-5.0_1-SNAPSHOT/Newtonsoft.Json.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Newtonsoft.Json-5.0_1-SNAPSHOT/Newtonsoft.Json.dll new file mode 100644 index 0000000..49fa20c Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/Newtonsoft.Json-5.0_1-SNAPSHOT/Newtonsoft.Json.dll differ diff --git a/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll new file mode 100644 index 0000000..e27e312 Binary files /dev/null and b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/.references/org.openengsb.wrapped.csharp/fastJSON-1.9.6_1-SNAPSHOT/fastJSON.dll differ diff --git a/bridge/src/lib/DomainService/IDomainFactory.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/IDomainFactory.cs similarity index 92% rename from bridge/src/lib/DomainService/IDomainFactory.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/IDomainFactory.cs index f0d14e9..756dcd8 100644 --- a/bridge/src/lib/DomainService/IDomainFactory.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/IDomainFactory.cs @@ -20,13 +20,13 @@ using System.Linq; using System.Text; -namespace Org.OpenEngSB.DotNet.Lib.DomainService +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface { public interface IDomainFactory { T getEventhandler(string host); - void RegisterDomainService(string destination, T service, string domainType, Type domainevents); + void RegisterDomainService(string destination, T service, string domainType); void UnregisterDomainService(object service); String getDomainTypServiceId(); diff --git a/bridge/src/lib/DomainService/MessageMethodInvocation.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MessageMethodInvocation.cs similarity index 98% rename from bridge/src/lib/DomainService/MessageMethodInvocation.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MessageMethodInvocation.cs index b1e9740..1a32df1 100644 --- a/bridge/src/lib/DomainService/MessageMethodInvocation.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MessageMethodInvocation.cs @@ -21,7 +21,7 @@ using System.Text; using System.Runtime.Remoting.Messaging; -namespace Org.OpenEngSB.DotNet.Lib.DomainService +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface { public class MessageMethodInvocation : MethodInvocation { diff --git a/bridge/src/lib/DomainService/MethodInvocation.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MethodInvocation.cs similarity index 97% rename from bridge/src/lib/DomainService/MethodInvocation.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MethodInvocation.cs index 1f8ab91..d09c274 100644 --- a/bridge/src/lib/DomainService/MethodInvocation.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/MethodInvocation.cs @@ -21,7 +21,7 @@ using System.Text; using System.Reflection; -namespace Org.OpenEngSB.DotNet.Lib.DomainService +namespace Org.OpenEngSB.Loom.Csharp.Common.Bridge.Interface { public class MethodInvocation { diff --git a/bridge/src/lib/DomainService/Properties/AssemblyInfo.cs b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/Properties/AssemblyInfo.cs similarity index 88% rename from bridge/src/lib/DomainService/Properties/AssemblyInfo.cs rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/Properties/AssemblyInfo.cs index fd517ea..d2d28b6 100644 --- a/bridge/src/lib/DomainService/Properties/AssemblyInfo.cs +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/Properties/AssemblyInfo.cs @@ -31,6 +31,7 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +// [assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0-SNAPSHOT")] diff --git a/bridge/src/lib/DomainService/DomainService.csproj b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/org.openengsb.loom.csharp.common.bridge.Interface.csproj similarity index 90% rename from bridge/src/lib/DomainService/DomainService.csproj rename to bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/org.openengsb.loom.csharp.common.bridge.Interface.csproj index 6ac4df1..26d9a1d 100644 --- a/bridge/src/lib/DomainService/DomainService.csproj +++ b/bridge/src/lib/org.openengsb.loom.csharp.common.bridge.Interface/org.openengsb.loom.csharp.common.bridge.Interface.csproj @@ -8,8 +8,8 @@ {5CCD2925-BB25-496E-824F-3894A4FBF968} Library Properties - Org.OpenEngSB.DotNet.Lib.DomainService - DomainService + org.openengsb.loom.csharp.common.bridge.Interface + org.openengsb.loom.csharp.common.bridge.Interface v4.0 512 @@ -49,6 +49,9 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/bridge/src/lib/ServiceManager/Properties/Settings.Designer.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Properties/Settings.Designer.cs similarity index 87% rename from bridge/src/lib/ServiceManager/Properties/Settings.Designer.cs rename to plugins/openengsb-assistants/openengsb-maven-browser/Properties/Settings.Designer.cs index c1f7d3e..5f4aad7 100644 --- a/bridge/src/lib/ServiceManager/Properties/Settings.Designer.cs +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Properties/Settings.Designer.cs @@ -1,26 +1,26 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.235 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ServiceManager.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsDoc.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsDoc.cs new file mode 100644 index 0000000..7171a30 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsDoc.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class ArtifactsDoc + { + public string id; + public string g; + public string a; + public string latestVersion; + public string repositoryId; + public string p; + public string timestamp; + public int versionCount; + public string[] text; + public string[] ec; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsListing.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsListing.cs new file mode 100644 index 0000000..e609f8a --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsListing.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class ArtifactsListing + { + public ArtifactsResponseHeader responseHeader; + public ArtifactsResponse response; + public Spellcheck spellcheck; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsParameter.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsParameter.cs new file mode 100644 index 0000000..7d063ca --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsParameter.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class ArtifactsParameter + { + public bool spellcheck; + public string fl; + public string sort; + public string indent; + public string q; + public int spellcheck_count; + public string wt; + public string version; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponse.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponse.cs new file mode 100644 index 0000000..dc05db4 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponse.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class ArtifactsResponse + { + public int numFound; + public int start; + public ArtifactsDoc[] docs; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponseHeader.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponseHeader.cs new file mode 100644 index 0000000..bc722e0 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/ArtifactsResponseHeader.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class ArtifactsResponseHeader + { + public int status; + public int QTime; + public ArtifactsParameter @params; + } +} \ No newline at end of file diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/Spellcheck.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/Spellcheck.cs new file mode 100644 index 0000000..5c49958 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/Spellcheck.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class Spellcheck + { + public string[] suggestions; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsDoc.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsDoc.cs new file mode 100644 index 0000000..11dc506 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsDoc.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class VersionsDoc + { + public string id; + public string g; + public string a; + public string v; + public string p; + public string timestamp; + public string[] tags; + public string[] ec; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsListing.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsListing.cs new file mode 100644 index 0000000..53e6b9c --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsListing.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class VersionsListing + { + public VersionsResponseHeader responseHeader; + public VersionsResponse response; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsParameter.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsParameter.cs new file mode 100644 index 0000000..291383c --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsParameter.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class VersionsParameter + { + public string fl; + public string sort; + public string indent; + public string q; + public string core; + public string wt; + public string version; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponse.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponse.cs new file mode 100644 index 0000000..f3b1b6a --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponse.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class VersionsResponse + { + public int numFound; + public int start; + public VersionsDoc[] docs; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponseHeader.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponseHeader.cs new file mode 100644 index 0000000..51b21ea --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/JSON/VersionsResponseHeader.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON +{ + public class VersionsResponseHeader + { + public int status; + public int QTime; + public VersionsParameter @params; + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/MavenCentralClient.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/MavenCentralClient.cs new file mode 100644 index 0000000..d500f1d --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/Communication/MavenCentralClient.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Net; +using System.Web.Script.Serialization; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Common; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication.JSON; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication +{ + class MavenCentralClient + { + private WebClient _client; + private string _baseUrl; + private string _fileBaseUrl; + private JavaScriptSerializer _serializer; + + public MavenCentralClient() + { + _client = new WebClient(); + _baseUrl = "http://search.maven.org/solrsearch/select?q="; + _fileBaseUrl = "http://search.maven.org/remotecontent?filepath="; + _serializer = new JavaScriptSerializer(); + } + + private string getArtifactsUrl(string groupId) + { + return _baseUrl + getArtifactsQuery(groupId) + "&wt=json"; + } + + private string getVersionsUrl(string groupId, string artifactId) + { + return _baseUrl + getVersionsQuery(groupId, artifactId) + "&wt=json&core=gav"; + } + + private string getArtifactsQuery(string groupId) + { + return "g:" + "\"" + groupId + "\""; + } + + private string getVersionsQuery(string groupId, string artifactId) + { + return getArtifactsQuery(groupId) + "+" + "AND" + "+" + "a:" + "\"" + artifactId + "\""; + } + + public IList GetArtifacts(string groupId) + { + string url = getArtifactsUrl(groupId); + string artifactsString = _client.DownloadString(url); + ArtifactsListing al = _serializer.Deserialize(artifactsString); + + IList artifacts = new List(); + foreach (ArtifactsDoc doc in al.response.docs) + { + Artifact artifact = new Artifact(groupId, doc.a); + IList versions = GetVersions(groupId, artifact); + artifact.Versions = versions; + if(versions.Count > 0) + artifacts.Add(artifact); + } + return artifacts; + } + + public IList GetVersions(string groupId, Artifact artifact) + { + string url = getVersionsUrl(groupId, artifact.Id); + string versionsString = _client.DownloadString(url); + VersionsListing vl = _serializer.Deserialize(versionsString); + IList versions = new List(); + + foreach (VersionsDoc doc in vl.response.docs) + { + ItemVersion iv = new ItemVersion(doc.v, artifact); + iv.Items = getFilteredItems(iv, doc.ec); + if (iv.Items.Count > 0) + versions.Add(iv); + } + return versions; + } + + private IList getFilteredItems(ItemVersion iv, string[] files) + { + IList items = new List(); + foreach (string file in files) + { + if (file.EndsWith("DomainEvents.wsdl") || file.EndsWith("Domain.wsdl")) + { + String url = generateFileUrl(file, iv); + Item i = new Item(generateFileName(file, iv),url, iv); + items.Add(i); + } + } + return items; + } + + private string generateFileUrl(string fileName, ItemVersion version) + { + string parameter = version.ParentArtifact.GroupId.Replace(".", "/"); + parameter += "/" + version.ParentArtifact.Id; + parameter += "/" + version.Id; + parameter += "/" + generateFileName(fileName, version); + return _fileBaseUrl + parameter; + } + + private string generateFileName(string fileName, ItemVersion version) + { + return version.ParentArtifact.Id + "-" + version.Id + fileName; + } + + public string GetItemDownloadUrl(string groupdId, string artifactId, string itemName) + { + return groupdId + artifactId + itemName; + } + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/FileService.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/FileService.cs new file mode 100644 index 0000000..fb37fe5 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/FileService.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Net; +using System.ComponentModel; +using System.Threading; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service +{ + public class FileService + { + private WebClient _webClient; + + public delegate void UpdateProgressHandler(int i); + public event UpdateProgressHandler ProgressEvent; + + private IEnumerator _urls; + private IEnumerator _destinations; + + public FileService() + { + _webClient = new WebClient(); + _webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCallback); + _urls = null; + _destinations = null; + } + + public void DownloadFileCallback(object sender, AsyncCompletedEventArgs e) + { + ProgressEvent(1); + downloadNext(); + } + + private void downloadNext() + { + if (_urls == null) + return; + + if (_destinations == null) + return; + + if (_urls.MoveNext() && _destinations.MoveNext()) + { + _webClient.DownloadFileAsync(new Uri(_urls.Current), _destinations.Current); + } + } + + public void LoadFileFrom(string url, string destination) + { + _webClient.DownloadFile(url, destination); + } + + public void LoadFilesFrom(string[] urls, string[] destinations) + { + if (urls.Length != destinations.Length) + throw new ArgumentException("Number of urls and destinations doesn't match!"); + + _urls = urls.AsEnumerable().GetEnumerator(); + _destinations = destinations.AsEnumerable().GetEnumerator(); + downloadNext(); + } + + public void CancelDownloads() + { + _webClient.CancelAsync(); + } + + public string CreatePath(string directory, string fileName) + { + return Path.Combine(directory, fileName); + } + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Service/MavenService.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Service/MavenService.cs new file mode 100644 index 0000000..8a1d8b0 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Service/MavenService.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Common; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Testing; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service.Communication; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Service +{ + public class MavenService + { + public const string GROUP_ID = "org.openengsb.domain"; + + public string Repository { get; set; } + private MavenCentralClient _client; + + public MavenService() + { + _client = new MavenCentralClient(); + } + + public IList LoadWsdlArtifacts() + { + return _client.GetArtifacts(GROUP_ID); + } + + private IList GenerateDefaultArtifacts() + { + DataGenerator gen = new DataGenerator(); + IList artifacts = new List(); + + for (int i = 0; i < 2; i++) + { + Artifact a = gen.NextArtifact(); + for (int j = 0; j < 2; j++) + { + ItemVersion v = gen.NextVersion(a); + for (int k = 0; k < 2; k++) + { + Item it = gen.NextItem(v); + v.Items.Add(it); + } + a.Versions.Add(v); + } + artifacts.Add(a); + } + + return artifacts; + } + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/Testing/DataGenerator.cs b/plugins/openengsb-assistants/openengsb-maven-browser/Testing/DataGenerator.cs new file mode 100644 index 0000000..cf98d64 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/Testing/DataGenerator.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Common; + +namespace Org.OpenEngSB.Loom.Csharp.VisualStudio.Plugins.Assistants.Testing +{ + class DataGenerator + { + private int _nextItem; + private int _nextVersion; + private int _nextArtifact; + + public DataGenerator() + { + _nextArtifact = 0; + _nextVersion = 0; + _nextItem = 0; + } + + public Item NextItem(ItemVersion version) + { + return new Item("Item " + _nextItem, "https://maven.org?item=" + _nextItem++, version); + } + + public ItemVersion NextVersion(Artifact artifact) + { + return new ItemVersion("Version: " + _nextVersion++, artifact); + } + + public Artifact NextArtifact() + { + return new Artifact("org.openengsb.domain", "Artifact: " + _nextArtifact++); + } + } +} diff --git a/plugins/openengsb-assistants/openengsb-maven-browser/UI/BrowserWindow.xaml b/plugins/openengsb-assistants/openengsb-maven-browser/UI/BrowserWindow.xaml new file mode 100644 index 0000000..af00358 --- /dev/null +++ b/plugins/openengsb-assistants/openengsb-maven-browser/UI/BrowserWindow.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +