diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-06-05 14:13:37 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-06-05 14:13:37 +0200 |
| commit | cedb32b6b7a799ef4142b418e64d3538cf604af1 (patch) | |
| tree | 20b6975f944132485beff9304869df0ac589da36 /src/main/java/com/c2kernel/process/Bootstrap.java | |
| parent | 28f6763508612fadcc34d87cff383e6a5aef2ad6 (diff) | |
Recreate old Authenticator interface as 'ProxyLogin'
Server boots with new lookup interface.
Diffstat (limited to 'src/main/java/com/c2kernel/process/Bootstrap.java')
| -rw-r--r-- | src/main/java/com/c2kernel/process/Bootstrap.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/c2kernel/process/Bootstrap.java b/src/main/java/com/c2kernel/process/Bootstrap.java index 25ea512..bcc5e68 100644 --- a/src/main/java/com/c2kernel/process/Bootstrap.java +++ b/src/main/java/com/c2kernel/process/Bootstrap.java @@ -10,6 +10,7 @@ import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLUnit;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.entity.proxy.AgentProxy;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.events.Event;
import com.c2kernel.events.History;
@@ -47,6 +48,7 @@ public class Bootstrap {
static DomainPath thisServerPath;
static HashMap<String, ResourceImportHandler> resHandlerCache = new HashMap<String, ResourceImportHandler>();
+ static HashMap<String, AgentProxy> systemAgents = new HashMap<String, AgentProxy>();
/**
* Run everything without timing-out the service wrapper
@@ -71,7 +73,7 @@ public class Bootstrap Logger.msg("Bootstrap.run() - Initialising Server Item Workflow");
initServerItemWf();
- // register modules
+ Gateway.getModuleManager().setUser(systemAgents.get("system"));
Gateway.getModuleManager().registerModules();
Logger.msg("Bootstrap.run() - Bootstrapping complete");
@@ -279,7 +281,7 @@ public class Bootstrap Logger.msg(1, "Bootstrap.checkAgent() - Checking for existence of '"+name+"' user.");
Lookup lookup = Gateway.getLookup();
try {
- lookup.getAgentPath(name);
+ systemAgents.put(name, Gateway.getProxyManager().getAgentProxy(lookup.getAgentPath(name)));
Logger.msg(3, "Bootstrap.checkAgent() - User '"+name+"' found.");
return;
} catch (ObjectNotFoundException ex) { }
@@ -304,6 +306,7 @@ public class Bootstrap rolePath.addAgent(agentPath);
Gateway.getStorage().put(agentPath.getSysKey(), new Property("Name", name, true), null);
Gateway.getStorage().put(agentPath.getSysKey(), new Property("Type", "Agent", false), null);
+ systemAgents.put(name, Gateway.getProxyManager().getAgentProxy(agentPath));
Logger.msg("Bootstrap.checkAgent() - Done");
} catch (Exception ex) {
Logger.error("Unable to create "+name+" user.");
@@ -359,7 +362,7 @@ public class Bootstrap PredefinedStepContainer predef = (PredefinedStepContainer)wf.search("workflow/predefined");
wf.getChildGraphModel().removeVertex(predef);
wf.addChild(new ServerPredefinedStepContainer(), predef.getCentrePoint());
- wf.initialise(thisServerPath.getSysKey(), Gateway.getLookup().getAgentPath("system"));
+ wf.initialise(thisServerPath.getSysKey(), systemAgents.get("system").getPath());
Gateway.getStorage().put(thisServerPath.getSysKey(), wf, null);
}
}
|
