Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/15/11 01:35:43 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

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  
    109109    <Compile Include="ServiceClients\AlgorithmParameter.cs" />
    110110    <Compile Include="ServiceClients\AndFilter.cs" />
     111    <Compile Include="ServiceClients\OKBServiceClients.cs" />
    111112    <Compile Include="ServiceClients\SetComparisonStringAvailableValuesFilter.cs" />
    112113    <Compile Include="ServiceClients\NameSetComparisonStringAvailableValuesFilter.cs" />
     
    125126    <Compile Include="ServiceClients\Result.cs" />
    126127    <Compile Include="ServiceClients\ProblemParameter.cs" />
    127     <Compile Include="ServiceClients\OKBServiceClient.cs" />
    128128    <Compile Include="ServiceClients\ProblemData.cs" />
    129129    <Compile Include="ServiceClients\Problem.cs" />
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/OKBClient.cs

    r5295 r5299  
    103103      var call = new Func<Exception>(delegate() {
    104104        try {
    105           platforms.AddRange(CallAdminService<List<Platform>>(s => s.GetPlatforms()).OrderBy(x => x.Name));
    106           dataTypes.AddRange(CallAdminService<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));
    107107          users = CallAuthenticationService<List<User>>(s => s.GetUsers()).OrderBy(x => x.Name);
    108           algorithmClasses.AddRange(CallAdminService<List<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(x => x.Name));
    109           algorithms.AddRange(CallAdminService<List<Algorithm>>(s => s.GetAlgorithms()).OrderBy(x => x.Name));
    110           problemClasses.AddRange(CallAdminService<List<ProblemClass>>(s => s.GetProblemClasses()).OrderBy(x => x.Name));
    111           problems.AddRange(CallAdminService<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));
    112112          return null;
    113113        }
     
    129129        if (item.Id == 0) {
    130130          if (item is Platform)
    131             item.Id = CallAdminService<long>(s => s.AddPlatform((Platform)item));
     131            item.Id = CallAdministrationService<long>(s => s.AddPlatform((Platform)item));
    132132          else if (item is DataType)
    133             item.Id = CallAdminService<long>(s => s.AddDataType((DataType)item));
     133            item.Id = CallAdministrationService<long>(s => s.AddDataType((DataType)item));
    134134          else if (item is AlgorithmClass)
    135             item.Id = CallAdminService<long>(s => s.AddAlgorithmClass((AlgorithmClass)item));
     135            item.Id = CallAdministrationService<long>(s => s.AddAlgorithmClass((AlgorithmClass)item));
    136136          else if (item is Algorithm)
    137             item.Id = CallAdminService<long>(s => s.AddAlgorithm((Algorithm)item));
     137            item.Id = CallAdministrationService<long>(s => s.AddAlgorithm((Algorithm)item));
    138138          else if (item is AlgorithmParameter)
    139             item.Id = CallAdminService<long>(s => s.AddAlgorithmParameter((AlgorithmParameter)item));
     139            item.Id = CallAdministrationService<long>(s => s.AddAlgorithmParameter((AlgorithmParameter)item));
    140140          else if (item is ProblemClass)
    141             item.Id = CallAdminService<long>(s => s.AddProblemClass((ProblemClass)item));
     141            item.Id = CallAdministrationService<long>(s => s.AddProblemClass((ProblemClass)item));
    142142          else if (item is Problem)
    143             item.Id = CallAdminService<long>(s => s.AddProblem((Problem)item));
     143            item.Id = CallAdministrationService<long>(s => s.AddProblem((Problem)item));
    144144          else if (item is ProblemParameter)
    145             item.Id = CallAdminService<long>(s => s.AddProblemParameter((ProblemParameter)item));
     145            item.Id = CallAdministrationService<long>(s => s.AddProblemParameter((ProblemParameter)item));
    146146          else if (item is Result)
    147             item.Id = CallAdminService<long>(s => s.AddResult((Result)item));
     147            item.Id = CallAdministrationService<long>(s => s.AddResult((Result)item));
    148148          else if (item is Experiment)
    149             item.Id = CallAdminService<long>(s => s.AddExperiment((Experiment)item));
     149            item.Id = CallAdministrationService<long>(s => s.AddExperiment((Experiment)item));
    150150          else if (item is Run)
    151             item.Id = CallAdminService<long>(s => s.AddRun((Run)item));
     151            item.Id = CallAdministrationService<long>(s => s.AddRun((Run)item));
    152152        } else {
    153153          if (item is Platform)
    154             CallAdminService(s => s.UpdatePlatform((Platform)item));
     154            CallAdministrationService(s => s.UpdatePlatform((Platform)item));
    155155          else if (item is DataType)
    156             CallAdminService(s => s.UpdateDataType((DataType)item));
     156            CallAdministrationService(s => s.UpdateDataType((DataType)item));
    157157          else if (item is AlgorithmClass)
    158             CallAdminService(s => s.UpdateAlgorithmClass((AlgorithmClass)item));
     158            CallAdministrationService(s => s.UpdateAlgorithmClass((AlgorithmClass)item));
    159159          else if (item is Algorithm)
    160             CallAdminService(s => s.UpdateAlgorithm((Algorithm)item));
     160            CallAdministrationService(s => s.UpdateAlgorithm((Algorithm)item));
    161161          else if (item is AlgorithmParameter)
    162             CallAdminService(s => s.UpdateAlgorithmParameter((AlgorithmParameter)item));
     162            CallAdministrationService(s => s.UpdateAlgorithmParameter((AlgorithmParameter)item));
    163163          else if (item is ProblemClass)
    164             CallAdminService(s => s.UpdateProblemClass((ProblemClass)item));
     164            CallAdministrationService(s => s.UpdateProblemClass((ProblemClass)item));
    165165          else if (item is Problem)
    166             CallAdminService(s => s.UpdateProblem((Problem)item));
     166            CallAdministrationService(s => s.UpdateProblem((Problem)item));
    167167          else if (item is ProblemParameter)
    168             CallAdminService(s => s.UpdateProblemParameter((ProblemParameter)item));
     168            CallAdministrationService(s => s.UpdateProblemParameter((ProblemParameter)item));
    169169          else if (item is Result)
    170             CallAdminService(s => s.UpdateResult((Result)item));
     170            CallAdministrationService(s => s.UpdateResult((Result)item));
    171171          else if (item is Experiment)
    172             item.Id = CallAdminService<long>(s => s.AddExperiment((Experiment)item));
     172            item.Id = CallAdministrationService<long>(s => s.AddExperiment((Experiment)item));
    173173          else if (item is Run)
    174             item.Id = CallAdminService<long>(s => s.AddRun((Run)item));
     174            item.Id = CallAdministrationService<long>(s => s.AddRun((Run)item));
    175175        }
    176176        return true;
     
    213213    public List<Guid> GetAlgorithmUsers(long algorithmId) {
    214214      try {
    215         return CallAdminService<List<Guid>>(s => s.GetAlgorithmUsers(algorithmId));
     215        return CallAdministrationService<List<Guid>>(s => s.GetAlgorithmUsers(algorithmId));
    216216      }
    217217      catch (Exception ex) {
     
    222222    public bool UpdateAlgorithmUsers(long algorithmId, List<Guid> users) {
    223223      try {
    224         CallAdminService(s => s.UpdateAlgorithmUsers(algorithmId, users));
     224        CallAdministrationService(s => s.UpdateAlgorithmUsers(algorithmId, users));
    225225        return true;
    226226      }
     
    232232    public AlgorithmData GetAlgorithmData(long algorithmId) {
    233233      try {
    234         return CallAdminService<AlgorithmData>(s => s.GetAlgorithmData(algorithmId));
     234        return CallAdministrationService<AlgorithmData>(s => s.GetAlgorithmData(algorithmId));
    235235      }
    236236      catch (Exception ex) {
     
    241241    public bool UpdateAlgorithmData(AlgorithmData algorithmData) {
    242242      try {
    243         CallAdminService(s => s.UpdateAlgorithmData(algorithmData));
     243        CallAdministrationService(s => s.UpdateAlgorithmData(algorithmData));
    244244        return true;
    245245      }
     
    254254    public List<Guid> GetProblemUsers(long problemId) {
    255255      try {
    256         return CallAdminService<List<Guid>>(s => s.GetProblemUsers(problemId));
     256        return CallAdministrationService<List<Guid>>(s => s.GetProblemUsers(problemId));
    257257      }
    258258      catch (Exception ex) {
     
    263263    public bool UpdateProblemUsers(long problemId, List<Guid> users) {
    264264      try {
    265         CallAdminService(s => s.UpdateProblemUsers(problemId, users));
     265        CallAdministrationService(s => s.UpdateProblemUsers(problemId, users));
    266266        return true;
    267267      }
     
    273273    public ProblemData GetProblemData(long problemId) {
    274274      try {
    275         return CallAdminService<ProblemData>(s => s.GetProblemData(problemId));
     275        return CallAdministrationService<ProblemData>(s => s.GetProblemData(problemId));
    276276      }
    277277      catch (Exception ex) {
     
    282282    public bool UpdateProblemData(ProblemData problemData) {
    283283      try {
    284         CallAdminService(s => s.UpdateProblemData(problemData));
     284        CallAdministrationService(s => s.UpdateProblemData(problemData));
    285285        return true;
    286286      }
     
    295295    public AlgorithmParameter GetAlgorithmParameter(long id) {
    296296      try {
    297         return CallAdminService<AlgorithmParameter>(s => s.GetAlgorithmParameter(id));
     297        return CallAdministrationService<AlgorithmParameter>(s => s.GetAlgorithmParameter(id));
    298298      }
    299299      catch (Exception ex) {
     
    305305      try {
    306306        ItemCollection<AlgorithmParameter> parameters = new ItemCollection<AlgorithmParameter>();
    307         parameters.AddRange(CallAdminService<List<AlgorithmParameter>>(s => s.GetAlgorithmParameters(algorithmId)).OrderBy(x => x.Name));
     307        parameters.AddRange(CallAdministrationService<List<AlgorithmParameter>>(s => s.GetAlgorithmParameters(algorithmId)).OrderBy(x => x.Name));
    308308        return parameters;
    309309      }
     
    318318    public ProblemParameter GetProblemParameter(long id) {
    319319      try {
    320         return CallAdminService<ProblemParameter>(s => s.GetProblemParameter(id));
     320        return CallAdministrationService<ProblemParameter>(s => s.GetProblemParameter(id));
    321321      }
    322322      catch (Exception ex) {
     
    328328      try {
    329329        ItemCollection<ProblemParameter> parameters = new ItemCollection<ProblemParameter>();
    330         parameters.AddRange(CallAdminService<List<ProblemParameter>>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name));
     330        parameters.AddRange(CallAdministrationService<List<ProblemParameter>>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name));
    331331        return parameters;
    332332      }
     
    341341    public Result GetResult(long id) {
    342342      try {
    343         return CallAdminService<Result>(s => s.GetResult(id));
     343        return CallAdministrationService<Result>(s => s.GetResult(id));
    344344      }
    345345      catch (Exception ex) {
     
    351351      try {
    352352        ItemCollection<Result> results = new ItemCollection<Result>();
    353         results.AddRange(CallAdminService<List<Result>>(s => s.GetResults(algorithmId)).OrderBy(x => x.Name));
     353        results.AddRange(CallAdministrationService<List<Result>>(s => s.GetResults(algorithmId)).OrderBy(x => x.Name));
    354354        return results;
    355355      }
     
    364364    public Experiment GetExperiment(long id) {
    365365      try {
    366         return CallAdminService<Experiment>(s => s.GetExperiment(id));
     366        return CallAdministrationService<Experiment>(s => s.GetExperiment(id));
    367367      }
    368368      catch (Exception ex) {
     
    374374      try {
    375375        ItemCollection<Experiment> experiments = new ItemCollection<Experiment>();
    376         experiments.AddRange(CallAdminService<List<Experiment>>(s => s.GetExperiments(algorithmId, problemId)));
     376        experiments.AddRange(CallAdministrationService<List<Experiment>>(s => s.GetExperiments(algorithmId, problemId)));
    377377        experiments.ItemsRemoved += new CollectionItemsChangedEventHandler<Experiment>(experiments_ItemsRemoved);
    378378        return experiments;
     
    389389      try {
    390390        ItemCollection<Run> runs = new ItemCollection<Run>();
    391         runs.AddRange(CallAdminService<List<Run>>(s => s.GetRuns(experimentId)).OrderByDescending(x => x.CreatedDate));
     391        runs.AddRange(CallAdministrationService<List<Run>>(s => s.GetRuns(experimentId)).OrderByDescending(x => x.CreatedDate));
    392392        runs.ItemsRemoved += new CollectionItemsChangedEventHandler<Run>(runs_ItemsRemoved);
    393393        return runs;
     
    692692      if (refresh || (filters == null)) {
    693693        try {
    694           filters = CallAdminService<List<Filter>>(s => s.GetFilters());
     694          filters = CallQueryService<List<Filter>>(s => s.GetFilters());
    695695        }
    696696        catch (Exception ex) {
     
    706706    public long QueryNumberOfRuns(Filter filter) {
    707707      try {
    708         return CallAdminService<long>(x => x.QueryNumberOfRuns(filter));
     708        return CallQueryService<long>(x => x.QueryNumberOfRuns(filter));
    709709      }
    710710      catch (Exception ex) {
     
    716716      try {
    717717        ItemCollection<Run> runs = new ItemCollection<Run>();
    718         runs.AddRange(CallAdminService<List<Run>>(s => s.QueryRuns(filter)).OrderByDescending(x => x.CreatedDate));
     718        runs.AddRange(CallQueryService<List<Run>>(s => s.QueryRuns(filter)).OrderByDescending(x => x.CreatedDate));
    719719        return runs;
    720720      }
     
    741741      try {
    742742        foreach (Platform p in e.Items)
    743           CallAdminService(s => s.DeletePlatform(p.Id));
     743          CallAdministrationService(s => s.DeletePlatform(p.Id));
    744744      }
    745745      catch (Exception ex) {
     
    750750      try {
    751751        foreach (DataType d in e.Items)
    752           CallAdminService(s => s.DeleteDataType(d.Id));
     752          CallAdministrationService(s => s.DeleteDataType(d.Id));
    753753      }
    754754      catch (Exception ex) {
     
    759759      try {
    760760        foreach (AlgorithmClass a in e.Items)
    761           CallAdminService(s => s.DeleteAlgorithmClass(a.Id));
     761          CallAdministrationService(s => s.DeleteAlgorithmClass(a.Id));
    762762      }
    763763      catch (Exception ex) {
     
    768768      try {
    769769        foreach (Algorithm a in e.Items)
    770           CallAdminService(s => s.DeleteAlgorithm(a.Id));
     770          CallAdministrationService(s => s.DeleteAlgorithm(a.Id));
    771771      }
    772772      catch (Exception ex) {
     
    777777      try {
    778778        foreach (ProblemClass p in e.Items)
    779           CallAdminService(s => s.DeleteProblemClass(p.Id));
     779          CallAdministrationService(s => s.DeleteProblemClass(p.Id));
    780780      }
    781781      catch (Exception ex) {
     
    786786      try {
    787787        foreach (Problem p in e.Items)
    788           CallAdminService(s => s.DeleteProblem(p.Id));
     788          CallAdministrationService(s => s.DeleteProblem(p.Id));
    789789      }
    790790      catch (Exception ex) {
     
    795795      try {
    796796        foreach (Experiment exp in e.Items)
    797           CallAdminService(s => s.DeleteExperiment(exp.Id));
     797          CallAdministrationService(s => s.DeleteExperiment(exp.Id));
    798798      }
    799799      catch (Exception ex) {
     
    804804      try {
    805805        foreach (Run r in e.Items)
    806           CallAdminService(s => s.DeleteRun(r.Id));
     806          CallAdministrationService(s => s.DeleteRun(r.Id));
    807807      }
    808808      catch (Exception ex) {
     
    813813
    814814    #region Helpers
    815     private void CallAdminService(Action<IOKBService> call) {
    816       OKBServiceClient client = ClientFactory.CreateClient<OKBServiceClient, IOKBService>();
     815    private void CallAdministrationService(Action<IAdministrationService> call) {
     816      AdministrationServiceClient client = ClientFactory.CreateClient<AdministrationServiceClient, IAdministrationService>();
    817817      try {
    818818        call(client);
     
    827827      }
    828828    }
    829     private T CallAdminService<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>();
    831831      try {
    832832        return call(client);
     
    841841      }
    842842    }
     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    }
    843871    private T CallAuthenticationService<T>(Func<IAuthenticationService, T> call) {
    844872      AuthenticationServiceClient client = ClientFactory.CreateClient<AuthenticationServiceClient, IAuthenticationService>();
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/ServiceClients/GenerateServiceClients.cmd

    r5295 r5299  
    33echo.
    44echo *******************************************************************************************
    5 echo Generating OKBService client
     5echo Generating OKB service clients
    66echo.
    77
     
    99
    1010svcutil.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 ^
    1314  /namespace:*,HeuristicLab.Clients.OKB ^
    1415  /collectionType:System.Collections.Generic.List`1 ^
     
    2728echo ---------------------------------------------------------------------------------------
    2829echo.
    29 echo Generation of OKBService client finished.
     30echo Generation of OKB service clients finished.
    3031echo *******************************************************************************************
    3132echo.
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/app.config

    r5295 r5299  
    1111    <bindings>
    1212      <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"
    1431            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    1532            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     
    4865    </bindings>
    4966    <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"
    5378          behaviorConfiguration="DefaultEndpointBehavior">
    5479        <identity>
     
    5984          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAuthenticationService"
    6085          contract="HeuristicLab.Clients.OKB.IAuthenticationService"
    61           name="WSHttpBinding_IAuthenticationService">
     86          name="WSHttpBinding_IAuthenticationService" behaviorConfiguration="DefaultEndpointBehavior">
    6287        <identity>
    6388          <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  
    2929namespace HeuristicLab.Services.OKB {
    3030  /// <summary>
    31   /// Implementation of the OKB service (interface <see cref="IOKBService"/>).
     31  /// Implementation of the OKB administration service (interface <see cref="IAdministrationService"/>).
    3232  /// </summary>
    3333  [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    34   public class OKBService : IOKBService {
     34  public class AdministrationService : IAdministrationService {
    3535    #region Platform Methods
    3636    public DataTransfer.Platform GetPlatform(long id) {
     
    561561    }
    562562    #endregion
    563 
    564     #region Query Methods
    565     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 filters
    579         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 filters
    585         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 filters
    600         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 filters
    615         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 filters
    621         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 filters
    636         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 filters
    642         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     #endregion
    731 
    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 be
    793     /// 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 will
    820     /// 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.UserId
    843         });
    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.UserId
    859         });
    860       }
    861     }*/
    862563  }
    863564}
  • branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj

    r5295 r5299  
    120120  </ItemGroup>
    121121  <ItemGroup>
     122    <Compile Include="AdministrationService.cs" />
    122123    <Compile Include="Convert.cs" />
    123124    <Compile Include="AuthenticationService.cs" />
     125    <Compile Include="Interfaces\IAdministrationService.cs" />
     126    <Compile Include="QueryService.cs" />
    124127    <Compile Include="Filters\AlgorithmParameterBlobValueDataTypeNameFilter.cs" />
    125128    <Compile Include="Filters\AlgorithmParameterBlobValueValueFilter.cs" />
     
    159162    <Compile Include="GenericEqualityComparer.cs" />
    160163    <Compile Include="ExperimentEqualityComparer.cs" />
    161     <Compile Include="Filters\IFilter.cs" />
     164    <Compile Include="Interfaces\IQueryService.cs" />
    162165    <Compile Include="Interfaces\IAuthenticationService.cs" />
    163     <Compile Include="Interfaces\IOKBService.cs" />
    164     <Compile Include="OKBService.cs" />
     166    <Compile Include="Interfaces\IFilter.cs" />
    165167    <Compile Include="Properties\AssemblyInfo.cs" />
    166168  </ItemGroup>
  • branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Interfaces/IAdministrationService.cs

    r5298 r5299  
    2828namespace HeuristicLab.Services.OKB {
    2929  /// <summary>
    30   /// Interface of the OKB service.
     30  /// Interface of the OKB administration service.
    3131  /// </summary>
    3232  [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
    33   public interface IOKBService {
     33  public interface IAdministrationService {
    3434    #region Platform Methods
    3535    [OperationContract]
     
    192192    void DeleteRun(long id);
    193193    #endregion
    194 
    195     #region Query Methods
    196     [OperationContract]
    197     IEnumerable<Filter> GetFilters();
    198     [OperationContract]
    199     long QueryNumberOfRuns(Filter filter);
    200     [OperationContract]
    201     IEnumerable<Run> QueryRuns(Filter filter);
    202     #endregion
    203194  }
    204195}
  • branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/app.config

    r5295 r5299  
    4141        </binding>
    4242      </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>
    5243    </bindings>
    5344
     
    6859
    6960    <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" />
    8366        <host>
    8467          <baseAddresses>
     
    8770        </host>
    8871      </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" />
    9377        <host>
    9478          <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" />
    9780          </baseAddresses>
    9881        </host>
    9982      </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" />
    12688        <host>
    12789          <baseAddresses>
    12890            <add baseAddress="http://localhost:8732/Design_Time_Addresses/OKB-3.3/QueryService" />
    129             <add baseAddress="net.tcp://localhost:8733/OKB-3.3/QueryService" />
    13091          </baseAddresses>
    13192        </host>
     
    13394    </services>
    13495  </system.serviceModel>
    135 
    13696  <startup>
    13797    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
Note: See TracChangeset for help on using the changeset viewer.