Returns session id of the current lock holder or an empty collection if
the lock is not held
767545
@Override
    protected Collection<Long> getActivelyAttachedSessions() {
        return owner != null ? Collections.singleton(owner.sessionId()) : Collections.<Long>emptyList();
    }
1253264
def get_lock(key, value=None, expiry_time=60):
    """"""
    from uliweb.utils.common import get_uuid

    redis = get_redis()
    value = value or get_uuid()
    return redis.set(key, value, ex=expiry_time, nx=True)
1336573
def get_thread_id(self):
        """"""
        if self._id is None:
            for thread_id, obj in list(threading._active.items()):
                if obj is self:
                    self._id = thread_id
        return self._id
389882
private Long getLastUpdateTime(String sessionId) {
        if (lastUpdateForSession != null && sessionId != null && lastUpdateForSession.containsKey(sessionId)) {
            return lastUpdateForSession.get(sessionId);
        } else {
            return -1L;
        }
    }
389898
public function getSessionId() : string
    {
        //if its empty get it from the relationship, else get it from the property
        return empty($this->session_id) ? $this->getSession(['order' => 'time desc'])->session_id : $this->session_id;
    }
942064
private Map<String, ComponentDto> indexExistingDtosByUuids(DbSession session) {
    return dbClient.componentDao().selectAllComponentsFromProjectKey(session, treeRootHolder.getRoot().getDbKey())
      .stream()
      .collect(Collectors.toMap(ComponentDto::uuid, Function.identity()));
  }
1167126
public LockData getPendingLock(String nodeId)
   {
      if (pendingLocks.contains(nodeId))
      {
         return lockedNodes.get(nodeId);
      }
      else
      {
         return null;
      }
   }
231925
public int getLockState() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getLockedByName())) {
            // unlocked
            return 0;
        }
        if (!getLockedByName().equals(getCurrentOuRelativeName(m_request.getCurrentUser().getName()))
            || !getLockedInProjectId().equals(m_request.getCurrentProject().getUuid())) {
            // locked by other user and/or project
            return 1;
        }
        if (getLock().getType().isShared()) {
            // shared lock
            return 2;
        }
        // exclusive lock
        return 3;
    }
597855
def lock_resource_for_update(cls, resource_id, db_session):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model)
        query = query.filter(cls.model.resource_id == resource_id)
        query = query.with_for_update()
        return query.first()
710818
def lock_status(self, resource_id, parent_id=None, account_id=None):
        
        account_id = self.get_account_id(account_id)
        params = parent_id and {'parent_id': parent_id} or None
        return self.http.get(
            "%s/%s/locks/%s" % (self.endpoint, account_id, resource_id),
            params=params, auth=self.get_api_auth())
438065
function getSession(sessions, sessionId) {
  var sess = sessions[sessionId]

  if (!sess) {
    debug('no session in MemoryStore for %s',sessionId);
    return;
  }

  // parse
  sess = JSON.parse(sess)

  var expires = typeof sess.cookie.expires === 'string' ?
    new Date(sess.cookie.expires) :
    sess.cookie.expires

  // destroy expired session
  if (expires && expires <= Date.now()) {
    debug('Session %s is Expired in MemoryStore',sessionId);
    delete sessions[sessionId];
    return;
  }

  return sess
}
104067
public int getSessionID()
    {
        Integer intSession = (Integer)m_hmSessions.get(this);
        if (intSession == null)
        {
            synchronized (m_hmSessions)
            {
                m_hmSessions.put(this, intSession = new Integer(m_iNextSession++));
            }
        }
        return intSession.intValue();
    }
690708
def get(self, object_id, cls=None):
        
        cls = self.cls if cls is None else cls
        return self.session.query(cls).get(object_id)
1357878
public String getLockedByName() {

        String lockedBy = "";
        if (!getLock().isNullLock()) {
            // user
            lockedBy = getLock().getUserId().toString();
            try {
                lockedBy = getCurrentOuRelativeName(
                    CmsPrincipal.readPrincipalIncludingHistory(getCms(), getLock().getUserId()).getName());
            } catch (Throwable e) {
                lockedBy = e.getMessage();
            }
        }
        return lockedBy;
    }
661231
def lock(self, session):
        
        if self.busy:
            raise ConnectionBusyError(self)
        with self._lock:
            self.used_by = weakref.ref(session)
        LOGGER.debug('Connection %s locked', self.id)
763850
protected function getSessionId() {
    // check if we already have a session with the server
    $session = ObjectFactory::getInstance('session');
    $sids = $session->get(self::SIDS_SESSION_VARNAME);
    if (isset($sids[$this->serverCli])) {
      return $sids[$this->serverCli];
    }
    return null;
  }
852668
@Nullable
  public static ISessionWebScope getSessionWebScopeOfID (@Nullable final String sScopeID)
  {
    final ISessionScope aSessionScope = ScopeSessionManager.getInstance ().getSessionScopeOfID (sScopeID);
    if (aSessionScope == null)
      return null;
    if (!(aSessionScope instanceof ISessionWebScope))
    {
      if (LOGGER.isWarnEnabled ())
        LOGGER.warn ("The passed scope ID '" +
                        sScopeID +
                        "' is not a session web scope: " +
                        aSessionScope.toString ());
      return null;
    }
    return (ISessionWebScope) aSessionScope;
  }