summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java')
-rw-r--r--src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java b/src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java
index 2504a3d..6b2769b 100644
--- a/src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java
+++ b/src/main/java/org/openslx/imagemaster/localrpc/JsonUser.java
@@ -1,5 +1,6 @@
package org.openslx.imagemaster.localrpc;
+import org.apache.log4j.Logger;
import org.openslx.bwlp.thrift.iface.Role;
import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.imagemaster.util.Util;
@@ -7,6 +8,8 @@ import org.openslx.imagemaster.util.Util;
public class JsonUser
{
+ private static final Logger LOGGER = Logger.getLogger( JsonUser.class );
+
private String userId = null;
private String organizationId = null;
private String firstName = null;
@@ -20,9 +23,11 @@ public class JsonUser
try {
role = Role.valueOf( this.role );
} catch ( Exception e ) {
+ LOGGER.warn( "Invalid role: " + this.role );
return null;
}
- if ( Util.isEmpty( userId ) || Util.isEmpty( organizationId ) || Util.isEmpty( lastName ) || Util.isEmpty( mail ) )
+ if ( Util.isEmpty( userId, "userId", LOGGER ) || Util.isEmpty( organizationId, "orgId", LOGGER )
+ || Util.isEmpty( lastName, "lastName", LOGGER ) || Util.isEmpty( mail, "mail", LOGGER ) )
return null;
UserInfo ui = new UserInfo( userId, firstName, lastName, mail, organizationId );
ui.role = role;