Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Increase service quickstart usability
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeweX committed Mar 14, 2018
1 parent e343ece commit b16796e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/control/NamingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public boolean initializeDataStorage(boolean wipeExistent)
return success;
}

public void start() {
public void start(boolean wipeExistent) {
try {
initializeDataStorage(false);
initializeDataStorage(wipeExistent);
} catch (InterruptedException | FileNotFoundException e) {
Thread.currentThread().interrupt();
logger.fatal("Cannot initialize NamingService. Quitting program.", e);
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/control/Starter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@
import database.localfiles.LocalFileController;

public class Starter {

private static Logger logger = Logger.getLogger(Starter.class.getName());

public static void main(String[] args) {
logger.info("And SysAdmin said \"Let there be FBase Naming Service,\" and there was FBase Naming Service.");

Configuration configuration;
boolean wipeExistent = false;
if (args.length == 1) {
configuration = new Configuration(args[0]);
} else {
wipeExistent = true; // because quickstart setup
configuration = new Configuration();
}
IControllable controller = new LocalFileController(new File(configuration.getRoot()), configuration.getFolderSeparator());

IControllable controller =
new LocalFileController(new File(configuration.getRoot()), configuration.getFolderSeparator());
NamingService ns = new NamingService(controller, configuration);
ns.start();
ns.start(wipeExistent);
}

}
2 changes: 1 addition & 1 deletion src/test/java/communication/CommunicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void setUp() throws Exception {

controller = new LocalFileController(new File(configuration.getRoot()), configuration.getFolderSeparator());
ns = new NamingService(controller, configuration);
ns.start();
ns.start(false);

sender = new NamespaceSender(ns, configuration.getAddress(), configuration.getPort(), null, null);

Expand Down

0 comments on commit b16796e

Please sign in to comment.