Package javax.jcr

Examples of javax.jcr.NoSuchWorkspaceException


    * {@inheritDoc}
    */
   public boolean canRemoveWorkspace(String workspaceName) throws NoSuchWorkspaceException
   {
      if (repositoryContainer.getWorkspaceEntry(workspaceName) == null)
         throw new NoSuchWorkspaceException("No such workspace " + workspaceName);

      if (workspaceName.equals(config.getSystemWorkspaceName()))
         return false;

      SessionRegistry sessionRegistry =
View Full Code Here


      if (workspaceName == null)
      {
         workspaceName = config.getDefaultWorkspaceName();
         if (workspaceName == null)
            throw new NoSuchWorkspaceException("Both workspace and default-workspace name are null! ");
      }

      if (!isWorkspaceInitialized(workspaceName))
         throw new NoSuchWorkspaceException("Workspace '" + workspaceName + "' not found. "
            + "Probably is not initialized. If so either Initialize it manually or turn on the RepositoryInitializer");

      SessionFactory sessionFactory = repositoryContainer.getWorkspaceContainer(workspaceName).getSessionFactory();
      return sessionFactory.createSession(state);
   }
View Full Code Here

    * {@inheritDoc}
    */
   public boolean canRemoveWorkspace(String workspaceName) throws NoSuchWorkspaceException
   {
      if (repositoryContainer.getWorkspaceEntry(workspaceName) == null)
         throw new NoSuchWorkspaceException("No such workspace " + workspaceName);

      if (workspaceName.equals(config.getSystemWorkspaceName()))
         return false;

      SessionRegistry sessionRegistry =
View Full Code Here

      if (workspaceName == null)
      {
         workspaceName = config.getDefaultWorkspaceName();
         if (workspaceName == null)
            throw new NoSuchWorkspaceException("Both workspace and default-workspace name are null! ");
      }

      if (!isWorkspaceInitialized(workspaceName))
         throw new NoSuchWorkspaceException("Workspace '" + workspaceName + "' not found. "
            + "Probably is not initialized. If so either Initialize it manually or turn on the RepositoryInitializer");

      SessionFactory sessionFactory = repositoryContainer.getWorkspaceContainer(workspaceName).getSessionFactory();
      return sessionFactory.createSession(state);
   }
View Full Code Here

        for (int i = 0; i < wsps.length && !accessible; i++) {
            accessible = wsps[i].equals(workspaceName);
        }

        if (!accessible) {
            throw new NoSuchWorkspaceException("Unknown workspace: '" + workspaceName + "'.");
        }
    }
View Full Code Here

        WorkspaceInfo wspInfo;
        synchronized (wspInfos) {
            wspInfo = (WorkspaceInfo) wspInfos.get(workspaceName);
            if (wspInfo == null) {
                throw new NoSuchWorkspaceException(workspaceName);
            }
        }

        try {
            initWorkspace(wspInfo);
        } catch (RepositoryException e) {
            log.error("Unable to initialize workspace '" + workspaceName + "'", e);
            throw new NoSuchWorkspaceException(workspaceName);
        }
        return wspInfo;
    }
View Full Code Here

        for (int i = 0; i < wsps.length && !accessible; i++) {
            accessible = wsps[i].equals(workspaceName);
        }

        if (!accessible) {
            throw new NoSuchWorkspaceException("Unknown workspace: '" + workspaceName + "'.");
        }
    }
View Full Code Here

     *   list of workspaces nor null (i.e. default workspace).
     */
    @Override
    protected void checkWorkspace(String workspaceName) throws NoSuchWorkspaceException {
        if (workspaceName != null && !wspNames.contains(workspaceName)) {
            throw new NoSuchWorkspaceException(workspaceName);
        }
    }
View Full Code Here

        WorkspaceInfo wspInfo;
        synchronized (wspInfos) {
            wspInfo = wspInfos.get(workspaceName);
            if (wspInfo == null) {
                throw new NoSuchWorkspaceException(workspaceName);
            }
        }

        try {
            wspInfo.initialize();
        } catch (RepositoryException e) {
            log.error("Unable to initialize workspace '" + workspaceName + "'", e);
            throw new NoSuchWorkspaceException(workspaceName);
        }
        return wspInfo;
    }
View Full Code Here

        } else if (ex instanceof NamespaceException) {
            return new NamespaceException(ex.getMessage());
        } else if (ex instanceof NoSuchNodeTypeException) {
            return new NoSuchNodeTypeException(ex.getMessage());
        } else if (ex instanceof NoSuchWorkspaceException) {
            return new NoSuchWorkspaceException(ex.getMessage());
        } else if (ex instanceof PathNotFoundException) {
            return new PathNotFoundException(ex.getMessage());
        } else if (ex instanceof ReferentialIntegrityException) {
            return new ReferentialIntegrityException(ex.getMessage());
        } else if (ex instanceof UnsupportedRepositoryOperationException) {
View Full Code Here

TOP

Related Classes of javax.jcr.NoSuchWorkspaceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.