From 6c4e2fa4523d4a4858d819064f0ed7c42fa8d89c Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 8 Oct 2014 18:02:30 +0200 Subject: Splitted Globals.java into two classes and splitted config file global.properties into global.properties and identity.properties. --- .../satellitedaemon/filetransfer/ThriftConnection.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java') diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java index 5cae49b..f716077 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java @@ -29,6 +29,7 @@ import org.openslx.imagemaster.thrift.iface.UploadError; import org.openslx.imagemaster.thrift.iface.UploadException; import org.openslx.imagemaster.thrift.iface.UserInfo; import org.openslx.satellitedaemon.Globals; +import org.openslx.satellitedaemon.Identity; import org.openslx.satellitedaemon.db.DbImage; import org.openslx.satellitedaemon.db.DbImage.Status; @@ -206,16 +207,16 @@ public class ThriftConnection if ( !isAuthenticated ) { try { ByteBuffer tmpBuffer = theClient - .startServerAuthentication( Globals + .startServerAuthentication( Identity .getOrganizationName() ); byte[] toEncrypt = new byte[ tmpBuffer.remaining() ]; tmpBuffer.get( toEncrypt ); AsymEncryptionHandler aeh = new AsymEncryptionHandler( - Globals.getPrivateKey() ); + Identity.getPrivateKey() ); byte[] byteArray = aeh.encryptMessage( toEncrypt ); sSD = theClient.serverAuthenticate( - Globals.getOrganizationName(), + Identity.getOrganizationName(), ByteBuffer.wrap( byteArray ) ); } catch ( AuthenticationException e ) { log.error( "ThriftConnection: AuthenticationException: Server Authetication was not sucessful.", e ); @@ -253,8 +254,9 @@ public class ThriftConnection client.set( newClient ); return newClient; } - - public static boolean publishUser(UserInfo userInfo) { + + public static boolean publishUser( UserInfo userInfo ) + { ImageServer.Client theClient = null; theClient = getConnection(); if ( theClient == null ) { -- cgit v1.2.3-55-g7522