summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-02-14 22:51:41 +0100
committerAndrew Branson <andrew.branson@cern.ch>2013-02-14 22:51:41 +0100
commitad491bc2d5e0110cbee16045def9e2b3fc4342a5 (patch)
tree81460beee55af1527222fd63fe69cad731a0aa6d
parent62901dad397210f1a03a500d71363e9a440f4197 (diff)
Add mCurrentUser property for logged in client processes.
-rw-r--r--src/main/java/com/c2kernel/process/Gateway.java15
1 files changed, 12 insertions, 3 deletions
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