- Timestamp:
- 01/15/11 01:35:43 (14 years ago)
- Location:
- branches/OKB (trunk integration)
- Files:
-
- 3 added
- 1 deleted
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj
r5298 r5299 109 109 <Compile Include="ServiceClients\AlgorithmParameter.cs" /> 110 110 <Compile Include="ServiceClients\AndFilter.cs" /> 111 <Compile Include="ServiceClients\OKBServiceClients.cs" /> 111 112 <Compile Include="ServiceClients\SetComparisonStringAvailableValuesFilter.cs" /> 112 113 <Compile Include="ServiceClients\NameSetComparisonStringAvailableValuesFilter.cs" /> … … 125 126 <Compile Include="ServiceClients\Result.cs" /> 126 127 <Compile Include="ServiceClients\ProblemParameter.cs" /> 127 <Compile Include="ServiceClients\OKBServiceClient.cs" />128 128 <Compile Include="ServiceClients\ProblemData.cs" /> 129 129 <Compile Include="ServiceClients\Problem.cs" /> -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/OKBClient.cs
r5295 r5299 103 103 var call = new Func<Exception>(delegate() { 104 104 try { 105 platforms.AddRange(CallAdmin Service<List<Platform>>(s => s.GetPlatforms()).OrderBy(x => x.Name));106 dataTypes.AddRange(CallAdmin Service<List<DataType>>(s => s.GetDataTypes()).OrderBy(x => x.Name));105 platforms.AddRange(CallAdministrationService<List<Platform>>(s => s.GetPlatforms()).OrderBy(x => x.Name)); 106 dataTypes.AddRange(CallAdministrationService<List<DataType>>(s => s.GetDataTypes()).OrderBy(x => x.Name)); 107 107 users = CallAuthenticationService<List<User>>(s => s.GetUsers()).OrderBy(x => x.Name); 108 algorithmClasses.AddRange(CallAdmin Service<List<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(x => x.Name));109 algorithms.AddRange(CallAdmin Service<List<Algorithm>>(s => s.GetAlgorithms()).OrderBy(x => x.Name));110 problemClasses.AddRange(CallAdmin Service<List<ProblemClass>>(s => s.GetProblemClasses()).OrderBy(x => x.Name));111 problems.AddRange(CallAdmin Service<List<Problem>>(s => s.GetProblems()).OrderBy(x => x.Name));108 algorithmClasses.AddRange(CallAdministrationService<List<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(x => x.Name)); 109 algorithms.AddRange(CallAdministrationService<List<Algorithm>>(s => s.GetAlgorithms()).OrderBy(x => x.Name)); 110 problemClasses.AddRange(CallAdministrationService<List<ProblemClass>>(s => s.GetProblemClasses()).OrderBy(x => x.Name)); 111 problems.AddRange(CallAdministrationService<List<Problem>>(s => s.GetProblems()).OrderBy(x => x.Name)); 112 112 return null; 113 113 } … … 129 129 if (item.Id == 0) { 130 130 if (item is Platform) 131 item.Id = CallAdmin Service<long>(s => s.AddPlatform((Platform)item));131 item.Id = CallAdministrationService<long>(s => s.AddPlatform((Platform)item)); 132 132 else if (item is DataType) 133 item.Id = CallAdmin Service<long>(s => s.AddDataType((DataType)item));133 item.Id = CallAdministrationService<long>(s => s.AddDataType((DataType)item)); 134 134 else if (item is AlgorithmClass) 135 item.Id = CallAdmin Service<long>(s => s.AddAlgorithmClass((AlgorithmClass)item));135 item.Id = CallAdministrationService<long>(s => s.AddAlgorithmClass((AlgorithmClass)item)); 136 136 else if (item is Algorithm) 137 item.Id = CallAdmin Service<long>(s => s.AddAlgorithm((Algorithm)item));137 item.Id = CallAdministrationService<long>(s => s.AddAlgorithm((Algorithm)item)); 138 138 else if (item is AlgorithmParameter) 139 item.Id = CallAdmin Service<long>(s => s.AddAlgorithmParameter((AlgorithmParameter)item));139 item.Id = CallAdministrationService<long>(s => s.AddAlgorithmParameter((AlgorithmParameter)item)); 140 140 else if (item is ProblemClass) 141 item.Id = CallAdmin Service<long>(s => s.AddProblemClass((ProblemClass)item));141 item.Id = CallAdministrationService<long>(s => s.AddProblemClass((ProblemClass)item)); 142 142 else if (item is Problem) 143 item.Id = CallAdmin Service<long>(s => s.AddProblem((Problem)item));143 item.Id = CallAdministrationService<long>(s => s.AddProblem((Problem)item)); 144 144 else if (item is ProblemParameter) 145 item.Id = CallAdmin Service<long>(s => s.AddProblemParameter((ProblemParameter)item));145 item.Id = CallAdministrationService<long>(s => s.AddProblemParameter((ProblemParameter)item)); 146 146 else if (item is Result) 147 item.Id = CallAdmin Service<long>(s => s.AddResult((Result)item));147 item.Id = CallAdministrationService<long>(s => s.AddResult((Result)item)); 148 148 else if (item is Experiment) 149 item.Id = CallAdmin Service<long>(s => s.AddExperiment((Experiment)item));149 item.Id = CallAdministrationService<long>(s => s.AddExperiment((Experiment)item)); 150 150 else if (item is Run) 151 item.Id = CallAdmin Service<long>(s => s.AddRun((Run)item));151 item.Id = CallAdministrationService<long>(s => s.AddRun((Run)item)); 152 152 } else { 153 153 if (item is Platform) 154 CallAdmin Service(s => s.UpdatePlatform((Platform)item));154 CallAdministrationService(s => s.UpdatePlatform((Platform)item)); 155 155 else if (item is DataType) 156 CallAdmin Service(s => s.UpdateDataType((DataType)item));156 CallAdministrationService(s => s.UpdateDataType((DataType)item)); 157 157 else if (item is AlgorithmClass) 158 CallAdmin Service(s => s.UpdateAlgorithmClass((AlgorithmClass)item));158 CallAdministrationService(s => s.UpdateAlgorithmClass((AlgorithmClass)item)); 159 159 else if (item is Algorithm) 160 CallAdmin Service(s => s.UpdateAlgorithm((Algorithm)item));160 CallAdministrationService(s => s.UpdateAlgorithm((Algorithm)item)); 161 161 else if (item is AlgorithmParameter) 162 CallAdmin Service(s => s.UpdateAlgorithmParameter((AlgorithmParameter)item));162 CallAdministrationService(s => s.UpdateAlgorithmParameter((AlgorithmParameter)item)); 163 163 else if (item is ProblemClass) 164 CallAdmin Service(s => s.UpdateProblemClass((ProblemClass)item));164 CallAdministrationService(s => s.UpdateProblemClass((ProblemClass)item)); 165 165 else if (item is Problem) 166 CallAdmin Service(s => s.UpdateProblem((Problem)item));166 CallAdministrationService(s => s.UpdateProblem((Problem)item)); 167 167 else if (item is ProblemParameter) 168 CallAdmin Service(s => s.UpdateProblemParameter((ProblemParameter)item));168 CallAdministrationService(s => s.UpdateProblemParameter((ProblemParameter)item)); 169 169 else if (item is Result) 170 CallAdmin Service(s => s.UpdateResult((Result)item));170 CallAdministrationService(s => s.UpdateResult((Result)item)); 171 171 else if (item is Experiment) 172 item.Id = CallAdmin Service<long>(s => s.AddExperiment((Experiment)item));172 item.Id = CallAdministrationService<long>(s => s.AddExperiment((Experiment)item)); 173 173 else if (item is Run) 174 item.Id = CallAdmin Service<long>(s => s.AddRun((Run)item));174 item.Id = CallAdministrationService<long>(s => s.AddRun((Run)item)); 175 175 } 176 176 return true; … … 213 213 public List<Guid> GetAlgorithmUsers(long algorithmId) { 214 214 try { 215 return CallAdmin Service<List<Guid>>(s => s.GetAlgorithmUsers(algorithmId));215 return CallAdministrationService<List<Guid>>(s => s.GetAlgorithmUsers(algorithmId)); 216 216 } 217 217 catch (Exception ex) { … … 222 222 public bool UpdateAlgorithmUsers(long algorithmId, List<Guid> users) { 223 223 try { 224 CallAdmin Service(s => s.UpdateAlgorithmUsers(algorithmId, users));224 CallAdministrationService(s => s.UpdateAlgorithmUsers(algorithmId, users)); 225 225 return true; 226 226 } … … 232 232 public AlgorithmData GetAlgorithmData(long algorithmId) { 233 233 try { 234 return CallAdmin Service<AlgorithmData>(s => s.GetAlgorithmData(algorithmId));234 return CallAdministrationService<AlgorithmData>(s => s.GetAlgorithmData(algorithmId)); 235 235 } 236 236 catch (Exception ex) { … … 241 241 public bool UpdateAlgorithmData(AlgorithmData algorithmData) { 242 242 try { 243 CallAdmin Service(s => s.UpdateAlgorithmData(algorithmData));243 CallAdministrationService(s => s.UpdateAlgorithmData(algorithmData)); 244 244 return true; 245 245 } … … 254 254 public List<Guid> GetProblemUsers(long problemId) { 255 255 try { 256 return CallAdmin Service<List<Guid>>(s => s.GetProblemUsers(problemId));256 return CallAdministrationService<List<Guid>>(s => s.GetProblemUsers(problemId)); 257 257 } 258 258 catch (Exception ex) { … … 263 263 public bool UpdateProblemUsers(long problemId, List<Guid> users) { 264 264 try { 265 CallAdmin Service(s => s.UpdateProblemUsers(problemId, users));265 CallAdministrationService(s => s.UpdateProblemUsers(problemId, users)); 266 266 return true; 267 267 } … … 273 273 public ProblemData GetProblemData(long problemId) { 274 274 try { 275 return CallAdmin Service<ProblemData>(s => s.GetProblemData(problemId));275 return CallAdministrationService<ProblemData>(s => s.GetProblemData(problemId)); 276 276 } 277 277 catch (Exception ex) { … … 282 282 public bool UpdateProblemData(ProblemData problemData) { 283 283 try { 284 CallAdmin Service(s => s.UpdateProblemData(problemData));284 CallAdministrationService(s => s.UpdateProblemData(problemData)); 285 285 return true; 286 286 } … … 295 295 public AlgorithmParameter GetAlgorithmParameter(long id) { 296 296 try { 297 return CallAdmin Service<AlgorithmParameter>(s => s.GetAlgorithmParameter(id));297 return CallAdministrationService<AlgorithmParameter>(s => s.GetAlgorithmParameter(id)); 298 298 } 299 299 catch (Exception ex) { … … 305 305 try { 306 306 ItemCollection<AlgorithmParameter> parameters = new ItemCollection<AlgorithmParameter>(); 307 parameters.AddRange(CallAdmin Service<List<AlgorithmParameter>>(s => s.GetAlgorithmParameters(algorithmId)).OrderBy(x => x.Name));307 parameters.AddRange(CallAdministrationService<List<AlgorithmParameter>>(s => s.GetAlgorithmParameters(algorithmId)).OrderBy(x => x.Name)); 308 308 return parameters; 309 309 } … … 318 318 public ProblemParameter GetProblemParameter(long id) { 319 319 try { 320 return CallAdmin Service<ProblemParameter>(s => s.GetProblemParameter(id));320 return CallAdministrationService<ProblemParameter>(s => s.GetProblemParameter(id)); 321 321 } 322 322 catch (Exception ex) { … … 328 328 try { 329 329 ItemCollection<ProblemParameter> parameters = new ItemCollection<ProblemParameter>(); 330 parameters.AddRange(CallAdmin Service<List<ProblemParameter>>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name));330 parameters.AddRange(CallAdministrationService<List<ProblemParameter>>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name)); 331 331 return parameters; 332 332 } … … 341 341 public Result GetResult(long id) { 342 342 try { 343 return CallAdmin Service<Result>(s => s.GetResult(id));343 return CallAdministrationService<Result>(s => s.GetResult(id)); 344 344 } 345 345 catch (Exception ex) { … … 351 351 try { 352 352 ItemCollection<Result> results = new ItemCollection<Result>(); 353 results.AddRange(CallAdmin Service<List<Result>>(s => s.GetResults(algorithmId)).OrderBy(x => x.Name));353 results.AddRange(CallAdministrationService<List<Result>>(s => s.GetResults(algorithmId)).OrderBy(x => x.Name)); 354 354 return results; 355 355 } … … 364 364 public Experiment GetExperiment(long id) { 365 365 try { 366 return CallAdmin Service<Experiment>(s => s.GetExperiment(id));366 return CallAdministrationService<Experiment>(s => s.GetExperiment(id)); 367 367 } 368 368 catch (Exception ex) { … … 374 374 try { 375 375 ItemCollection<Experiment> experiments = new ItemCollection<Experiment>(); 376 experiments.AddRange(CallAdmin Service<List<Experiment>>(s => s.GetExperiments(algorithmId, problemId)));376 experiments.AddRange(CallAdministrationService<List<Experiment>>(s => s.GetExperiments(algorithmId, problemId))); 377 377 experiments.ItemsRemoved += new CollectionItemsChangedEventHandler<Experiment>(experiments_ItemsRemoved); 378 378 return experiments; … … 389 389 try { 390 390 ItemCollection<Run> runs = new ItemCollection<Run>(); 391 runs.AddRange(CallAdmin Service<List<Run>>(s => s.GetRuns(experimentId)).OrderByDescending(x => x.CreatedDate));391 runs.AddRange(CallAdministrationService<List<Run>>(s => s.GetRuns(experimentId)).OrderByDescending(x => x.CreatedDate)); 392 392 runs.ItemsRemoved += new CollectionItemsChangedEventHandler<Run>(runs_ItemsRemoved); 393 393 return runs; … … 692 692 if (refresh || (filters == null)) { 693 693 try { 694 filters = Call AdminService<List<Filter>>(s => s.GetFilters());694 filters = CallQueryService<List<Filter>>(s => s.GetFilters()); 695 695 } 696 696 catch (Exception ex) { … … 706 706 public long QueryNumberOfRuns(Filter filter) { 707 707 try { 708 return Call AdminService<long>(x => x.QueryNumberOfRuns(filter));708 return CallQueryService<long>(x => x.QueryNumberOfRuns(filter)); 709 709 } 710 710 catch (Exception ex) { … … 716 716 try { 717 717 ItemCollection<Run> runs = new ItemCollection<Run>(); 718 runs.AddRange(Call AdminService<List<Run>>(s => s.QueryRuns(filter)).OrderByDescending(x => x.CreatedDate));718 runs.AddRange(CallQueryService<List<Run>>(s => s.QueryRuns(filter)).OrderByDescending(x => x.CreatedDate)); 719 719 return runs; 720 720 } … … 741 741 try { 742 742 foreach (Platform p in e.Items) 743 CallAdmin Service(s => s.DeletePlatform(p.Id));743 CallAdministrationService(s => s.DeletePlatform(p.Id)); 744 744 } 745 745 catch (Exception ex) { … … 750 750 try { 751 751 foreach (DataType d in e.Items) 752 CallAdmin Service(s => s.DeleteDataType(d.Id));752 CallAdministrationService(s => s.DeleteDataType(d.Id)); 753 753 } 754 754 catch (Exception ex) { … … 759 759 try { 760 760 foreach (AlgorithmClass a in e.Items) 761 CallAdmin Service(s => s.DeleteAlgorithmClass(a.Id));761 CallAdministrationService(s => s.DeleteAlgorithmClass(a.Id)); 762 762 } 763 763 catch (Exception ex) { … … 768 768 try { 769 769 foreach (Algorithm a in e.Items) 770 CallAdmin Service(s => s.DeleteAlgorithm(a.Id));770 CallAdministrationService(s => s.DeleteAlgorithm(a.Id)); 771 771 } 772 772 catch (Exception ex) { … … 777 777 try { 778 778 foreach (ProblemClass p in e.Items) 779 CallAdmin Service(s => s.DeleteProblemClass(p.Id));779 CallAdministrationService(s => s.DeleteProblemClass(p.Id)); 780 780 } 781 781 catch (Exception ex) { … … 786 786 try { 787 787 foreach (Problem p in e.Items) 788 CallAdmin Service(s => s.DeleteProblem(p.Id));788 CallAdministrationService(s => s.DeleteProblem(p.Id)); 789 789 } 790 790 catch (Exception ex) { … … 795 795 try { 796 796 foreach (Experiment exp in e.Items) 797 CallAdmin Service(s => s.DeleteExperiment(exp.Id));797 CallAdministrationService(s => s.DeleteExperiment(exp.Id)); 798 798 } 799 799 catch (Exception ex) { … … 804 804 try { 805 805 foreach (Run r in e.Items) 806 CallAdmin Service(s => s.DeleteRun(r.Id));806 CallAdministrationService(s => s.DeleteRun(r.Id)); 807 807 } 808 808 catch (Exception ex) { … … 813 813 814 814 #region Helpers 815 private void CallAdmin Service(Action<IOKBService> call) {816 OKBServiceClient client = ClientFactory.CreateClient<OKBServiceClient, IOKBService>();815 private void CallAdministrationService(Action<IAdministrationService> call) { 816 AdministrationServiceClient client = ClientFactory.CreateClient<AdministrationServiceClient, IAdministrationService>(); 817 817 try { 818 818 call(client); … … 827 827 } 828 828 } 829 private T CallAdmin Service<T>(Func<IOKBService, T> call) {830 OKBServiceClient client = ClientFactory.CreateClient<OKBServiceClient, IOKBService>();829 private T CallAdministrationService<T>(Func<IAdministrationService, T> call) { 830 AdministrationServiceClient client = ClientFactory.CreateClient<AdministrationServiceClient, IAdministrationService>(); 831 831 try { 832 832 return call(client); … … 841 841 } 842 842 } 843 private void CallQueryService(Action<IQueryService> call) { 844 QueryServiceClient client = ClientFactory.CreateClient<QueryServiceClient, IQueryService>(); 845 try { 846 call(client); 847 } 848 finally { 849 try { 850 client.Close(); 851 } 852 catch (Exception) { 853 client.Abort(); 854 } 855 } 856 } 857 private T CallQueryService<T>(Func<IQueryService, T> call) { 858 QueryServiceClient client = ClientFactory.CreateClient<QueryServiceClient, IQueryService>(); 859 try { 860 return call(client); 861 } 862 finally { 863 try { 864 client.Close(); 865 } 866 catch (Exception) { 867 client.Abort(); 868 } 869 } 870 } 843 871 private T CallAuthenticationService<T>(Func<IAuthenticationService, T> call) { 844 872 AuthenticationServiceClient client = ClientFactory.CreateClient<AuthenticationServiceClient, IAuthenticationService>(); -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/ServiceClients/GenerateServiceClients.cmd
r5295 r5299 3 3 echo. 4 4 echo ******************************************************************************************* 5 echo Generating OKB Service client5 echo Generating OKB service clients 6 6 echo. 7 7 … … 9 9 10 10 svcutil.exe ^ 11 http://localhost:8732/Design_Time_Addresses/OKB-3.3/OKBService/mex ^ 12 /out:OKBServiceClient ^ 11 http://localhost:8732/Design_Time_Addresses/OKB-3.3/AdministrationService/mex ^ 12 http://localhost:8732/Design_Time_Addresses/OKB-3.3/QueryService/mex ^ 13 /out:OKBServiceClients ^ 13 14 /namespace:*,HeuristicLab.Clients.OKB ^ 14 15 /collectionType:System.Collections.Generic.List`1 ^ … … 27 28 echo --------------------------------------------------------------------------------------- 28 29 echo. 29 echo Generation of OKB Service clientfinished.30 echo Generation of OKB service clients finished. 30 31 echo ******************************************************************************************* 31 32 echo. -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/app.config
r5295 r5299 11 11 <bindings> 12 12 <wsHttpBinding> 13 <binding name="WSHttpBinding_IOKBService" closeTimeout="00:01:00" 13 <binding name="WSHttpBinding_IAdministrationService" closeTimeout="00:01:00" 14 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 15 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 16 maxBufferPoolSize="524288" maxReceivedMessageSize="200000000" 17 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 18 allowCookies="false"> 19 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="200000000" 20 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 21 <reliableSession ordered="true" inactivityTimeout="00:10:00" 22 enabled="false" /> 23 <security mode="Message"> 24 <transport clientCredentialType="Windows" proxyCredentialType="None" 25 realm="" /> 26 <message clientCredentialType="UserName" negotiateServiceCredential="true" 27 algorithmSuite="Default" /> 28 </security> 29 </binding> 30 <binding name="WSHttpBinding_IQueryService" closeTimeout="00:01:00" 14 31 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 15 32 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" … … 48 65 </bindings> 49 66 <client> 50 <endpoint address="http://localhost:8732/Design_Time_Addresses/OKB-3.3/OKBService" 51 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IOKBService" 52 contract="HeuristicLab.Clients.OKB.IOKBService" name="WSHttpBinding_IOKBService" 67 <endpoint address="http://localhost:8732/Design_Time_Addresses/OKB-3.3/AdministrationService" 68 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAdministrationService" 69 contract="HeuristicLab.Clients.OKB.IAdministrationService" 70 name="WSHttpBinding_IAdministrationService" behaviorConfiguration="DefaultEndpointBehavior"> 71 <identity> 72 <certificate encodedValue="AwAAAAEAAAAUAAAAD/AlkYJw/OUhl6D/9w8mjJBh39kgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDgyMDIyMzIwOFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPkfCSLRX8/4F+Z4ys43yZ4MMzjB44cMakPz4Nri+mEB5n2z/0GFatCYzkI2f/nniWqVrBYjHkjsZy2EZioHu4wa99c1XEGJnFNDuNn6ESkfEyhyF4+OqKGnpK9HNrw7OWMuqn2oOh0iFd9fl6FTAm+Y0p3LP+38BuYzpCniqqdwIDAQABo0kwRzBFBgNVHQEEPjA8gBDvi8Rgio9v+mr58TiAvqF5oRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQADgYEANdGlvHKeUptfNu9I0wgA5qjmVB+JDldOAkrfM0R+4IcVQ06y5K7P07uxQAV7+rhnDLgLyFJunUHgzbfjsjFy7vjwtoieXA5j0AYlm4AHR7dHt4HVgkIMYt8XOCqMw5jjFX91xJ89tC7mM9zYR48N9T5QSeMGo+f+JzybeLWxnNs=" /> 73 </identity> 74 </endpoint> 75 <endpoint address="http://localhost:8732/Design_Time_Addresses/OKB-3.3/QueryService" 76 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IQueryService" 77 contract="HeuristicLab.Clients.OKB.IQueryService" name="WSHttpBinding_IQueryService" 53 78 behaviorConfiguration="DefaultEndpointBehavior"> 54 79 <identity> … … 59 84 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAuthenticationService" 60 85 contract="HeuristicLab.Clients.OKB.IAuthenticationService" 61 name="WSHttpBinding_IAuthenticationService" >86 name="WSHttpBinding_IAuthenticationService" behaviorConfiguration="DefaultEndpointBehavior"> 62 87 <identity> 63 88 <certificate encodedValue="AwAAAAEAAAAUAAAAD/AlkYJw/OUhl6D/9w8mjJBh39kgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDgyMDIyMzIwOFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPkfCSLRX8/4F+Z4ys43yZ4MMzjB44cMakPz4Nri+mEB5n2z/0GFatCYzkI2f/nniWqVrBYjHkjsZy2EZioHu4wa99c1XEGJnFNDuNn6ESkfEyhyF4+OqKGnpK9HNrw7OWMuqn2oOh0iFd9fl6FTAm+Y0p3LP+38BuYzpCniqqdwIDAQABo0kwRzBFBgNVHQEEPjA8gBDvi8Rgio9v+mr58TiAvqF5oRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghAdEzTisaf2sEZxrqYZfYtCMAkGBSsOAwIdBQADgYEANdGlvHKeUptfNu9I0wgA5qjmVB+JDldOAkrfM0R+4IcVQ06y5K7P07uxQAV7+rhnDLgLyFJunUHgzbfjsjFy7vjwtoieXA5j0AYlm4AHR7dHt4HVgkIMYt8XOCqMw5jjFX91xJ89tC7mM9zYR48N9T5QSeMGo+f+JzybeLWxnNs=" /> -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/AdministrationService.cs
r5298 r5299 29 29 namespace HeuristicLab.Services.OKB { 30 30 /// <summary> 31 /// Implementation of the OKB service (interface <see cref="IOKBService"/>).31 /// Implementation of the OKB administration service (interface <see cref="IAdministrationService"/>). 32 32 /// </summary> 33 33 [ServiceBehavior(IncludeExceptionDetailInFaults = true)] 34 public class OKBService : IOKBService {34 public class AdministrationService : IAdministrationService { 35 35 #region Platform Methods 36 36 public DataTransfer.Platform GetPlatform(long id) { … … 561 561 } 562 562 #endregion 563 564 #region Query Methods565 public IEnumerable<DataTransfer.Filter> GetFilters() {566 List<DataTransfer.Filter> filters = new List<DataTransfer.Filter>();567 using (OKBDataContext okb = new OKBDataContext()) {568 //DataLoadOptions dlo = new DataLoadOptions();569 //dlo.LoadWith<Algorithm>(x => x.AlgorithmData);570 //dlo.LoadWith<AlgorithmData>(x => x.DataType);571 //dlo.LoadWith<Problem>(x => x.ProblemData);572 //dlo.LoadWith<ProblemData>(x => x.DataType);573 //dlo.LoadWith<AlgorithmParameter>(x => x.DataType);574 //dlo.LoadWith<ProblemParameter>(x => x.DataType);575 //dlo.LoadWith<Result>(x => x.DataType);576 //okb.LoadOptions = dlo;577 578 // run filters579 filters.Add(new DataTransfer.OrdinalComparisonLongFilter(typeof(RunRandomSeedFilter).AssemblyQualifiedName, "Run Random Seed"));580 filters.Add(new DataTransfer.OrdinalComparisonDateTimeFilter(typeof(RunCreatedDateFilter).AssemblyQualifiedName, "Run Created Date"));581 filters.Add(new DataTransfer.SetComparisonStringFilter(typeof(RunUserNameFilter).AssemblyQualifiedName, "Run User Name"));582 filters.Add(new DataTransfer.SetComparisonStringFilter(typeof(RunClientNameFilter).AssemblyQualifiedName, "Run Client Name"));583 584 // result filters585 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ResultNameFilter).AssemblyQualifiedName, "Result Name", okb.Results.Select(x => x.Name).Distinct().ToArray()));586 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))587 filters.Add(new DataTransfer.NameSetComparisonStringAvailableValuesFilter(typeof(ResultBlobValueDataTypeNameFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value Data Type Name", entity.Name, okb.ResultBlobValues.Where(x => x.Result.Name == entity.Name).Select(x => x.DataType.Name).Distinct().ToArray()));588 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))589 filters.Add(new DataTransfer.NameEqualityComparisonByteArrayFilter(typeof(ResultBlobValueValueFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value", entity.Name));590 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "bit").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))591 filters.Add(new DataTransfer.NameEqualityComparisonBoolFilter(typeof(ResultBoolValueValueFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value", entity.Name));592 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "float").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))593 filters.Add(new DataTransfer.NameOrdinalComparisonDoubleFilter(typeof(ResultFloatValueValueFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value", entity.Name));594 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "bigint").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))595 filters.Add(new DataTransfer.NameOrdinalComparisonLongFilter(typeof(ResultIntValueValueFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value", entity.Name));596 foreach (Result entity in okb.Results.Where(x => x.DataType.SqlName == "nvarchar").AsEnumerable().Distinct<Result>(new GenericEqualityComparer<Result>((x, y) => x.Name == y.Name)))597 filters.Add(new DataTransfer.NameSetComparisonStringFilter(typeof(ResultStringValueValueFilter).AssemblyQualifiedName, "Result " + entity.Name + " Value", entity.Name));598 599 // algorithm parameter filters600 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(AlgorithmParameterNameFilter).AssemblyQualifiedName, "Algorithm Parameter Name", okb.AlgorithmParameters.Select(x => x.Name).Distinct().ToArray()));601 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))602 filters.Add(new DataTransfer.NameSetComparisonStringAvailableValuesFilter(typeof(AlgorithmParameterBlobValueDataTypeNameFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value Data Type Name", entity.Name, okb.AlgorithmParameterBlobValues.Where(x => x.AlgorithmParameter.Name == entity.Name).Select(x => x.DataType.Name).Distinct().ToArray()));603 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))604 filters.Add(new DataTransfer.NameEqualityComparisonByteArrayFilter(typeof(AlgorithmParameterBlobValueValueFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value", entity.Name));605 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "bit").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))606 filters.Add(new DataTransfer.NameEqualityComparisonBoolFilter(typeof(AlgorithmParameterBoolValueValueFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value", entity.Name));607 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "float").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))608 filters.Add(new DataTransfer.NameOrdinalComparisonDoubleFilter(typeof(AlgorithmParameterFloatValueValueFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value", entity.Name));609 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "bigint").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))610 filters.Add(new DataTransfer.NameOrdinalComparisonLongFilter(typeof(AlgorithmParameterIntValueValueFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value", entity.Name));611 foreach (AlgorithmParameter entity in okb.AlgorithmParameters.Where(x => x.DataType.SqlName == "nvarchar").AsEnumerable().Distinct<AlgorithmParameter>(new GenericEqualityComparer<AlgorithmParameter>((x, y) => x.Name == y.Name)))612 filters.Add(new DataTransfer.NameSetComparisonStringFilter(typeof(AlgorithmParameterStringValueValueFilter).AssemblyQualifiedName, "Algorithm Parameter " + entity.Name + " Value", entity.Name));613 614 // algorithm filters615 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(AlgorithmNameFilter).AssemblyQualifiedName, "Algorithm Name", okb.Algorithms.Select(x => x.Name).Distinct().ToArray()));616 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(AlgorithmClassNameFilter).AssemblyQualifiedName, "Algorithm Class Name", okb.AlgorithmClasses.Select(x => x.Name).Distinct().ToArray()));617 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(AlgorithmPlatformNameFilter).AssemblyQualifiedName, "Algorithm Platform Name", okb.Platforms.Select(x => x.Name).Distinct().ToArray()));618 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(AlgorithmDataDataTypeNameFilter).AssemblyQualifiedName, "Algorithm Data Type Name", okb.Algorithms.Select(x => x.AlgorithmData.DataType.Name).Distinct().ToArray()));619 620 // problem parameter filters621 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ProblemParameterNameFilter).AssemblyQualifiedName, "Problem Parameter Name", okb.ProblemParameters.Select(x => x.Name).Distinct().ToArray()));622 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))623 filters.Add(new DataTransfer.NameSetComparisonStringAvailableValuesFilter(typeof(ProblemParameterBlobValueDataTypeNameFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value Data Type Name", entity.Name, okb.ProblemParameterBlobValues.Where(x => x.ProblemParameter.Name == entity.Name).Select(x => x.DataType.Name).Distinct().ToArray()));624 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "varbinary").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))625 filters.Add(new DataTransfer.NameEqualityComparisonByteArrayFilter(typeof(ProblemParameterBlobValueValueFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value", entity.Name));626 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "bit").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))627 filters.Add(new DataTransfer.NameEqualityComparisonBoolFilter(typeof(ProblemParameterBoolValueValueFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value", entity.Name));628 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "float").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))629 filters.Add(new DataTransfer.NameOrdinalComparisonDoubleFilter(typeof(ProblemParameterFloatValueValueFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value", entity.Name));630 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "bigint").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))631 filters.Add(new DataTransfer.NameOrdinalComparisonLongFilter(typeof(ProblemParameterIntValueValueFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value", entity.Name));632 foreach (ProblemParameter entity in okb.ProblemParameters.Where(x => x.DataType.SqlName == "nvarchar").AsEnumerable().Distinct<ProblemParameter>(new GenericEqualityComparer<ProblemParameter>((x, y) => x.Name == y.Name)))633 filters.Add(new DataTransfer.NameSetComparisonStringFilter(typeof(ProblemParameterStringValueValueFilter).AssemblyQualifiedName, "Problem Parameter " + entity.Name + " Value", entity.Name));634 635 // problem filters636 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ProblemNameFilter).AssemblyQualifiedName, "Problem Name", okb.Problems.Select(x => x.Name).Distinct().ToArray()));637 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ProblemClassNameFilter).AssemblyQualifiedName, "Problem Class Name", okb.ProblemClasses.Select(x => x.Name).Distinct().ToArray()));638 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ProblemPlatformNameFilter).AssemblyQualifiedName, "Problem Platform Name", okb.Platforms.Select(x => x.Name).Distinct().ToArray()));639 filters.Add(new DataTransfer.SetComparisonStringAvailableValuesFilter(typeof(ProblemDataDataTypeNameFilter).AssemblyQualifiedName, "Problem Data Type Name", okb.Problems.Select(x => x.ProblemData.DataType.Name).Distinct().ToArray()));640 641 // and/or filters642 filters.Add(new DataTransfer.AndFilter(typeof(AndFilter).AssemblyQualifiedName, "And"));643 filters.Add(new DataTransfer.OrFilter(typeof(OrFilter).AssemblyQualifiedName, "Or"));644 }645 return filters.OrderBy(x => x.Label);646 }647 public long QueryNumberOfRuns(DataTransfer.Filter filter) {648 using (OKBDataContext okb = new OKBDataContext()) {649 IFilter convertedFilter = (IFilter)Activator.CreateInstance(Type.GetType(filter.FilterTypeName), filter);650 return okb.Runs.Where(convertedFilter.Expression).LongCount();651 }652 }653 public IEnumerable<DataTransfer.Run> QueryRuns(DataTransfer.Filter filter) {654 using (OKBDataContext okb = new OKBDataContext()) {655 //DataLoadOptions dlo = new DataLoadOptions();656 //dlo.LoadWith<Run>(x => x.ResultBlobValues);657 //dlo.LoadWith<Run>(x => x.ResultBoolValues);658 //dlo.LoadWith<Run>(x => x.ResultFloatValues);659 //dlo.LoadWith<Run>(x => x.ResultIntValues);660 //dlo.LoadWith<Run>(x => x.ResultStringValues);661 //dlo.LoadWith<Run>(x => x.Experiment);662 //dlo.LoadWith<ResultBlobValue>(x => x.Result);663 //dlo.LoadWith<ResultBlobValue>(x => x.DataType);664 //dlo.LoadWith<ResultBoolValue>(x => x.Result);665 //dlo.LoadWith<ResultBoolValue>(x => x.DataType);666 //dlo.LoadWith<ResultFloatValue>(x => x.Result);667 //dlo.LoadWith<ResultFloatValue>(x => x.DataType);668 //dlo.LoadWith<ResultIntValue>(x => x.Result);669 //dlo.LoadWith<ResultIntValue>(x => x.DataType);670 //dlo.LoadWith<ResultStringValue>(x => x.Result);671 //dlo.LoadWith<ResultStringValue>(x => x.DataType);672 //dlo.LoadWith<Result>(x => x.Algorithm);673 //dlo.LoadWith<Result>(x => x.DataType);674 //dlo.LoadWith<Experiment>(x => x.Algorithm);675 //dlo.LoadWith<Experiment>(x => x.Problem);676 //dlo.LoadWith<Experiment>(x => x.AlgorithmParameterBlobValues);677 //dlo.LoadWith<Experiment>(x => x.AlgorithmParameterBoolValues);678 //dlo.LoadWith<Experiment>(x => x.AlgorithmParameterFloatValues);679 //dlo.LoadWith<Experiment>(x => x.AlgorithmParameterIntValues);680 //dlo.LoadWith<Experiment>(x => x.AlgorithmParameterStringValues);681 //dlo.LoadWith<Experiment>(x => x.ProblemParameterBlobValues);682 //dlo.LoadWith<Experiment>(x => x.ProblemParameterBoolValues);683 //dlo.LoadWith<Experiment>(x => x.ProblemParameterFloatValues);684 //dlo.LoadWith<Experiment>(x => x.ProblemParameterIntValues);685 //dlo.LoadWith<Experiment>(x => x.ProblemParameterStringValues);686 //dlo.LoadWith<AlgorithmParameterBlobValue>(x => x.AlgorithmParameter);687 //dlo.LoadWith<AlgorithmParameterBlobValue>(x => x.DataType);688 //dlo.LoadWith<AlgorithmParameterBoolValue>(x => x.AlgorithmParameter);689 //dlo.LoadWith<AlgorithmParameterBoolValue>(x => x.DataType);690 //dlo.LoadWith<AlgorithmParameterFloatValue>(x => x.AlgorithmParameter);691 //dlo.LoadWith<AlgorithmParameterFloatValue>(x => x.DataType);692 //dlo.LoadWith<AlgorithmParameterIntValue>(x => x.AlgorithmParameter);693 //dlo.LoadWith<AlgorithmParameterIntValue>(x => x.DataType);694 //dlo.LoadWith<AlgorithmParameterStringValue>(x => x.AlgorithmParameter);695 //dlo.LoadWith<AlgorithmParameterStringValue>(x => x.DataType);696 //dlo.LoadWith<ProblemParameterBlobValue>(x => x.ProblemParameter);697 //dlo.LoadWith<ProblemParameterBlobValue>(x => x.DataType);698 //dlo.LoadWith<ProblemParameterBoolValue>(x => x.ProblemParameter);699 //dlo.LoadWith<ProblemParameterBoolValue>(x => x.DataType);700 //dlo.LoadWith<ProblemParameterFloatValue>(x => x.ProblemParameter);701 //dlo.LoadWith<ProblemParameterFloatValue>(x => x.DataType);702 //dlo.LoadWith<ProblemParameterIntValue>(x => x.ProblemParameter);703 //dlo.LoadWith<ProblemParameterIntValue>(x => x.DataType);704 //dlo.LoadWith<ProblemParameterStringValue>(x => x.ProblemParameter);705 //dlo.LoadWith<ProblemParameterStringValue>(x => x.DataType);706 //dlo.LoadWith<AlgorithmParameter>(x => x.Algorithm);707 //dlo.LoadWith<AlgorithmParameter>(x => x.DataType);708 //dlo.LoadWith<ProblemParameter>(x => x.Problem);709 //dlo.LoadWith<ProblemParameter>(x => x.DataType);710 //dlo.LoadWith<Algorithm>(x => x.AlgorithmClass);711 //dlo.LoadWith<Algorithm>(x => x.Platform);712 //dlo.LoadWith<Problem>(x => x.ProblemClass);713 //dlo.LoadWith<Problem>(x => x.Platform);714 //okb.LoadOptions = dlo;715 716 DataLoadOptions dlo = new DataLoadOptions();717 dlo.LoadWith<Run>(x => x.ResultBlobValues);718 dlo.LoadWith<Run>(x => x.ResultBoolValues);719 dlo.LoadWith<Run>(x => x.ResultFloatValues);720 dlo.LoadWith<Run>(x => x.ResultIntValues);721 dlo.LoadWith<Run>(x => x.ResultStringValues);722 okb.LoadOptions = dlo;723 724 IFilter convertedFilter = (IFilter)Activator.CreateInstance(Type.GetType(filter.FilterTypeName), filter);725 var runs = okb.Runs.Where(convertedFilter.Expression).ToArray();726 var result = runs.Select(x => Convert.ToDto(x)).ToArray();727 return result;728 }729 }730 #endregion731 732 /*733 734 /// <summary>735 /// Gets the complete algorithm object graph up to the following entities:736 /// <list type="bullet">737 /// <item>Parameter</item>738 /// <item>Algorithm_Paramters.Parameter.DataType</item>739 /// <item>Algorithm_Results.Result.DataType</item>740 /// </list>741 /// </summary>742 /// <param name="id">The algorithm id.</param>743 /// <returns>An <see cref="Algorithm"/></returns>744 public Algorithm GetCompleteAlgorithm(int id) {745 using (OKBDataContext okb = new OKBDataContext()) {746 var dlo = new DataLoadOptions();747 dlo.LoadWith<Algorithm>(a => a.AlgorithmClass);748 dlo.LoadWith<Algorithm>(a => a.Platform);749 dlo.LoadWith<Algorithm>(a => a.AlgorithmUsers);750 dlo.LoadWith<AlgorithmUser>(u => u.User);751 okb.LoadOptions = dlo;752 return okb.Algorithms.Single(a => a.Id == id);753 }754 }755 756 /// <summary>757 /// Gets the complete problem object graph up to the following entities:758 /// <list type="bullet">759 /// <item>Platform</item>760 /// <item>SolutionRepresentation</item>761 /// <item>Problem_Parameters.Parameter</item>762 /// <item>IntProblemCharacteristicValues.ProblemCharacteristic.DataType</item>763 /// <item>FloatProblemCharacteristicValues.ProblemCharacteristic.DataType</item>764 /// <item>CharProblemCharacteristicValues.ProblemCharacteristic.DataType</item>765 /// </list>766 /// </summary>767 /// <param name="id">The problem id.</param>768 /// <returns>A <see cref="Problem"/></returns>769 public Problem GetCompleteProblem(int id) {770 using (OKBDataContext okb = new OKBDataContext()) {771 var dlo = new DataLoadOptions();772 dlo.LoadWith<Problem>(p => p.ProblemClass);773 dlo.LoadWith<Problem>(p => p.Platform);774 dlo.LoadWith<Problem>(p => p.ProblemUsers);775 dlo.LoadWith<ProblemUser>(u => u.User);776 okb.LoadOptions = dlo;777 return okb.Problems.Single(p => p.Id == id);778 }779 }780 781 /// <summary>782 /// Updates the algorithm object graph including the following properties and linked entitites:783 /// <list type="bullet">784 /// <item>Name</item>785 /// <item>Description</item>786 /// <item>AlgorithmClassId</item>787 /// <item>PlatformId</item>788 /// <item>Algorithm_Parameters</item>789 /// <item>Algorithm_Results</item>790 /// </list>791 /// <remarks>792 /// New <see cref="Parameter"/>s or <see cref="Result"/>s will not be793 /// created but have to be pre-existing.794 /// </remarks>795 /// </summary>796 /// <param name="algorithm">The algorithm.</param>797 public void UpdateCompleteAlgorithm(Algorithm algorithm) {798 using (OKBDataContext okb = new OKBDataContext()) {799 Algorithm original = okb.Algorithms.Single(a => a.Id == algorithm.Id);800 UpdateAlgorithmData(algorithm, original, okb);801 okb.SubmitChanges();802 }803 }804 805 /// <summary>806 /// Updates the problem object graph including the following properties and linked entities:807 /// <list type="bullet">808 /// <item>Name</item>809 /// <item>Description</item>810 /// <item>ProblemClassId</item>811 /// <item>PlatformId</item>812 /// <item>SolutionRepresentationId</item>813 /// <item>IntProblemCharacteristicValues.Value</item>814 /// <item>FloatProblemCharacteristicValues.Value</item>815 /// <item>CharProblemCharacteristicValues.Value</item>816 /// <item>Problem_Parameters</item>817 /// </list>818 /// <remarks>819 /// New <see cref="ProblemCharacteristic"/>s or <see cref="Parameter"/>s will820 /// not be created but have to be pre-existing.821 /// </remarks>822 /// </summary>823 /// <param name="problem">The problem.</param>824 public void UpdateCompleteProblem(Problem problem) {825 using (OKBDataContext okb = new OKBDataContext()) {826 Problem originalProblem = okb.Problems.Single(p => p.Id == problem.Id);827 UpdateProblemData(problem, originalProblem, okb);828 okb.SubmitChanges();829 }830 }831 832 private static void UpdateAlgorithmData(Algorithm algorithm, Algorithm original, OKBDataContext okb) {833 original.Name = algorithm.Name;834 original.Description = algorithm.Description;835 original.AlgorithmClassId = algorithm.AlgorithmClassId;836 original.PlatformId = algorithm.PlatformId;837 okb.AlgorithmUsers.DeleteAllOnSubmit(original.AlgorithmUsers);838 original.AlgorithmUsers.Clear();839 foreach (var u in algorithm.AlgorithmUsers) {840 original.AlgorithmUsers.Add(new AlgorithmUser() {841 AlgorithmId = original.Id,842 UserId = u.UserId843 });844 }845 }846 847 private static void UpdateProblemData(Problem problem, Problem original, OKBDataContext okb) {848 original.Name = problem.Name;849 original.Description = problem.Description;850 original.ProblemClassId = problem.ProblemClassId;851 original.SolutionRepresentationId = problem.SolutionRepresentationId;852 original.PlatformId = problem.PlatformId;853 okb.ProblemUsers.DeleteAllOnSubmit(original.ProblemUsers);854 original.ProblemUsers.Clear();855 foreach (var u in problem.ProblemUsers) {856 original.ProblemUsers.Add(new ProblemUser() {857 ProblemId = original.Id,858 UserId = u.UserId859 });860 }861 }*/862 563 } 863 564 } -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj
r5295 r5299 120 120 </ItemGroup> 121 121 <ItemGroup> 122 <Compile Include="AdministrationService.cs" /> 122 123 <Compile Include="Convert.cs" /> 123 124 <Compile Include="AuthenticationService.cs" /> 125 <Compile Include="Interfaces\IAdministrationService.cs" /> 126 <Compile Include="QueryService.cs" /> 124 127 <Compile Include="Filters\AlgorithmParameterBlobValueDataTypeNameFilter.cs" /> 125 128 <Compile Include="Filters\AlgorithmParameterBlobValueValueFilter.cs" /> … … 159 162 <Compile Include="GenericEqualityComparer.cs" /> 160 163 <Compile Include="ExperimentEqualityComparer.cs" /> 161 <Compile Include=" Filters\IFilter.cs" />164 <Compile Include="Interfaces\IQueryService.cs" /> 162 165 <Compile Include="Interfaces\IAuthenticationService.cs" /> 163 <Compile Include="Interfaces\IOKBService.cs" /> 164 <Compile Include="OKBService.cs" /> 166 <Compile Include="Interfaces\IFilter.cs" /> 165 167 <Compile Include="Properties\AssemblyInfo.cs" /> 166 168 </ItemGroup> -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Interfaces/IAdministrationService.cs
r5298 r5299 28 28 namespace HeuristicLab.Services.OKB { 29 29 /// <summary> 30 /// Interface of the OKB service.30 /// Interface of the OKB administration service. 31 31 /// </summary> 32 32 [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)] 33 public interface I OKBService {33 public interface IAdministrationService { 34 34 #region Platform Methods 35 35 [OperationContract] … … 192 192 void DeleteRun(long id); 193 193 #endregion 194 195 #region Query Methods196 [OperationContract]197 IEnumerable<Filter> GetFilters();198 [OperationContract]199 long QueryNumberOfRuns(Filter filter);200 [OperationContract]201 IEnumerable<Run> QueryRuns(Filter filter);202 #endregion203 194 } 204 195 } -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/app.config
r5295 r5299 41 41 </binding> 42 42 </wsHttpBinding> 43 <netTcpBinding>44 <binding name="DefaultNetTcpBinding" openTimeout="00:00:30" receiveTimeout="00:00:30" sendTimeout="00:00:30" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">45 <security mode="Message">46 <message clientCredentialType="UserName" />47 </security>48 <readerQuotas maxArrayLength="2147483647" />49 <reliableSession inactivityTimeout="00:00:30" enabled="false" />50 </binding>51 </netTcpBinding>52 43 </bindings> 53 44 … … 68 59 69 60 <services> 70 <service name="HeuristicLab.Services.OKB.OKBService" behaviorConfiguration="DefaultServiceBehavior"> 71 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 72 <endpoint binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" contract="HeuristicLab.Services.OKB.IOKBService" /> 73 <host> 74 <baseAddresses> 75 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/OKBService" /> 76 </baseAddresses> 77 </host> 78 </service> 79 80 <service name="HeuristicLab.Services.OKB.AuthenticationService" behaviorConfiguration="DefaultServiceBehavior"> 81 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 82 <endpoint binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" contract="HeuristicLab.Services.OKB.IAuthenticationService" /> 61 <service behaviorConfiguration="DefaultServiceBehavior" name="HeuristicLab.Services.OKB.AuthenticationService"> 62 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" 63 contract="IMetadataExchange" /> 64 <endpoint binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 65 contract="HeuristicLab.Services.OKB.IAuthenticationService" /> 83 66 <host> 84 67 <baseAddresses> … … 87 70 </host> 88 71 </service> 89 90 <service name="HeuristicLab.Services.OKB.TableService" behaviorConfiguration="DefaultServiceBehavior"> 91 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 92 <endpoint binding="netTcpBinding" bindingConfiguration="DefaultNetTcpBinding" contract="HeuristicLab.Services.OKB.ITableService" /> 72 <service behaviorConfiguration="DefaultServiceBehavior" name="HeuristicLab.Services.OKB.AdministrationService"> 73 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" 74 contract="IMetadataExchange" /> 75 <endpoint binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 76 contract="HeuristicLab.Services.OKB.IAdministrationService" /> 93 77 <host> 94 78 <baseAddresses> 95 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/TableService" /> 96 <add baseAddress="net.tcp://localhost:8733/OKB-3.3/TableService" /> 79 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/AdministrationService" /> 97 80 </baseAddresses> 98 81 </host> 99 82 </service> 100 101 <service name="HeuristicLab.Services.OKB.DataService" behaviorConfiguration="DefaultServiceBehavior"> 102 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 103 <endpoint binding="netTcpBinding" bindingConfiguration="DefaultNetTcpBinding" contract="HeuristicLab.Services.OKB.IDataService" /> 104 <host> 105 <baseAddresses> 106 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/DataService" /> 107 <add baseAddress="net.tcp://localhost:8733/OKB-3.3/DataService" /> 108 </baseAddresses> 109 </host> 110 </service> 111 112 <service name="HeuristicLab.Services.OKB.RunnerService" behaviorConfiguration="DefaultServiceBehavior"> 113 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 114 <endpoint binding="netTcpBinding" bindingConfiguration="DefaultNetTcpBinding" contract="HeuristicLab.Services.OKB.IRunnerService" /> 115 <host> 116 <baseAddresses> 117 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/RunnerService" /> 118 <add baseAddress="net.tcp://localhost:8733/OKB-3.3/RunnerService" /> 119 </baseAddresses> 120 </host> 121 </service> 122 123 <service name="HeuristicLab.Services.OKB.QueryService" behaviorConfiguration="DefaultServiceBehavior"> 124 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 125 <endpoint binding="netTcpBinding" bindingConfiguration="DefaultNetTcpBinding" contract="HeuristicLab.Services.OKB.IQueryService" /> 83 <service behaviorConfiguration="DefaultServiceBehavior" name="HeuristicLab.Services.OKB.QueryService"> 84 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" 85 contract="IMetadataExchange" /> 86 <endpoint binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 87 contract="HeuristicLab.Services.OKB.IQueryService" /> 126 88 <host> 127 89 <baseAddresses> 128 90 <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/QueryService" /> 129 <add baseAddress="net.tcp://localhost:8733/OKB-3.3/QueryService" />130 91 </baseAddresses> 131 92 </host> … … 133 94 </services> 134 95 </system.serviceModel> 135 136 96 <startup> 137 97 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
Note: See TracChangeset
for help on using the changeset viewer.