summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/App.java
blob: 1805d5a65e8fc04adfeeaf1d862037fb57db07f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.openslx.satellitedaemon;

import java.io.IOException;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.openslx.satellitedaemon.filetransfer.FileDownloadWorker;
import org.openslx.satellitedaemon.filetransfer.FileUploadWorker;

/***********************************************************************************************/
/**
 * 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 )
	{
		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 );
		}
		if (!Globals.masterServerSslContextInit()){
			log.error( "Problem with initializing the SSLContext" );
			System.exit( 1 );
		}
		Thread uploadWorker = new Thread( new FileUploadWorker() );
		uploadWorker.start();
		Thread downloadWorker = new Thread( new FileDownloadWorker() );
		downloadWorker.start();
	}
}