settings.overrideSetting(Keys.web.allowLuceneIndexing, false);
settings.overrideSetting(Keys.git.enableGarbageCollection, false);
settings.overrideSetting(Keys.git.enableMirroring, false);
settings.overrideSetting(Keys.web.activityCacheDays, 0);
IRuntimeManager runtimeManager = new RuntimeManager(settings, baseFolder).start();
IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, null).start();
String serviceName = settings.getString(Keys.tickets.service, BranchTicketService.class.getSimpleName());
if (StringUtils.isEmpty(serviceName)) {
System.err.println(MessageFormat.format("Please define a ticket service in \"{0}\"", Keys.tickets.service));
System.exit(1);
}
ITicketService ticketService = null;
try {
Class<?> serviceClass = Class.forName(serviceName);
if (RedisTicketService.class.isAssignableFrom(serviceClass)) {
// Redis ticket service
ticketService = new RedisTicketService(runtimeManager, null, null, null, repositoryManager).start();
} else if (BranchTicketService.class.isAssignableFrom(serviceClass)) {
// Branch ticket service
ticketService = new BranchTicketService(runtimeManager, null, null, null, repositoryManager).start();
} else if (FileTicketService.class.isAssignableFrom(serviceClass)) {
// File ticket service
ticketService = new FileTicketService(runtimeManager, null, null, null, repositoryManager).start();
} else {
System.err.println("Unknown ticket service " + serviceName);
System.exit(1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
ticketService.reindex();
ticketService.stop();
repositoryManager.stop();
runtimeManager.stop();
}