public Object call() throws Exception { sessionManager.close(uuid); return null; } });
/** Doesn't take current into account */ public EventContext getEventContext() { return sessionManager.getEventContext(this.principal); }
@RolesAllowed( { "user", "guest" }) public Set<String> getOutputKeys(String session) { return mgr.outputEnvironment(session).keySet(); }
protected final void sessionInit() { if (sessionPrincipal != null) { try { this.manager.getEventContext(sessionPrincipal); } catch (SessionException e) { sessionPrincipal = null; } } if (sessionPrincipal == null) { session = this.manager.createWithAgent(principal, "ExecutionThread", null); sessionPrincipal = new Principal(session.getUuid(), principal .getGroup(), principal.getEventType()); } }
private Session newSession(Current __current) { EventContext ec = getEventContext(__current); Session newSession = mgr.createWithAgent( new Principal(ec.getCurrentUserName(), ec.getCurrentGroupName(), "Processing"), "OMERO.scripts", null); newSession.setTimeToIdle(0L); newSession.setTimeToLive(timeout); newSession = mgr.update(newSession, true); started = System.currentTimeMillis(); return newSession; }
Object o = sessionManager.find(userId); local = (o != null); log.info("Found session locally: " + userId); final ome.model.meta.Session s = sessionManager.createWithAgent(p, agent, ip); Principal sp = new Principal(s.getUuid(), group, event);
session = manager.find(password); } catch (SessionException e) { session = manager.find(userId); // ticket:3652 } catch (SessionException e) { if (manager.executePasswordCheck(userId, password)) { return true; } else {
public Session call() throws Exception { final CreationRequest req = new CreationRequest(); req.principal = principal; req.agent = "createSession"; if (currentSession != null) { final Experimenter sudoer = currentSession.getSudoer(); if (sudoer != null) { req.sudoer = sudoer.getId(); } } final Session session = mgr.createFromRequest(req); session.setTimeToIdle(timeToIdleMs); session.setTimeToLive(timeToLiveMs); return mgr.update(session, false); }}); return ex.get(future);
public EventContext getEventContext(boolean refresh) { EventContext ec = cd.getCurrentEventContext(); if (refresh) { String uuid = ec.getCurrentSessionUuid(); ec = sessionManager.reload(uuid); } return ec; }
@RolesAllowed( { "user", "guest" }) public void setInput(String session, String key, Object object) { mgr.setInput(session, key, object); }
public Session call() throws Exception { return mgr.update(session); }}); return ex.get(future);
@RolesAllowed( { "user", "guest" }) public Session getSession(@NotNull String sessionUuid) { return mgr.find(sessionUuid); }
@RolesAllowed( { "user", "guest" }) public Session createSession(@NotNull Principal principal, @Hidden String credentials) { Session session = null; try { session = mgr.createWithAgent(principal, credentials, "createSession", null); } catch (Exception e) { throw creationExceptionHandler(e); } return session; }
public Share call() throws Exception { return sessionManager.createShare(new Principal(omename), enabled, time, "SHARE", description, group); } });
public Session call() throws Exception { SessionManager.CreationRequest req = new SessionManager.CreationRequest(); req.principal = principal; req.agent = "OMERO.sudo"; req.groupsLed = groupsLed; req.timeToIdle = timeToIdleMilliseconds; req.timeToLive = timeToLiveMilliseconds; req.sudoer = context.getCurrentUserId(); if (currentSession != null) { final Experimenter sudoer = currentSession.getSudoer(); if (sudoer != null) { req.sudoer = sudoer.getId(); } } return mgr.createFromRequest(req); }}); return ex.get(future);
public void buildResponse(int step, Object object) { helper.assertResponse(step); if (helper.isLast(step)) { manager.reload(session); helper.setResponseIfNull(new OK()); } }
for (String key : inputs.getValue().keySet()) { Object v = mapper.fromRType(inputs.get(key)); mgr.setInput(session.getUuid(), key, v);
private long defaultId() { String session = this.factory.sessionId().name; return sm.getEventContext(new Principal(session)).getCurrentUserId(); }
public Integer call() throws Exception { return mgr.close(session.getUuid()); }}); return ex.get(future);