@RolesAllowed("user" /* group owner */) public Session createSessionWithTimeout(@NotNull final Principal principal, final long milliseconds) { return createSessionWithTimeouts(principal, milliseconds, 0L); }
String defaultGroup) { final String user = currentContext().getCurrentUserName(); if (user == null) { throw new SecurityViolation("No current user"); final EventContext context = currentContext(); final Session currentSession; if (context instanceof SessionContext) { final Principal principal = principal(defaultGroup, user); Future<Session> future = ex.submit(new Callable<Session>(){ public Session call() throws Exception { return ex.get(future); } catch (Exception e) { throw creationExceptionHandler(e);
final long timeToLiveMilliseconds, final long timeToIdleMilliseconds) { final EventContext context = currentContext(); final Session currentSession; if (context instanceof SessionContext) { return ex.get(future); } catch (Exception e) { throw creationExceptionHandler(e);
@RolesAllowed("user") public java.util.List<Session> getMyOpenAgentSessions(final String agent) { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid, agent); }}); return ex.get(future); }
@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; }
@RolesAllowed("user") public java.util.List<Session> getMyOpenClientSessions() { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid, "OMERO.insight", "OMERO.web", "OMERO.importer"); }}); return ex.get(future); }
@RolesAllowed("user") public java.util.List<Session> getMyOpenSessions() { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid); }}); return ex.get(future); }