summaryrefslogblamecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/App.java
blob: 7faf3656cfa0f0b5b844f4f8e3e757941c808920 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                     
                                         

                                              

                                               
                                               
 
                                                                          
                                                       

   
                                                                              

   

                
                                                                                                                                                                                                                                                                
         
 











                                                                                                                      

         
package org.openslx.satellitedaemon;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;

import org.openslx.imagemaster.thrift.iface.ServerAuthenticationException;
import org.openslx.satellitedaemon.ftp.FtpUploadWorker;

/**
 * Main class for uploading images from the HS-Server to the Satellite Server.
 * 
 */
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();
		Thread uploadWorker = new Thread(new FtpUploadWorker());
		uploadWorker.start();
	}
}