]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge commit '728147df5d63a3333daff3d8c0e9bfd4f5597e3a'
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 16 Sep 2016 08:17:32 +0000 (11:17 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 16 Sep 2016 08:17:32 +0000 (11:17 +0300)
refs #6694

1  2 
bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java

index 4a673b97dce934bf7165bdded2744db8382b63f8,bbeb7541e0892e86c1eb45c8a8c9c5a8c168bed5..8957a21679b45607a2daab8d235b7e90545c93c6
@@@ -30,12 -30,12 +30,12 @@@ import org.simantics.db.exception.Datab
  import org.simantics.utils.FileUtils;\r
  \r
  public class ServerManagerFactory {\r
-     public static ServerManager create(String databaseId, String address) throws IOException, DatabaseException {\r
-         Driver driver = Manager.getDriver(databaseId);\r
+     public static ServerManager create(String databaseDriverId, String address) throws IOException, DatabaseException {\r
+         Driver driver = Manager.getDriver(databaseDriverId);\r
          if (driver == null)\r
-             throw new IllegalArgumentException("Database driver with ID " + databaseId + " could not be found!");\r
-         System.out.println("ServerManagerFactory.create called with id " + databaseId + ", driver is " + driver.toString());\r
-         DatabaseUserAgent agent = Manager.getUserAgent(databaseId);\r
 -            throw new IllegalArgumentException("Database driver for ID " + databaseDriverId + " Could not be found!");\r
 -        System.out.println("ServerManagerFactory.create called with databaseId=" + databaseDriverId + " and driver is " + driver.toString());\r
++            throw new IllegalArgumentException("Database driver with ID " + databaseDriverId + " could not be found!");\r
++        System.out.println("ServerManagerFactory.create called with id " + databaseDriverId + ", driver is " + driver.toString());\r
+         DatabaseUserAgent agent = Manager.getUserAgent(databaseDriverId);\r
          if (agent != null)\r
              driver.setDatabaseUserAgent(address, agent);\r
          return new ServerManager(driver);\r
index 611cfa575843857d7f6b4e476d15641e6185d29d,40bbc04ed3e7ba70dac8648d5b8aaa6c56458ebc..ba29a654a461370360c61ee399963363ff1e6e7f
@@@ -197,13 -197,13 +197,13 @@@ public class SimanticsPlatform implemen
          return application != null ? application : UUID.randomUUID().toString();\r
      }\r
  \r
-     private Session setupDatabase(String databaseId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, PlatformUserAgent userAgent) throws PlatformException {\r
+     private Session setupDatabase(String databaseDriverId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, PlatformUserAgent userAgent) throws PlatformException {\r
          if (progressMonitor == null)\r
              progressMonitor = new NullProgressMonitor();\r
          File dbLocation = Platform.getLocation().append("db").toFile();\r
          ServerManager serverManager;\r
          try {\r
-             serverManager = ServerManagerFactory.create(databaseId, dbLocation.getAbsolutePath());\r
+             serverManager = ServerManagerFactory.create(databaseDriverId, dbLocation.getAbsolutePath());\r
          } catch (DatabaseException | IOException e) {\r
              throw new PlatformException("Failed to initialize Server Manager", e);\r
          }\r
                      // Check hash of transferable graph to know whether to update or not.\r
                      if (platformBundle.getHashcode() == existingBundle.getHashcode())\r
                          continue;\r
 -                    System.out.println("Ontology hashcodes does not match! platformBundle" + platformBundle.getName() + ".getHashCode()=" + platformBundle.getHashcode() + " existingBundle" + existingBundle.getName() + ".getHashCode()=" + existingBundle.getHashcode());\r
 +                    System.out.println("Ontology hashcodes do not match: platform bundle="\r
 +                            + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode()\r
 +                            + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode());\r
                      reinstallTGs.put(platformBundle, existingBundle);\r
                  }\r
              }\r
       *        startup or <code>null</code> to resort to default measures\r
       * @throws PlatformException\r
       */\r
-     public SessionContext startUp(String databaseId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy,\r
+     public SessionContext startUp(String databaseDriverId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy,\r
              OntologyRecoveryPolicy ontologyPolicy, boolean requireSynchronize, PlatformUserAgent userAgent)\r
      throws PlatformException\r
      {\r
          VariableRepository.clear();\r
          \r
          // 1. Assert there is a database at <workspace>/db\r
-         session = setupDatabase(databaseId, progressMonitor, workspacePolicy, userAgent);\r
+         session = setupDatabase(databaseDriverId, progressMonitor, workspacePolicy, userAgent);\r
          TimeLogger.log("Database setup complete");\r
  \r
          // 2. Assert all graphs, and correct versions, are installed to the database\r
          return false;\r
      }\r
  \r
-     public void reconnect(String databaseId) throws Exception {\r
+     public void reconnect(String databaseDriverId) throws Exception {\r
          // Starts database server.\r
-         SimanticsPlatform.INSTANCE.startUp(databaseId, null, RecoveryPolicy.ThrowError, OntologyRecoveryPolicy.ThrowError, true, null);\r
+         SimanticsPlatform.INSTANCE.startUp(databaseDriverId, null, RecoveryPolicy.ThrowError, OntologyRecoveryPolicy.ThrowError, true, null);\r
      }\r
  \r
      private void dumpPlatformBundleState() {\r