use of org.batfish.coordinator.config.Settings in project batfish by batfish.
the class WorkMgrServiceV2Test method initContainerEnvironment.
@Before
public void initContainerEnvironment() throws Exception {
BatfishLogger logger = new BatfishLogger("debug", false);
Settings settings = new Settings(new String[] {});
Main.mainInit(new String[] { "-containerslocation", _folder.getRoot().toString() });
Main.setLogger(logger);
Main.initAuthorizer();
Main.setWorkMgr(new WorkMgr(settings, logger));
}
use of org.batfish.coordinator.config.Settings in project batfish by batfish.
the class WorkMgrTest method initManager.
@Before
public void initManager() throws Exception {
Settings settings = new Settings(new String[] {});
BatfishLogger logger = new BatfishLogger("debug", false);
Main.mainInit(new String[] { "-containerslocation", _folder.getRoot().toString() });
Main.setLogger(logger);
_manager = new WorkMgr(settings, logger);
}
use of org.batfish.coordinator.config.Settings in project batfish by batfish.
the class Main method mainInit.
public static void mainInit(String[] args) {
_settings = null;
try {
_settings = new Settings(args);
networkListenerLogger.setLevel(Level.WARNING);
httpServerLogger.setLevel(Level.WARNING);
} catch (Exception e) {
System.err.print("org.batfish.coordinator: Initialization failed: " + ExceptionUtils.getStackTrace(e));
System.exit(1);
}
}
use of org.batfish.coordinator.config.Settings in project batfish by batfish.
the class WorkMgrServiceTest method initContainerEnvironment.
private void initContainerEnvironment() throws Exception {
Settings settings = new Settings(new String[] {});
BatfishLogger logger = new BatfishLogger("debug", false);
Main.mainInit(new String[] { "-containerslocation", _containersFolder.getRoot().toString(), "-templatedirs", _questionsTemplatesFolder.getRoot().toString() });
Main.setLogger(logger);
Main.initAuthorizer();
WorkMgr manager = new WorkMgr(settings, logger);
Main.setWorkMgr(manager);
manager.initContainer(_containerName, null);
_service = new WorkMgrService();
}
use of org.batfish.coordinator.config.Settings in project batfish by batfish.
the class Main method initAuthorizer.
static void initAuthorizer() throws Exception {
Settings settings = getSettings();
Authorizer.Type type = settings.getAuthorizationType();
switch(type) {
case none:
_authorizer = NoneAuthorizer.INSTANCE;
break;
case file:
_authorizer = FileAuthorizer.createFromSettings(settings);
break;
case database:
_authorizer = DbAuthorizer.createFromSettings(settings);
break;
default:
System.err.print("org.batfish.coordinator: Initialization failed. Unsupported authorizer type " + type);
System.exit(1);
}
getLogger().infof("Using authorizer %s\n", _authorizer);
}
Aggregations