1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ws.jws2.dm; |
22 |
|
|
23 |
|
import jalview.util.MessageManager; |
24 |
|
import jalview.ws.jws2.JabaParamStore; |
25 |
|
import jalview.ws.jws2.JabaPreset; |
26 |
|
import jalview.ws.jws2.ParameterUtils; |
27 |
|
import jalview.ws.jws2.jabaws2.Jws2Instance; |
28 |
|
import jalview.ws.params.ArgumentI; |
29 |
|
import jalview.ws.params.WsParamSetI; |
30 |
|
|
31 |
|
import java.util.ArrayList; |
32 |
|
import java.util.List; |
33 |
|
|
34 |
|
import compbio.metadata.Argument; |
35 |
|
import compbio.metadata.Option; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@author |
41 |
|
|
42 |
|
|
|
|
| 0% |
Uncovered Elements: 65 (65) |
Complexity: 21 |
Complexity Density: 0.57 |
|
43 |
|
public class AAConSettings extends jalview.ws.params.AutoCalcSetting |
44 |
|
{ |
45 |
|
Jws2Instance service; |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
47 |
0 |
public AAConSettings(boolean autoUpdate, Jws2Instance service,... |
48 |
|
WsParamSetI preset, List<ArgumentI> jobArgset) |
49 |
|
{ |
50 |
0 |
super(preset, jobArgset, autoUpdate); |
51 |
0 |
this.service = service; |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public Jws2Instance getService()... |
55 |
|
{ |
56 |
0 |
return service; |
57 |
|
} |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 8 |
Complexity Density: 0.44 |
|
59 |
0 |
public void setService(Jws2Instance service)... |
60 |
|
{ |
61 |
0 |
this.service = service; |
62 |
0 |
if (preset != null) |
63 |
|
{ |
64 |
|
|
65 |
0 |
for (String url : preset.getApplicableUrls()) |
66 |
|
{ |
67 |
0 |
if (url.equals(service.getUri())) |
68 |
|
{ |
69 |
0 |
return; |
70 |
|
} |
71 |
|
} |
72 |
0 |
WsParamSetI pr = service.getParamStore().getPreset(preset.getName()); |
73 |
0 |
if (pr instanceof JabaPreset && preset instanceof JabaPreset) |
74 |
|
{ |
75 |
|
|
76 |
0 |
preset = pr; |
77 |
0 |
return; |
78 |
|
} |
79 |
0 |
List<ArgumentI> oldargs = new ArrayList<ArgumentI>(), |
80 |
|
newargs = new ArrayList<ArgumentI>(); |
81 |
0 |
oldargs.addAll(preset.getArguments()); |
82 |
|
|
83 |
0 |
for (ArgumentI newparg : pr.getArguments()) |
84 |
|
{ |
85 |
0 |
if (!oldargs.remove(newparg)) |
86 |
|
{ |
87 |
0 |
newargs.add(newparg); |
88 |
|
} |
89 |
|
} |
90 |
0 |
if (oldargs.size() == 0 && newargs.size() == 0) |
91 |
|
{ |
92 |
|
|
93 |
0 |
preset = pr; |
94 |
0 |
return; |
95 |
|
} |
96 |
|
|
97 |
0 |
throw new Error(MessageManager |
98 |
|
.getString("error.parameter_migration_not_implemented_yet")); |
99 |
|
} |
100 |
|
} |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
102 |
0 |
public List<Argument> getJobArgset()... |
103 |
|
{ |
104 |
0 |
return jobArgset == null ? null |
105 |
|
: JabaParamStore.getJabafromJwsArgs(jobArgset); |
106 |
|
} |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
108 |
0 |
public void setJobArgset(List<Argument> jobArgset)... |
109 |
|
{ |
110 |
|
|
111 |
0 |
this.jobArgset = jobArgset == null ? null |
112 |
|
: JabaParamStore.getJwsArgsfromJaba(jobArgset); |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 5 |
Complexity Density: 0.42 |
|
115 |
0 |
public String getWsParamFile()... |
116 |
|
{ |
117 |
0 |
List<Option> opts = null; |
118 |
0 |
if (jobArgset != null) |
119 |
|
{ |
120 |
0 |
opts = JabaParamStore.getJabafromJwsArgs(jobArgset); |
121 |
|
} |
122 |
|
else |
123 |
|
{ |
124 |
0 |
if (preset != null) |
125 |
|
{ |
126 |
0 |
opts = JabaParamStore.getJabafromJwsArgs(preset.getArguments()); |
127 |
|
} |
128 |
|
} |
129 |
0 |
if (opts == null || opts.size() == 0) |
130 |
|
{ |
131 |
0 |
return ""; |
132 |
|
} |
133 |
0 |
StringBuffer pset = new StringBuffer(); |
134 |
0 |
for (String ps : ParameterUtils.writeParameterSet(opts, " ")) |
135 |
|
{ |
136 |
0 |
pset.append(ps); |
137 |
0 |
pset.append("\n"); |
138 |
|
} |
139 |
0 |
return pset.toString(); |
140 |
|
} |
141 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
0 |
@Override... |
143 |
|
public String getServiceURI() |
144 |
|
{ |
145 |
0 |
return service.getServiceTypeURI(); |
146 |
|
} |
147 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0 |
@Override... |
149 |
|
public String[] getServiceURLs() |
150 |
|
{ |
151 |
0 |
return new String[] { service.getUri() }; |
152 |
|
} |
153 |
|
} |