diff options
| author | Nino Breuer | 2014-11-20 14:57:00 +0100 |
|---|---|---|
| committer | Nino Breuer | 2014-11-20 14:57:00 +0100 |
| commit | 64ea92982ec1755fb6e9b8eaf50927f33a76d926 (patch) | |
| tree | ea096d392187b2521168a5c8b989e001fe4ad3b7 /dozentenmodulserver/src/main/java/sql/ThriftConnection.java | |
| parent | f (diff) | |
| download | tutor-module-64ea92982ec1755fb6e9b8eaf50927f33a76d926.tar.gz tutor-module-64ea92982ec1755fb6e9b8eaf50927f33a76d926.tar.xz tutor-module-64ea92982ec1755fb6e9b8eaf50927f33a76d926.zip | |
• new package for thrift classes
Diffstat (limited to 'dozentenmodulserver/src/main/java/sql/ThriftConnection.java')
| -rw-r--r-- | dozentenmodulserver/src/main/java/sql/ThriftConnection.java | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/dozentenmodulserver/src/main/java/sql/ThriftConnection.java b/dozentenmodulserver/src/main/java/sql/ThriftConnection.java deleted file mode 100644 index 32092c2f..00000000 --- a/dozentenmodulserver/src/main/java/sql/ThriftConnection.java +++ /dev/null @@ -1,56 +0,0 @@ -package sql; - -import javax.swing.JOptionPane; - -//import models.SessionData; - -import org.apache.log4j.Logger; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; - -import server.generated.Server; -import server.generated.Server.Client; - -public class ThriftConnection { - - private final static Logger LOGGER = Logger.getLogger(ThriftConnection.class); - - private String satAddress = ""+SessionData.session.getServerAdress(); - final TTransport transport = new TSocket(satAddress, 9090); - - public ThriftConnection() { - // TODO Auto-generated constructor stub - } - - public Client getThriftConnection() - { - - try { - transport.open(); - } catch (TTransportException e) { - LOGGER.error("Keine Verbindung möglich! Satellit: " + satAddress); - e.printStackTrace(); - JOptionPane.showMessageDialog(null, - "Konnte keine Verbindung zum Satellit '" + satAddress + "' aufbauen!", - "Debug-Message", JOptionPane.ERROR_MESSAGE); - return null; - } - - final TProtocol protocol = new TBinaryProtocol(transport); - - final Server.Client client = new Server.Client(protocol); - LOGGER.info("Verbindung zu "+satAddress+" wurde aufgebaut."); - - return client; - } - - public void closeThriftConnection() - { - LOGGER.info("Verbindung wird geplant getrennt."); - transport.close(); - } -} -
\ No newline at end of file |
