diff options
| author | Jonathan Bauer | 2015-03-02 13:22:44 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2015-03-02 13:22:44 +0100 |
| commit | ea9f9848a6e7a68dc90decc2e38bd3e1081ebf8a (patch) | |
| tree | 1e252164aa23b6b74d30c6185fda06ceddcd6041 /dozentenmodul/src/main/java/thrift/MasterThriftConnection.java | |
| parent | pom.xml (diff) | |
| download | tutor-module-ea9f9848a6e7a68dc90decc2e38bd3e1081ebf8a.tar.gz tutor-module-ea9f9848a6e7a68dc90decc2e38bd3e1081ebf8a.tar.xz tutor-module-ea9f9848a6e7a68dc90decc2e38bd3e1081ebf8a.zip | |
ThriftManager class: use getSatClient() and getMasterClient() to get the singleton instances of the thrift clients to satellite and master servers
DO NOT CREATE NEW THRIFT OBJECTS!!!
Diffstat (limited to 'dozentenmodul/src/main/java/thrift/MasterThriftConnection.java')
| -rw-r--r-- | dozentenmodul/src/main/java/thrift/MasterThriftConnection.java | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java b/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java deleted file mode 100644 index 686d0944..00000000 --- a/dozentenmodul/src/main/java/thrift/MasterThriftConnection.java +++ /dev/null @@ -1,42 +0,0 @@ -package thrift; - -import org.apache.log4j.Logger; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; -import org.openslx.imagemaster.thrift.iface.ImageServer.Client; - -public class MasterThriftConnection { - - private final static Logger LOGGER = Logger.getLogger(MasterThriftConnection.class); - - public static final String MASTERSERVER_IP = "132.230.4.16"; - public static final int MASTERSERVER_PORT = 9090; - public static final int MASTERSERVER_TIMEOUT_MS = 30000; - - final TTransport transport = new TFramedTransport(new TSocket( - MASTERSERVER_IP, MASTERSERVER_PORT, MASTERSERVER_TIMEOUT_MS)); - - public Client getMasterThriftConnection() { - - try { - transport.open(); - } catch (TTransportException e) { - LOGGER.error("Keine Verbindung möglich!"); - return null; - } - - final TProtocol protocol = new TBinaryProtocol(transport); - final Client client = new Client(protocol); - LOGGER.info("Masterserver '" + MASTERSERVER_IP + "' erreichbar."); - - return client; - } - - public void closeMasterThriftConnection() { - transport.close(); - } -} |
