summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/thrift/ThriftConnection.java
diff options
context:
space:
mode:
authorunknown2014-02-25 11:04:51 +0100
committerunknown2014-02-25 11:04:51 +0100
commit2a3ec0fbda66ed07adcdc968a9365096ecd54f40 (patch)
tree187af202e5a404a15c31f0915e73cb23bf5b7900 /Dozentenmodul/src/thrift/ThriftConnection.java
parentProblem der herumspringenden Fenster entfernt (diff)
downloadtutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.gz
tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.xz
tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.zip
Kommunikation von BwLehrpool Suite zu BwLehrpool Suite Server läuft nun über Thrift
Diffstat (limited to 'Dozentenmodul/src/thrift/ThriftConnection.java')
-rw-r--r--Dozentenmodul/src/thrift/ThriftConnection.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/Dozentenmodul/src/thrift/ThriftConnection.java b/Dozentenmodul/src/thrift/ThriftConnection.java
new file mode 100644
index 00000000..6a65c948
--- /dev/null
+++ b/Dozentenmodul/src/thrift/ThriftConnection.java
@@ -0,0 +1,32 @@
+package thrift;
+
+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.Server;
+import server.Server.Client;
+
+public class ThriftConnection {
+
+ public Client getThriftConnection()
+ {
+ final TTransport transport = new TSocket("141.79.128.121", 9090);
+ try {
+ transport.open();
+ } catch (TTransportException e) {
+ System.out.println("Keine Verbindung zum Master möglich!");
+ return null;
+ }
+
+ final TProtocol protocol = new TBinaryProtocol(transport);
+ final Server.Client client = new Server.Client(protocol);
+
+
+ System.out.println("Der Zentralserver läuft!");
+ return client;
+ }
+
+}