From 0bd4f9b56d399349b909060a7af4121559b99ccb Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 1 Oct 2014 15:43:49 +0200 Subject: Completed exception handling (ThriftConnection) plus completed properties checks (Globals). --- src/main/java/org/openslx/satellitedaemon/Globals.java | 9 ++++++++- .../openslx/satellitedaemon/filetransfer/ThriftConnection.java | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java index 2bb9f68..9ff6911 100644 --- a/src/main/java/org/openslx/satellitedaemon/Globals.java +++ b/src/main/java/org/openslx/satellitedaemon/Globals.java @@ -111,7 +111,14 @@ public class Globals { keyFact = kf; notNullOrEmptyFatal(getMasterserverHost(), "Masterserver Host must not be empty!"); - // TODO: check properties + notNullOrEmptyFatal(getKeystoreType(), "Keystore Type must not be empty"); + notNullOrEmptyFatal(getFiletransferKeystorePassword(), "File transfer Keystore Password must not be empty!"); + notNullOrEmptyFatal(getFiletransferKeystorePath(), "File transfer Keystore Path must not be empty!"); + notNullOrEmptyFatal(getOrganizationName(), "Organiziation Name must not be empty!"); + notNullOrEmptyFatal(getThriftKeystoreAlias(), "Thrift Keystore Alias must not be empty!"); + notNullOrEmptyFatal(getThriftKeystorePassword(), "Thrift Keystore Password must not be empty!"); + notNullOrEmptyFatal(getThriftKeystorePath(), "Thrift Keystore Path must not be empty!"); + notNullOrEmptyFatal(getImageFolder(), "Image Folder must not be empty!"); } /***********************************************************************************************/ diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java index cd1054a..37c4ebd 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java @@ -95,8 +95,8 @@ public class ThriftConnection // SessionID is not valid // TODO: Code for new SSID } else if ( e.getNumber().equals( AuthorizationError.NO_PERMISSION ) ) { - // not yet implemented. - + log.error( "No permission for uploading.", e ); + // TODO: add error message into database. } else { e.printStackTrace(); } @@ -181,6 +181,7 @@ public class ThriftConnection // TODO: Code for new SSID } else if ( e.getNumber().equals( AuthorizationError.NO_PERMISSION ) ) { log.error( "No permission error.", e ); + // TODO: add e.message into database. } else { e.printStackTrace(); } -- cgit v1.2.3-55-g7522