public ome.model.meta.Session newInstance() { return new ome.model.meta.Session(); }
public ome.model.meta.Session proxy() { return new ome.model.meta.Session(this.id, false); }
/** * Initialization method called by the Spring run-time to acquire an initial * {@link Session}. */ public void init() { try { asroot = new Principal(internal_uuid, "system", "Sessions"); // Create a basic session Session session = new Session(); define(session, internal_uuid, "Session Manager internal", System.currentTimeMillis(), Long.MAX_VALUE, 0L, "Sessions", "Internal", null); session = sessionProvider.executeInternalSession(internal_uuid, session); internalSession = new InternalSessionContext(session, LightAdminPrivileges.getAllPrivileges(), roles); cache.putSession(internal_uuid, internalSession); } catch (UncategorizedSQLException uncat) { log.warn("Assuming that this is read-only"); } catch (DataAccessException dataAccess) { throw new RuntimeException( " " + "=====================================================\n" + "Data access exception: Did you create your database? \n" + "=====================================================\n", dataAccess); } }
public Session createFromRequest(CreationRequest request) { // If credentials exist as session, then return that if (request.credentials != null) { try { SessionContext context = cache .getSessionContext(request.credentials); if (context != null) { context.count().increment(); return context.getSession(); // EARLY EXIT! } } catch (SessionException se) { // oh well. } // Though trusted values, if we receive a null principal, not ok; boolean ok = request.principal == null ? false : executeCheckPassword( request.principal, request.credentials); if (!ok) { log.warn("Failed to authenticate: " + request.principal); throw new AuthenticationException("Authentication exception."); } } // authentication checked. Now delegating to the admin method (no pass) Session session = new Session(); define(session, UUID.randomUUID().toString(), "Initial message.", System.currentTimeMillis(), request); return createSession(request, session); }
@Transactional(readOnly = false) public Object doWork(Session session, ServiceFactory sf) { log.info("Creating PIXELDATA event for pixels id:" + mpm.pixelsID); // Load objects final EventType type = sf.getTypesService().getEnumeration( EventType.class, ec.getCurrentEventType()); final EventLog el = new EventLog(); final Event e = new Event(); e.setExperimenter( new Experimenter(ec.getCurrentUserId(), false)); e.setExperimenterGroup(new ExperimenterGroup(groupID, false)); e.setSession(new ome.model.meta.Session( ec.getCurrentSessionId(), false)); e.setTime(new Timestamp(new Date().getTime())); e.setType(type); el.setAction("PIXELDATA"); el.setEntityId(mpm.pixelsID); el.setEntityType(Pixels.class.getName()); el.setEvent(e); return sf.getUpdateService().saveAndReturnObject(el); } });
final ome.model.meta.Session sess; if (isReadOnly) { sess = new ome.model.meta.Session(sessionId, false); } else { sess = sessionProvider.findSessionById(sessionId, sf);
target = newShare(); } else { target = new Session();