diff options
author | Michael Petretti | 2014-06-19 15:11:07 +0200 |
---|---|---|
committer | Michael Petretti | 2014-06-19 15:11:07 +0200 |
commit | 5a017c3b1ce7c65728ac354ebc138838e9db3320 (patch) | |
tree | 3ee98690b3e029cc8e76a335b5c30e0d96c533ae /src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java | |
parent | small changes (diff) | |
download | satellite-daemon-5a017c3b1ce7c65728ac354ebc138838e9db3320.tar.gz satellite-daemon-5a017c3b1ce7c65728ac354ebc138838e9db3320.tar.xz satellite-daemon-5a017c3b1ce7c65728ac354ebc138838e9db3320.zip |
Finished Debug for Uploads.
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java')
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java index 0b22389..a2c990f 100644 --- a/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java +++ b/src/main/java/org/openslx/satellitedaemon/ftp/ThriftConnection.java @@ -18,6 +18,7 @@ import org.apache.thrift.transport.TSocket; import org.apache.thrift.transport.TTransport; import org.openslx.imagemaster.thrift.iface.FtpCredentials; import org.openslx.imagemaster.thrift.iface.ImageData; +import org.openslx.imagemaster.thrift.iface.ImageDataException; import org.openslx.imagemaster.thrift.iface.ImageServer; import org.openslx.imagemaster.thrift.iface.ServerAuthenticationException; import org.openslx.imagemaster.thrift.iface.ServerSessionData; @@ -138,7 +139,7 @@ public class ThriftConnection e.printStackTrace(); return null; } catch ( TException e ) { - log.error( "ThriftConnection: TExeption: Server Authetication was not sucessful." ); + log.error( "ThriftConnection: TException: Server Authetication was not sucessful." ); e.printStackTrace(); return null; } @@ -154,7 +155,7 @@ public class ThriftConnection ImageServer.Client newClient = null; try { TTransport transport; // Is it really always the same IP:Port as from FTPServer? - transport = new TSocket( Globals.getPropertyString( PropString.FTPSERVERIP ), Globals.getPropertyInt( PropInt.FTPPORT ) ); + transport = new TSocket( Globals.getPropertyString( PropString.FTPSERVERIP ), Globals.getPropertyInt( PropInt.THRIFTPORT ) ); transport.open(); TProtocol protocol = new TBinaryProtocol( transport ); newClient = new ImageServer.Client( protocol ); @@ -166,5 +167,17 @@ public class ThriftConnection } return newClient; } + + public static void finishedUpload(String ftpUser, ImageData imageDescription) { + try { + client.finshedUpload( ftpUser, imageDescription ); + } catch ( ImageDataException e ) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch ( TException e ) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } |