summaryrefslogblamecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/App.java
blob: 30382dbe243b4b98c43e6fc4ff7a69865fcb4e90 (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.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
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
{
	private static Logger log = Logger.getLogger( App.class );
	
	public static void main( String[] args )
			throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException, ServerAuthenticationException, UnrecoverableKeyException,
			InvalidKeyException, SignatureException
	{
		BasicConfigurator.configure();
		try {
			Globals.loadProperties();
			if ( !Globals.propertiesValid() ) {
				log.error( "Config file contains errors." );
				System.exit( 1 );
			}
		} catch ( IOException e ) {
			log.error( "Could not load config file. Quitting." );
			System.exit( 1 );
		}
		Thread uploadWorker = new Thread( new FtpUploadWorker() );
		uploadWorker.start();
	}
}