Package org.exoplatform.services.jcr.impl.storage.jdbc.JDBCDataContainerConfig

Examples of org.exoplatform.services.jcr.impl.storage.jdbc.JDBCDataContainerConfig.DatabaseStructureType


    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!DBInitializerHelper.getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + DBInitializerHelper.getDatabaseType(wsEntry) + " and " + wsConfig.getName()
               + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here


    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!DBInitializerHelper.getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + DBInitializerHelper.getDatabaseType(wsEntry) + " and " + wsConfig.getName()
               + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here

   {
      String itemTableSuffix = getItemTableSuffix(wsEntry);
      String valueTableSuffix = getValueTableSuffix(wsEntry);
      String refTableSuffix = getRefTableSuffix(wsEntry);

      DatabaseStructureType dbType = JDBCWorkspaceDataContainer.getDatabaseType(wsEntry);

      boolean isolatedDB = dbType == DatabaseStructureType.ISOLATED;
      String initScriptPath = DBInitializerHelper.scriptPath(dialect, dbType.isMultiDatabase());

      return prepareScripts(initScriptPath, itemTableSuffix, valueTableSuffix, refTableSuffix, isolatedDB);
   }
View Full Code Here

    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + getDatabaseType(wsEntry) + " and " + wsConfig.getName() + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here

         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleanerTool dbCleaner = null;
        
         DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsEntry);

         if (dbType.isShareSameDatasource())
         {
            String dsName = wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);

            final DataSource ds = (DataSource)new InitialContext().lookup(dsName);
            if (ds == null)
View Full Code Here

    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!DBInitializerHelper.getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + DBInitializerHelper.getDatabaseType(wsEntry) + " and " + wsConfig.getName()
               + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here

         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleanerTool dbCleaner = null;
        
         DatabaseStructureType dbType = JDBCWorkspaceDataContainer.getDatabaseType(wsEntry);

         if (dbType.isShareSameDatasource())
         {
            String dsName = wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);

            final DataSource ds = (DataSource)new InitialContext().lookup(dsName);
            if (ds == null)
View Full Code Here

    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!DBInitializerHelper.getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + DBInitializerHelper.getDatabaseType(wsEntry) + " and " + wsConfig.getName()
               + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here

    *           in case of configuration errors
    */
   protected void checkIntegrity(WorkspaceEntry wsConfig, RepositoryEntry repConfig)
      throws RepositoryConfigurationException
   {
      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsConfig);

      for (WorkspaceEntry wsEntry : repConfig.getWorkspaceEntries())
      {
         if (wsEntry.getName().equals(wsConfig.getName())
            || !wsEntry.getContainer().getType().equals(wsConfig.getContainer().getType())
            || !wsEntry.getContainer().getType().equals(this.getClass().getName()))
         {
            continue;
         }

         if (!DBInitializerHelper.getDatabaseType(wsEntry).equals(dbType))
         {
            throw new RepositoryConfigurationException("All workspaces must be of same DB type. But "
               + wsEntry.getName() + "=" + DBInitializerHelper.getDatabaseType(wsEntry) + " and " + wsConfig.getName()
               + "=" + dbType);
         }

         // source name
         String wsSourceName = null;
         String newWsSourceName = null;
         try
         {
            wsSourceName = wsEntry.getContainer().getParameterValue("sourceName");
            newWsSourceName = wsConfig.getContainer().getParameterValue("sourceName");
         }
         catch (RepositoryConfigurationException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }

         if (wsSourceName != null && newWsSourceName != null)
         {
            if (dbType.isShareSameDatasource())
            {
               if (!wsSourceName.equals(newWsSourceName))
               {
                  throw new RepositoryConfigurationException("SourceName must be equals in " + dbType
                     + "-database repository." + " Check " + wsEntry.getName() + " and " + wsConfig.getName());
View Full Code Here

   {
      String itemTableSuffix = getItemTableSuffix(wsEntry);
      String valueTableSuffix = getValueTableSuffix(wsEntry);
      String refTableSuffix = getRefTableSuffix(wsEntry);

      DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsEntry);

      boolean isolatedDB = dbType == DatabaseStructureType.ISOLATED;
      String initScriptPath = DBInitializerHelper.scriptPath(dialect, dbType.isMultiDatabase());

      return prepareScripts(initScriptPath, itemTableSuffix, valueTableSuffix, refTableSuffix, isolatedDB);
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.storage.jdbc.JDBCDataContainerConfig.DatabaseStructureType

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.