|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| package org.proteomecommons.tranche.server; |
|
18 |
| |
|
19 |
| import java.io.ByteArrayOutputStream; |
|
20 |
| import org.proteomecommons.tranche.Signature; |
|
21 |
| import org.proteomecommons.tranche.remote.RemoteUtil; |
|
22 |
| import org.proteomecommons.tranche.remote.Token; |
|
23 |
| import org.proteomecommons.tranche.util.Configuration; |
|
24 |
| import org.proteomecommons.tranche.util.ConfigurationUtil; |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| public class GetConfigurationItem extends ServerItem { |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
380
| public GetConfigurationItem(Server server) {
|
|
39 |
380
| super(Token.GET_CONFIGURATION_STRING, server);
|
|
40 |
| } |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| |
|
47 |
| |
|
48 |
224
| public void doAction(java.io.InputStream in, java.io.OutputStream out) throws Exception {
|
|
49 |
| |
|
50 |
224
| byte[] bytes = RemoteUtil.getBytes(in);
|
|
51 |
| |
|
52 |
224
| Signature sig = RemoteUtil.readSignature(in);
|
|
53 |
| |
|
54 |
| |
|
55 |
224
| Configuration config = server.dfs.getConfiguration(sig, bytes);
|
|
56 |
| |
|
57 |
| |
|
58 |
224
| config.setValue("currentlyConnectedUsers", Integer.toString(server.currentlyConnectedUsers));
|
|
59 |
| |
|
60 |
| |
|
61 |
224
| server.submitter.logGetConfiguration(this.clientIP);
|
|
62 |
| |
|
63 |
| |
|
64 |
224
| ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
65 |
224
| ConfigurationUtil.write(config, baos);
|
|
66 |
| |
|
67 |
224
| RemoteUtil.writeData(baos.toByteArray(), out);
|
|
68 |
| } |
|
69 |
| } |