/** * use like removeSession */ public void removeSessionSet(java.util.Collection<ome.model.meta.Session> targets ) { if (! _loaded ) errorIfUnloaded(); if (getSessions() == null) { throwNullCollectionException("Sessions"); } getSessions().removeAll( targets ); java.util.Iterator<ome.model.meta.Session> it = targets.iterator(); while ( it.hasNext() ) { ome.model.meta.Session target = it.next(); target.setNode ( null ); } }
/** * use like addSession. */ public void addSessionSet(java.util.Collection<ome.model.meta.Session> targets) { if (! _loaded ) errorIfUnloaded(); if (getSessions() == null) { throwNullCollectionException("Sessions"); } getSessions().addAll( targets ); java.util.Iterator<ome.model.meta.Session> it = targets.iterator(); while ( it.hasNext() ) { ome.model.meta.Session target = it.next(); // If this relationship is not ordered, then we will // "attempt" the setting even if it is loaded. if (target != null) { target.setNode ( this ); } } }
/** * removes a single element from this set and makes the inverse call on ome.model.meta.Session */ public void removeSession(ome.model.meta.Session target) { if (! _loaded ) errorIfUnloaded(); if (getSessions() == null) { throwNullCollectionException("Sessions"); } getSessions().remove( target ); target.setNode ( null ); }
/** * clears the set. */ public void clearSessions() { if (! _loaded ) errorIfUnloaded(); if (getSessions() == null) { throwNullCollectionException("Sessions"); } getSessions().clear(); java.util.Iterator<ome.model.meta.Session> it = iterateSessions(); while (it.hasNext()) { ome.model.meta.Session target = it.next(); target.setNode ( null ); } }
/** * use instead of setSessions . Makes the necessary * call on ome.model.meta.Session as well. */ public void addSession(ome.model.meta.Session target) { if (! _loaded ) errorIfUnloaded(); if (getSessions() == null) { throwNullCollectionException("Sessions"); } getSessions().add( target ); // If this relationship is not ordered, then we will // "attempt" the setting even if it is loaded. if (target != null) { target.setNode ( this ); } }
setVersion((Integer) value); } else if (field.equals(NODE)) { setNode((ome.model.meta.Node)value); } else if (field.equals(UUID)) { setUuid((java.lang.String)value);
@Override public Session executeInternalSession(final String uuid, Session session) { Node node = (Node) executor.executeSql(new Executor.SimpleSqlWork(this, "executeInternalSession") { @Transactional(readOnly = true) public Object doWork(SqlAction sql) { final Long nodeId = nodeProvider.getManagerIdByUuid(uuid, sql); return nodeId == null ? null : new Node(nodeId, false); } }); session.setId(executeNextSessionId()); log.debug("Created session: {}", session); log.debug("Setting node: {}", node); session.setNode(node); session.setOwner(new Experimenter(roles.getRootId(), false)); openSessions.put(session.getUuid(), session); return session; }
session.setNode(new Node(nodeId, false)); session.setOwner(new Experimenter(roles.getRootId(), false)); session.setId(id);
public Session( ome.model.meta.Node _node,java.lang.String _uuid,ome.model.meta.Experimenter _owner,java.lang.Long _timeToIdle,java.lang.Long _timeToLive,java.sql.Timestamp _started,java.lang.String _defaultEventType ) { this(null, true); setNode(_node); setUuid(_uuid); setOwner(_owner); setTimeToIdle(_timeToIdle); setTimeToLive(_timeToLive); setStarted(_started); setDefaultEventType(_defaultEventType); }
@Override public Session executeUpdate(ServiceFactory sf, Session session, String uuid, long userId, Long sudoerId) { Node node = nodeProvider.getManagerByUuid(uuid, sf); if (node == null) { node = new Node(0L, false); // Using default node. } if (session.getId() == null) { session.setId(executeNextSessionId()); } session.setNode(node); session.setOwner(new Experimenter(userId, false)); if (sudoerId == null) { session.setSudoer(null); } else { session.setSudoer(new Experimenter(sudoerId, false)); } /* put before remove so that the session is never missing altogether */ if (session.getClosed() == null) { openSessions.put(session.getUuid(), session); closedSessions.remove(session.getUuid()); } else { closedSessions.put(session.getUuid(), session); openSessions.remove(session.getUuid()); } log.debug("Registered Session:{} ({})", session.getId(), session.getUuid()); return session; }
@Override public Session executeUpdate(ServiceFactory sf, Session session, String uuid, long userId, Long sudoerId) { Node node = nodeProvider.getManagerByUuid(uuid, sf); if (node == null) { node = new Node(0L, false); // Using default node. } session.setNode(node); session.setOwner(new Experimenter(userId, false)); if (sudoerId == null) { session.setSudoer(null); } else { session.setSudoer(new Experimenter(sudoerId, false)); } Session rv = sf.getUpdateService().saveAndReturnObject(session); rv.putAt("#2733", session.retrieve("#2733")); return rv; }
target.getDetails().shallowCopy(source.getDetails()); target.setMessage(source.getMessage()); target.setNode(source.getNode()); target.setStarted(source.getStarted()); target.setTimeToIdle(source.getTimeToIdle());