diff options
author | Björn Hagemeister | 2014-10-08 18:02:30 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-10-08 18:02:30 +0200 |
commit | 6c4e2fa4523d4a4858d819064f0ed7c42fa8d89c (patch) | |
tree | 866c32b8dc72319941e0146d09a708c39bcebd5a /src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java | |
parent | Configuration splitup (WIP) (diff) | |
download | satellite-daemon-6c4e2fa4523d4a4858d819064f0ed7c42fa8d89c.tar.gz satellite-daemon-6c4e2fa4523d4a4858d819064f0ed7c42fa8d89c.tar.xz satellite-daemon-6c4e2fa4523d4a4858d819064f0ed7c42fa8d89c.zip |
Splitted Globals.java into two classes and splitted config file global.properties into global.properties and identity.properties.
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java')
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java | 12 |
1 files changed, 7 insertions, 5 deletions
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 ) { |