summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/App.java
diff options
context:
space:
mode:
authorMichael Petretti2014-05-20 14:22:43 +0200
committerMichael Petretti2014-05-20 14:22:43 +0200
commitf918a80aa668899912ca37cf82d3794728b05c14 (patch)
treede549d721fe51d34a7b05d36dfbf9af978197b16 /src/main/java/org/openslx/satellitedaemon/App.java
parentAdded the new FtpUploadWorker-Class (diff)
downloadsatellite-daemon-f918a80aa668899912ca37cf82d3794728b05c14.tar.gz
satellite-daemon-f918a80aa668899912ca37cf82d3794728b05c14.tar.xz
satellite-daemon-f918a80aa668899912ca37cf82d3794728b05c14.zip
Finished UploadWorker and added some comments.
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/App.java')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/App.java30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/App.java b/src/main/java/org/openslx/satellitedaemon/App.java
index a0de29a..7faf365 100644
--- a/src/main/java/org/openslx/satellitedaemon/App.java
+++ b/src/main/java/org/openslx/satellitedaemon/App.java
@@ -8,14 +8,9 @@ import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
-import java.util.UUID;
-import org.openslx.imagemaster.thrift.iface.FtpCredentials;
-import org.openslx.imagemaster.thrift.iface.ImageData;
import org.openslx.imagemaster.thrift.iface.ServerAuthenticationException;
-import org.openslx.satellitedaemon.ftp.FtpImageUploader;
-import org.openslx.satellitedaemon.ftp.ThriftConnection;
-import org.openslx.satellitedaemon.util.Util;
+import org.openslx.satellitedaemon.ftp.FtpUploadWorker;
/**
* Main class for uploading images from the HS-Server to the Satellite Server.
@@ -26,16 +21,17 @@ public class App
public static void main( String[] args ) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException, ServerAuthenticationException, UnrecoverableKeyException, InvalidKeyException, SignatureException
{
- // TODO: A Thread that starts the call for new credentials and the upload
- // whenever a new image was sceduled in the db.
- ImageData imDat = new ImageData( UUID.randomUUID().toString(), 113,
- "TestImage", System.currentTimeMillis(), System.currentTimeMillis(), "me", "anyThing",
- true, false, "best", "theVeryBest", 1024 );
- FtpCredentials ftpc = ThriftConnection.getFtpCredentials(imDat);
- Util.notNullFatal( ftpc, "ftpc was null" );
- FtpImageUploader ftpIU = new FtpImageUploader( ftpc );
- Util.notNullFatal( ftpIU, "ftpIU was null" );
- ftpIU.connectTest();
-
+// // TODO: A Thread that starts the call for new credentials and the upload
+// // whenever a new image was sceduled in the db.
+// ImageData imDat = new ImageData( UUID.randomUUID().toString(), 113,
+// "TestImage", System.currentTimeMillis(), System.currentTimeMillis(), "me", "anyThing",
+// true, false, "best", "theVeryBest", 1024 );
+// FtpCredentials ftpc = ThriftConnection.getFtpCredentials(imDat);
+// Util.notNullFatal( ftpc, "ftpc was null" );
+// FtpImageUploader ftpIU = new FtpImageUploader( ftpc );
+// Util.notNullFatal( ftpIU, "ftpIU was null" );
+// ftpIU.connectTest();
+ Thread uploadWorker = new Thread(new FtpUploadWorker());
+ uploadWorker.start();
}
}