Get the CachedNode within the workspace cache.

@param session the session; may not be null
@return the workspace cache's node, or null if this node is new
184621
protected CachedNode nodeInWorkspace( AbstractSessionCache session ) {
        return isNew() ? null : session.getWorkspace().getNode(key);
    }
479867
protected final int getNextNamespaceNode2(int baseID) {
        int type;
        while ((type = _type2(++baseID)) == DTM.ATTRIBUTE_NODE);

        if (type == DTM.NAMESPACE_NODE)
            return baseID;
        else
            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;
  }
664802
def get_or_create_node(self, graph: BELGraph, node: BaseEntity) -> Optional[Node]:
        """"""
        sha512 = node.as_sha512()
        if sha512 in self.object_cache_node:
            return self.object_cache_node[sha512]

        node_model = self.get_node_by_hash(sha512)

        if node_model is not None:
            self.object_cache_node[sha512] = node_model
            return node_model

        node_model = Node._start_from_base_entity(node)

        namespace = node.get(NAMESPACE)
        if namespace is None:
            pass

        elif namespace in graph.namespace_url:
            url = graph.namespace_url[namespace]
            name = node[NAME]
            entry = self.get_namespace_entry(url, name)

            if entry is None:
                log.debug('skipping node with identifier %s: %s', url, name)
                return

            self.session.add(entry)
            node_model.namespace_entry = entry

        elif namespace in graph.namespace_pattern:
            name = node[NAME]
            pattern = graph.namespace_pattern[namespace]
            entry = self.get_or_create_regex_namespace_entry(namespace, pattern, name)

            self.session.add(entry)
            node_model.namespace_entry = entry

        else:
            log.warning("No reference in BELGraph for namespace: {}".format(node[NAMESPACE]))
            return

        if VARIANTS in node or FUSION in node:
            node_model.is_variant = True
            node_model.has_fusion = FUSION in node

            modifications = self.get_or_create_modification(graph, node)

            if modifications is None:
                log.warning('could not create %s because had an uncachable modification', node.as_bel())
                return

            node_model.modifications = modifications

        self.session.add(node_model)
        self.object_cache_node[sha512] = node_model
        return node_model
564795
Session getStorageSession() throws RepositoryException
   {
      try
      {
         ManageableRepository repository = getWorkingRepository();

         String workspaceName = storageWorkspace;
         if (workspaceName == null)
         {
            workspaceName = repository.getConfiguration().getDefaultWorkspaceName();
         }

         return repository.getSystemSession(workspaceName);
      }
      catch (RepositoryConfigurationException e)
      {
         throw new RepositoryException("Can not get system session", e);
      }
   }
326433
private Session getOrCreateSession(@NotNull String keyspace) {
        Timer timer = getMetricsFactory().getTimer("cassandraClient.getOrCreateSession");

        Session currentSession = sessionsByKeyspace.computeIfAbsent(keyspace, key -> {
            LOGGER.debug("Create session for [{}]", keyspace);

            Session session = getCluster().connect(key);
            session.init();

            return session;
        });

        timer.stop();

        return currentSession;
    }
1168168
protected HttpSession createSession(final HttpServletRequest servletRequest) {

        LOGGER.debug("Returning an authenticated session in the default workspace");
        return  new HttpSession(repo.login(credentialsService.getCredentials(servletRequest)));
    }
1216657
@Override
    public EventJournalConfig getEventJournalConfig(ObjectNamespace namespace) {
        String name = namespace.getObjectName();
        CacheConfig cacheConfig = getCacheService().getCacheConfig(name);
        if (cacheConfig == null) {
            throw new CacheNotExistsException("Cache " + name + " is already destroyed or not created yet, on "
                    + nodeEngine.getLocalMember());
        }
        String cacheSimpleName = cacheConfig.getName();
        EventJournalConfig config = nodeEngine.getConfig().findCacheEventJournalConfig(cacheSimpleName);
        if (config == null || !config.isEnabled()) {
            return null;
        }
        return config;
    }
165053
@Override
    public Object getValue(Session session) {

        Object[] data = new Object[nodes.length];

        for (int i = 0; i < nodes.length; i++) {
            Expression e = nodes[i];

            if (e != null) {
                data[i] = e.getValue(session, e.dataType);
            }
        }

        return getValue(session, data);
    }
1300024
public String getMemcachedNodeId() {
        final String nodeId = _nodeIds.get( _random.nextInt( _nodeIds.size() ) );
        return isNodeAvailable( nodeId ) ? nodeId : getAvailableNodeId( nodeId );
    }
30078
public static CmsADESessionCache getCache(HttpServletRequest request, CmsObject cms) {

        CmsADESessionCache cache = (CmsADESessionCache)request.getSession().getAttribute(
            CmsADESessionCache.SESSION_ATTR_ADE_CACHE);
        if (cache == null) {
            cache = new CmsADESessionCache(cms, request);
            request.getSession().setAttribute(CmsADESessionCache.SESSION_ATTR_ADE_CACHE, cache);
        }
        return cache;
    }
1096101
private MembershipType findMembershipType(Session session, String name) throws Exception
   {
      Node membershipTypeNode;
      try
      {
         membershipTypeNode = utils.getMembershipTypeNode(session, name);
      }
      catch (PathNotFoundException e)
      {
         return null;
      }

      MembershipType mt = readMembershipType(membershipTypeNode);
      putInCache(mt);

      return mt;
   }
1212413
public IoSession getSession() {
        synchronized (lock) {
            if (sessions.isEmpty()) {
                return null;
            } else {
                final Object[] keys = sessions.keySet().toArray();
                for (int i = 0; i < sessions.size(); i++) { //
                    counter++;
                    final int pos = Math.abs(counter % sessions.size());
                    final IoSession session = sessions.get(keys[pos]);
                    if (isAvailable(session)) {
                        return session;
                    }
                }
                return null;
            }
        }
    }
771114
@Nullable
  public static Schema getSchemaOfNamespace (@Nullable final String sNamespace)
  {
    final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace);
    return eDocType == null ? null : eDocType.getSchema ();
  }
199039
protected Node getContentNode(Session session, String path)
            throws RepositoryException {
        Node node = null;
        try {
            Item item = session.getItem(path);
            if (item.isNode()) {
                node = (Node) item;
            } else {
                node = item.getParent();
            }
            while (node != null
                    && !isTargetNode(node)
                    && (path = getTargetPath(node)) != null) {
                node = node.getParent();
            }
        } catch (PathNotFoundException ignore) {
            // probably removed... ignore
        }
        return path != null ? node : null;
    }
484338
private final Session getSession (final String targetName) throws NoSuchSessionException {

        final Session session = sessions.get(targetName);

        if (session != null) {
            return session;
        } else {
            throw new NoSuchSessionException("Session " + targetName + " not found!");
        }
    }
972013
public int closeSessions(String workspaceName)
   {
      int closedSessions = 0;

      for (SessionImpl session : sessionsMap.values())
      {
         if (session.getWorkspace().getName().equals(workspaceName))
         {
            session.logout();
            closedSessions++;
         }
      }

      return closedSessions;
   }