summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/Globals.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/Globals.java')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/Globals.java43
1 files changed, 10 insertions, 33 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java
index 8b0d182..a14f825 100644
--- a/src/main/java/org/openslx/satellitedaemon/Globals.java
+++ b/src/main/java/org/openslx/satellitedaemon/Globals.java
@@ -19,6 +19,7 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import org.apache.log4j.Logger;
+import org.openslx.satellitedaemon.util.Util;
public class Globals
{
@@ -34,8 +35,7 @@ public class Globals
*/
// * Properties *//
-
- // Strings //
+
public static String getMasterserverHost()
{
return properties.getProperty( "MASTERSERVER_HOST" );
@@ -46,16 +46,13 @@ public class Globals
return properties.getProperty( "FILETRANSFER_KEYSTORE_PATH" );
}
- public static String getOrganizationName()
- {
- return properties.getProperty( "ORGANIZATION_NAME" );
- }
-
public static String getImageFolder()
{
return properties.getProperty( "IMAGE_FOLDER" );
}
+
+
// Integers //
public static int getThriftPort()
@@ -78,9 +75,9 @@ public class Globals
System.exit( 2 );
}
- notNullOrEmptyFatal( getMasterserverHost(), "Masterserver Host must not be empty!" );
- notNullOrEmptyFatal( getOrganizationName(), "Organiziation Name must not be empty!" );
- notNullOrEmptyFatal( getImageFolder(), "Image Folder must not be empty!" );
+ Util.notNullOrEmptyFatal( getMasterserverHost(), "Masterserver Host must not be empty!" );
+ Util.notNullOrEmptyFatal( getTruststorePath(), "Truststore Path must not be empty!" );
+ Util.notNullOrEmptyFatal( getImageFolder(), "Image Folder must not be empty!" );
}
/***********************************************************************************************/
@@ -101,7 +98,8 @@ public class Globals
TrustManager[] trustManagers = tmf.getTrustManagers();
context.init( null, trustManagers, null );
} catch ( FileNotFoundException e ) {
- log.error( "Could not find the keystore for the filetransfer. Path was '" + getTruststorePath() + "'" );
+ log.error( "Could not find the keystore for the filetransfer. Path was '" +
+ getTruststorePath() + "'" );
return false;
} catch ( Exception e ) {
log.error( "Could not initialize SSL context.", e );
@@ -130,25 +128,4 @@ public class Globals
return 0;
}
}
-
- public static void notNullOrEmptyFatal( String something, String message )
- {
- if ( something == null || something.isEmpty() ) {
- if ( message != null )
- log.fatal( "[NOTNULL] " + message );
- log.warn( Thread.currentThread().getStackTrace().toString() );
- System.exit( 2 );
- }
- }
-
- /**
- * Get private key for this server. If none exists yet, create a new one.
- *
- * @return
- */
- public static PrivateKey getPrivateKey()
- {
- return AsymKeyHolder.getPrivateKey();
- }
-
-}
+} \ No newline at end of file