X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Fmanagement%2FServerManagerFactory.java;h=65190614c4dc52612decf0fda5bdca32d9b0e8a4;hp=4a673b97dce934bf7165bdded2744db8382b63f8;hb=591f4572f18d20a08a797a8e5c4a8dfc1b3320c1;hpb=749a1ea2c0a66ae41aad617d1fd81b61cbdb7685 diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java b/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java index 4a673b97d..65190614c 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java +++ b/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java @@ -22,20 +22,22 @@ import java.net.URLDecoder; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.apache.log4j.Logger; import org.simantics.db.DatabaseUserAgent; import org.simantics.db.Driver; import org.simantics.db.Manager; import org.simantics.db.exception.DatabaseException; -import org.simantics.utils.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServerManagerFactory { - public static ServerManager create(String databaseId, String address) throws IOException, DatabaseException { - Driver driver = Manager.getDriver(databaseId); + private static final Logger LOGGER = LoggerFactory.getLogger(ServerManagerFactory.class); + + public static ServerManager create(String databaseDriverId, String address) throws IOException, DatabaseException { + Driver driver = Manager.getDriver(databaseDriverId); if (driver == null) - throw new IllegalArgumentException("Database driver with ID " + databaseId + " could not be found!"); - System.out.println("ServerManagerFactory.create called with id " + databaseId + ", driver is " + driver.toString()); - DatabaseUserAgent agent = Manager.getUserAgent(databaseId); + throw new IllegalArgumentException("Database driver with ID " + databaseDriverId + " could not be found!"); + LOGGER.info("ServerManagerFactory.create called with id {}, driver is {}.", databaseDriverId, driver); + DatabaseUserAgent agent = Manager.getUserAgent(databaseDriverId); if (agent != null) driver.setDatabaseUserAgent(address, agent); return new ServerManager(driver); @@ -166,7 +168,6 @@ public class ServerManagerFactory { * @throws IOException */ private static void extractZip(InputStream zipInput, File dst) throws IOException { - Logger myLogger = Logger.getLogger(FileUtils.class); byte[] buf = new byte[8192]; ZipInputStream zis = new ZipInputStream(zipInput); ZipEntry entry; @@ -175,7 +176,7 @@ public class ServerManagerFactory { while (entry != null) { // for each entry to be extracted String name = entry.getName(); - myLogger.debug("Extracting "+name); + LOGGER.debug("Extracting "+name); File file = new File(dst, name); if (entry.isDirectory())