Get workspace Container by name.

@param workspaceName
name
@return WorkspaceContainer
346219
public WorkspaceContainer getWorkspaceContainer(String workspaceName)
   {
      Object comp = getComponentInstance(workspaceName);
      return comp != null && comp instanceof WorkspaceContainer ? (WorkspaceContainer)comp : null;
   }
866698
public WorkspaceCache createExternalWorkspace(String name, Connectors connectors) {
        String[] tokens = name.split(":");
        
        String sourceName = tokens[0];
        String workspaceName = tokens[1];
        
        this.workspaceNames.add(workspaceName);
        refreshRepositoryMetadata(true);

        ConcurrentMap<NodeKey, CachedNode> nodeCache = cacheForWorkspace().asMap();
        ExecutionContext context = context();
        
        //the name of the external connector is used for source name and workspace name
        
        String sourceKey = NodeKey.keyForSourceName(sourceName);
        String workspaceKey = NodeKey.keyForWorkspaceName(workspaceName);

        //ask external system to determine root identifier.
        Connector connector = connectors.getConnectorForSourceName(sourceName); 
        if (connector == null) {
            throw new IllegalArgumentException(JcrI18n.connectorNotFound.text(sourceName));
        }
        FederatedDocumentStore documentStore = new FederatedDocumentStore(connectors, this.documentStore().localStore());
        String rootId = connector.getRootDocumentId();

        // Compute the root key for this workspace ...
        NodeKey rootKey = new NodeKey(sourceKey, workspaceKey, rootId);

        // We know that this workspace is not the system workspace, so find it ...
        final WorkspaceCache systemWorkspaceCache = workspaceCachesByName.get(systemWorkspaceName);
        
        WorkspaceCache workspaceCache = new WorkspaceCache(context, getKey(), 
                workspaceName, systemWorkspaceCache, documentStore, translator, rootKey, nodeCache, changeBus, repositoryEnvironment());
        workspaceCachesByName.put(workspaceName, workspaceCache);

        return workspace(workspaceName);
    }
73901
private ExoContainer getContainer() throws ResourceException
   {
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      if (container instanceof RootContainer)
      {
         String portalContainerName =
            portalContainer == null ? PortalContainer.DEFAULT_PORTAL_CONTAINER_NAME : portalContainer;
         container = RootContainer.getInstance().getPortalContainer(portalContainerName);
         if (container == null)
         {
            throw new ResourceException("The eXo container is null, because the current container is a RootContainer "
               + "and there is no PortalContainer with the name '" + portalContainerName + "'.");
         }
      }
      else if (container == null)
      {
         throw new ResourceException("The eXo container is null, because the current container is null.");
      }
      return container;
   }
1128638
public function getContainer($name)
    {
        // try to match one of the container names with the passed name
        /** @var \AppserverIo\Psr\ApplicationServer\Configuration\ContainerConfigurationInterface $container */
        foreach ($this->getContainers() as $container) {
            if (fnmatch($name, $container->getName())) {
                return $container;
            }
        }
    }
1106202
async function getNamespace(namespaceName) {
  const cacheName = '_console_namespace_promise_cache_';
  if (!window[cacheName]) {
    window[cacheName] = {};
  }
  const cache = window[cacheName];
  if (!cache[namespaceName]) {
    cache[namespaceName] = fetchFromKyma(
      `${k8sServerUrl}/api/v1/namespaces/${namespaceName}`
    );
  }
  return await cache[namespaceName];
}
942951
public static Batch emptyBatch( final String workspaceName,
                                    final int width ) {
        assert width > 0;
        return new Batch() {
            @Override
            public boolean hasNext() {
                return false;
            }

            @Override
            public String getWorkspaceName() {
                return workspaceName;
            }

            @Override
            public int width() {
                return width;
            }

            @Override
            public long rowCount() {
                return 0;
            }

            @Override
            public boolean isEmpty() {
                return true;
            }

            @Override
            public void nextRow() {
                throw new NoSuchElementException();
            }

            @Override
            public CachedNode getNode() {
                throw new NoSuchElementException();
            }

            @Override
            public CachedNode getNode( int index ) {
                throw new NoSuchElementException();
            }

            @Override
            public float getScore() {
                throw new NoSuchElementException();
            }

            @Override
            public float getScore( int index ) {
                throw new NoSuchElementException();
            }

            @Override
            public String toString() {
                return "(empty-batch width=" + width() + ")";
            }
        };
    }
