From ad491bc2d5e0110cbee16045def9e2b3fc4342a5 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 14 Feb 2013 22:51:41 +0100 Subject: Add mCurrentUser property for logged in client processes. --- src/main/java/com/c2kernel/process/Gateway.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java index 70bfb14..2bbe638 100644 --- a/src/main/java/com/c2kernel/process/Gateway.java +++ b/src/main/java/com/c2kernel/process/Gateway.java @@ -57,6 +57,7 @@ public class Gateway static private EntityProxyManager mProxyManager; static private CorbaServer mCorbaServer; static private CastorXMLUtility mMarshaller; + static private AgentProxy mCurrentUser = null; //static private SimpleTCPIPServer mHTTPServer; @@ -206,8 +207,8 @@ public class Gateway } else { - Logger.error("LDAP not configured properly."); - throw new InvalidDataException("Cannot authenticate. Name and/or password invalid.", ""); + Logger.error("LDAP properties not set for server login."); + throw new InvalidDataException("Cannot authenticate with LDAP.", ""); } setup(); @@ -278,7 +279,8 @@ public class Gateway if (agentPath!=null) { setup(); - return (AgentProxy) mProxyManager.getProxy(agentPath); + mCurrentUser = (AgentProxy) mProxyManager.getProxy(agentPath); + return mCurrentUser; } else { @@ -301,6 +303,13 @@ public class Gateway } /** + * @return the mCurrentUser + */ + public static AgentProxy getCurrentUser() { + return mCurrentUser; + } + + /** * Initializes the storage and proxy manager, called during connect. * * @throws InvalidDataException -- cgit v1.2.3