1 | /* |
---|
2 | * To change this template, choose Tools | Templates |
---|
3 | * and open the template in the editor. |
---|
4 | */ |
---|
5 | package com.heurisitclab.okb.service.runcreation; |
---|
6 | |
---|
7 | import com.heuristiclab.services.runcreation.IRunCreationService; |
---|
8 | import com.heuristiclab.services.runcreation.RunCreationService; |
---|
9 | import java.net.MalformedURLException; |
---|
10 | import java.net.URL; |
---|
11 | |
---|
12 | /** |
---|
13 | * |
---|
14 | * @author fab |
---|
15 | */ |
---|
16 | public class RunCreationUtil { |
---|
17 | |
---|
18 | public static IRunCreationService createRunCreationService() { |
---|
19 | try { |
---|
20 | RunCreationService srv = new RunCreationService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/RunCreationService.svc")); |
---|
21 | IRunCreationService port = srv.getRunCreationService(); |
---|
22 | return port; |
---|
23 | |
---|
24 | } catch (MalformedURLException mue) { |
---|
25 | throw new IllegalStateException(mue); |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | public static Algorithm getAlgorithm(String name, String platformName) |
---|
30 | { |
---|
31 | |
---|
32 | Algorithm returnValue = null; |
---|
33 | IRunCreationService service = createRunCreationService(); |
---|
34 | for(com.heuristiclab.services.runcreation.Algorithm o : service.getAlgorithms(platformName).getAlgorithm()) |
---|
35 | { |
---|
36 | if(o.getName().getValue().equals(name)) |
---|
37 | { |
---|
38 | returnValue = new Algorithm(o); |
---|
39 | } |
---|
40 | } |
---|
41 | if(returnValue == null) |
---|
42 | { |
---|
43 | throw new IllegalArgumentException("algorithm " + name + " does not exsis in okb!"); |
---|
44 | } |
---|
45 | |
---|
46 | return returnValue; |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | public static Run createRun() |
---|
54 | { |
---|
55 | // Run returnValue = new Run(); |
---|
56 | // com.heuristiclab.services.runcreation.Run r = null; |
---|
57 | // r.setAlgorithmId(Long.MIN_VALUE); |
---|
58 | // r.setClientId(null); |
---|
59 | // r.setProblemId(Long.MIN_VALUE); |
---|
60 | // r.setUserId(null); |
---|
61 | // createAdministrationService(); |
---|
62 | |
---|
63 | |
---|
64 | return null; |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | } |
---|