Package org.exoplatform.services.jcr.impl

Examples of org.exoplatform.services.jcr.impl.WorkspaceContainer


      {
         LOG.warn("Workspace '" + workspaceName + "' is presumably initialized. config canceled");
         return;
      }

      final WorkspaceContainer wsContainer = repositoryContainer.getWorkspaceContainer(workspaceName);

      if (wsContainer == null)
         throw new RepositoryException("Workspace " + workspaceName
            + " is not configured. Use RepositoryImpl.configWorkspace() method");

      repositoryContainer.getWorkspaceContainer(workspaceName).getWorkspaceInitializer().initWorkspace();
      SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
      {
         public Void run()
         {
            wsContainer.start();
            return null;
         }
      });
      LOG.info("Workspace " + workspaceName + "@" + this.name + " is initialized");
   }
View Full Code Here


   {

      if (getState() == OFFLINE)
         LOG.warn("Repository " + getName() + " is OFFLINE.");

      WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
      if (workspaceContainer == null || !workspaceContainer.getWorkspaceInitializer().isWorkspaceInitialized())
      {
         throw new RepositoryException("Workspace " + workspaceName + " not found or workspace is not initialized");
      }

      SessionFactory sessionFactory = workspaceContainer.getSessionFactory();

      return sessionFactory.createSession(authenticationPolicy.authenticate(SYSTEM_CREDENTIALS));
   }
View Full Code Here

   {

      if (getState() == OFFLINE)
         LOG.warn("Repository " + getName() + " is OFFLINE.");

      WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
      if (workspaceContainer == null || !workspaceContainer.getWorkspaceInitializer().isWorkspaceInitialized())
      {
         throw new RepositoryException("Workspace " + workspaceName + " not found or workspace is not initialized");
      }

      SessionFactory sessionFactory = workspaceContainer.getSessionFactory();

      Identity id = new Identity(DynamicIdentity.DYNAMIC, membershipEntries);

      return sessionFactory.createSession(new ConversationState(id));
   }
View Full Code Here

      if (security != null)
      {
         security.checkPermission(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)
View Full Code Here

      {
         repositoryContainer.registerWorkspace(wsConfig);
      }
      catch (RepositoryConfigurationException e)
      {
         WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(wsConfig.getName());
         repositoryContainer.unregisterComponentByInstance(workspaceContainer);
         repositoryContainer.unregisterComponent(wsConfig.getName());
         throw new RepositoryConfigurationException(e);
      }
      catch (RepositoryException e)
      {
         WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(wsConfig.getName());
         repositoryContainer.unregisterComponentByInstance(workspaceContainer);
         repositoryContainer.unregisterComponent(wsConfig.getName());
         throw new RepositoryException(e);
      }
   }
View Full Code Here

      {
         LOG.warn("Workspace '" + workspaceName + "' is presumably initialized. config canceled");
         return;
      }

      final WorkspaceContainer wsContainer = repositoryContainer.getWorkspaceContainer(workspaceName);

      if (wsContainer == null)
         throw new RepositoryException("Workspace " + workspaceName
            + " is not configured. Use RepositoryImpl.configWorkspace() method");

      repositoryContainer.getWorkspaceContainer(workspaceName).getWorkspaceInitializer().initWorkspace();

      wsContainer.start();

      LOG.info("Workspace " + workspaceName + "@" + this.name + " is initialized");
   }
View Full Code Here

   {

      if (getState() == OFFLINE)
         LOG.warn("Repository " + getName() + " is OFFLINE.");

      WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
      if (workspaceContainer == null || !workspaceContainer.getWorkspaceInitializer().isWorkspaceInitialized())
      {
         throw new RepositoryException("Workspace " + workspaceName + " not found or workspace is not initialized");
      }

      SessionFactory sessionFactory = workspaceContainer.getSessionFactory();

      return sessionFactory.createSession(authenticationPolicy.authenticate(SYSTEM_CREDENTIALS));
   }
View Full Code Here

      if (security != null)
      {
         security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
      }

      WorkspaceContainer workspaceContainer = null;
      if (isWorkspaceInitialized(workspaceName))
      {
         workspaceContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
         try
         {
            workspaceContainer.stop();
         }
         catch (Exception e)
         {
            throw new RepositoryException(e);
         }
View Full Code Here

         repositoryContainer.registerWorkspace(wsConfig);
      }
      catch (RepositoryConfigurationException e)
      {
         final WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(wsConfig.getName());
         SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
         {
            public Void run()
            {
               repositoryContainer.unregisterComponent(wsConfig.getName());
               return null;
            }
         });
         throw new RepositoryConfigurationException(e);
      }
      catch (RepositoryException e)
      {
         final WorkspaceContainer workspaceContainer = repositoryContainer.getWorkspaceContainer(wsConfig.getName());
         SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
         {
            public Void run()
            {
               repositoryContainer.unregisterComponent(wsConfig.getName());
View Full Code Here

   public synchronized void createWorkspace(String workspaceName) throws RepositoryException
   {

      SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
     
      final WorkspaceContainer wsContainer = repositoryContainer.getWorkspaceContainer(workspaceName);

      if (wsContainer == null)
      {
         throw new RepositoryException("Workspace " + workspaceName
            + " is not configured. Use RepositoryImpl.configWorkspace() method");
      }

      WorkspaceInitializer workspaceInitializer =
         repositoryContainer.getWorkspaceContainer(workspaceName).getWorkspaceInitializer();

      SystemParametersPersistenceConfigurator sppc =
         (SystemParametersPersistenceConfigurator)repositoryContainer
            .getComponentInstanceOfType(SystemParametersPersistenceConfigurator.class);

      if (sppc != null)
      {
         WorkspaceEntry workspaceEntry = repositoryContainer.getWorkspaceEntry(workspaceName);

         repositoryContainer.setInitializerAndValidateOverriddenParameters(workspaceEntry, workspaceInitializer);
      }

      if (isWorkspaceInitialized(workspaceName))
      {
         LOG.warn("Workspace '" + workspaceName + "' is presumably initialized. config canceled");
         return;
      }

      workspaceInitializer.initWorkspace();
      SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
      {
         public Void run()
         {
            wsContainer.start();
            return null;
         }
      });
      LOG.info("Workspace " + workspaceName + "@" + this.name + " is initialized");
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.WorkspaceContainer

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.