1361198
public long getWorkspaceDataSize() throws RepositoryException
   {
      final WorkspaceStorageConnection con = dataContainer.openConnection();
      try
      {
         return con.getWorkspaceDataSize();
      }
      finally
      {
         con.close();
      }
   }
1000391
public void internalRemoveWorkspace(final String workspaceName) throws RepositoryException
   {
      SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);

      final WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
      try
      {
         SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
         {
            public Void run()
            {
               workspaceContainer.stop();
               return null;
            }
         });
      }
      catch (Exception e)
      {
         throw new RepositoryException(e);
      }
      SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
      {
         public Void run()
         {
            repositoryContainer.unregisterComponent(workspaceName);
            return null;
         }
      });

      config.getWorkspaceEntries().remove(repositoryContainer.getWorkspaceEntry(workspaceName));

      for (WorkspaceManagingListener listener : workspaceListeners)
      {
         listener.onWorkspaceRemove(workspaceName);
      }
   }
352185
public function onPrepareWorkspaceConstructWorkspaceInstance(WorkspaceEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
    {
        $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Creating Workspace.', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_IN_PROGRESS)));

        $workspace = new Workspace($event->getHost());
        $workspace->setReleasesDirectory($this->releasesDirectory);
        $workspace->setDataDirectory($this->dataDirectory);
        $workspace->setCacheDirectory($this->cacheDirectory);
        $workspace->setOtherDirectories($this->otherDirectories);

        $event->setWorkspace($workspace);

        $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Created Workspace.', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_COMPLETED, 'output.resetLine' => true)));
    }
174067
private String composeWorkspaceUniqueName(String repositoryName, String workspaceName)
   {
      StringBuilder builder = new StringBuilder();
      builder.append(repositoryName);
      builder.append('/');
      builder.append(workspaceName);
      builder.append('/');

      return builder.toString();
   }
667693
public function updateWorkspace($workspaceId = null, $data = ["name" => ""])
    {
        $workspaceId = $workspaceId ?: $this->defaultWorkspaceId;

        return $this->curl->put("workspaces/{$workspaceId}", ['data' => $data]);
    }
723344
public function findWorkspaceRoot(Workspace $workspace)
    {
        $builder = new ResourceQueryBuilder();
        $builder->selectAsEntity()
            ->whereInWorkspace($workspace)
            ->whereParentIsNull();
        $query = $this->_em->createQuery($builder->getDql());
        $query->setParameters($builder->getParameters());

        return $query->getOneOrNullResult();
    }
1281880
protected String makeRESTPath(String repoName, String workspace, String resource)
   {
      final StringBuilder sb = new StringBuilder(512);
      ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
      if (container instanceof PortalContainer)
      {
         PortalContainer pContainer = (PortalContainer)container;
         sb.append('/').append(pContainer.getRestContextName()).append('/');
      }
      else
      {
         sb.append('/').append(PortalContainer.DEFAULT_REST_CONTEXT_NAME).append('/');
      }
      return sb.append("jcr/").append(repoName).append('/').append(workspace).append(resource).toString();
   }
310355
public String containerName() {
    final String shortId = job.getId().toShortString();
    final String escaped = CONTAINER_NAME_FORBIDDEN.matcher(shortId).replaceAll("_");
    final String random = Integer.toHexString(new SecureRandom().nextInt());
    return namespace + "-" + escaped + "_" + random;
  }
1267352
public ItemRequest<Workspace> findById(String workspace) {
    
        String path = String.format("/workspaces/%s", workspace);
        return new ItemRequest<Workspace>(this, Workspace.class, path, "GET");
    }
1069499
protected function collectWorkspaceAndAllBaseWorkspaces(Workspace $workspace)
    {
        $workspaces = [];
        while ($workspace !== null) {
            $workspaces[] = $workspace;
            $workspace = $workspace->getBaseWorkspace();
        }

        return $workspaces;
    }
724406
public function getWorkspaces()
    {
        return $this->getCachedProperty(
            'workspaces',
            function () {
                $result = [];
                $items = $this->getValue('workspaces');
                if (is_array($items)) {
                    /** @var array $items */
                    foreach ($items as $item) {
                        try {
                            $result[] = new Workspace($item);
                        } catch (\InvalidArgumentException $e) {
                            throw new \UnexpectedValueException(
                                $e->getMessage(),
                                $e->getCode(),
                                $e
                            );
                        }
                    }
                }

                return $result;
            }
        );
    }