1 package fr.in2p3.jsaga.adaptor.data.impl;
2
3 import fr.in2p3.jsaga.adaptor.schema.data.emulator.Server;
4 import fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType;
5 import org.ogf.saga.error.NoSuccessException;
6 import org.ogf.saga.error.TimeoutException;
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public class DataEmulatorConnection extends DataEmulatorConnectionAbstract {
21 private Server m_serverRoot;
22
23 public DataEmulatorConnection(String protocol, String host, int port) throws TimeoutException, NoSuccessException {
24 super();
25 m_serverRoot = m_grid.connect(protocol, host, port);
26 if (m_serverRoot == null) {
27 throw new TimeoutException("Failed to connect to host: "+host);
28 }
29 }
30
31 public void destroy() {
32 m_grid.disconnect(m_serverRoot);
33 }
34
35 protected ServerType getServerRoot() {
36 return m_serverRoot;
37 }
38 }