From 9464f7fc790cf54760b247681c4cd6417ff8a995 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2014 11:53:38 +0100 Subject: Authentifizierung über Masterserver funktioniert nun --- .../src/thrift/MasterThriftConnection.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Dozentenmodul/src/thrift/MasterThriftConnection.java (limited to 'Dozentenmodul/src/thrift/MasterThriftConnection.java') diff --git a/Dozentenmodul/src/thrift/MasterThriftConnection.java b/Dozentenmodul/src/thrift/MasterThriftConnection.java new file mode 100644 index 00000000..ecbc689c --- /dev/null +++ b/Dozentenmodul/src/thrift/MasterThriftConnection.java @@ -0,0 +1,38 @@ +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 thrift.ImageServer.Client; + + + +public class MasterThriftConnection { + final TTransport transport = new TSocket("132.230.4.16", 9090); + public Client getMasterThriftConnection() + { + + try { + transport.open(); + } catch (TTransportException e) { + System.out.println("Keine Verbindung möglich!"); + return null; + } + + final TProtocol protocol = new TBinaryProtocol(transport); + final Client client = new Client(protocol); + + + System.out.println("Der Server läuft!"); + + return client; + } + + public void closeMasterThriftConnection() + { + transport.close(); + } +} -- cgit v1.2.3-55-g7522