use of no.cantara.docsite.domain.config.RepositoryConfigLoader in project SourceCodePortal by Cantara.
the class Application method initialize.
public static Application initialize(DynamicConfiguration configuration, int port) {
String host = configuration.evaluateToString("http.host");
CacheStore cacheStore = CacheInitializer.initialize(configuration);
ExecutorService executorService = ExecutorService.create();
ScheduledExecutorService scheduledExecutorService = ScheduledExecutorService.create(configuration, executorService, cacheStore);
RepositoryConfigLoader configLoader = new RepositoryConfigLoader(configuration, cacheStore);
ApplicationController applicationController = new ApplicationController(configuration.evaluateToString("http.cors.allow.origin"), configuration.evaluateToString("http.cors.allow.header"), configuration.evaluateToBoolean("http.cors.allow.origin.test"), port, configuration, executorService, scheduledExecutorService, cacheStore);
return new Application(configuration, host, port, executorService, scheduledExecutorService, cacheStore, configLoader, applicationController);
}
use of no.cantara.docsite.domain.config.RepositoryConfigLoader in project SourceCodePortal by Cantara.
the class GitHubPageServiceTest method testName.
@Ignore
// (enabled = false)
@Test
public void testName() {
ExecutorService executorService = ExecutorService.create();
executorService.start();
DynamicConfiguration configuration = configuration();
CacheStore cacheStore = cacheStore(configuration);
RepositoryConfigLoader loader = new RepositoryConfigLoader(configuration, cacheStore);
loader.load();
cacheStore.getRepositories().forEach(rg -> {
// TODO lookup CacheGroupKey for CacheKey and pass that to worker task
// TODO use CacheGroupKey for pages
// executorService.queue(new FetchPageTask(configuration, executorService, cacheStore, rg.getKey(), rg.getValue().readmeURL));
LOG.trace("{} - {}", rg.getKey(), rg.getValue().apiReadmeURL.getExternalURL());
// cacheStore.getReadmeContents().get(cacheStore.getCacheKeys().get(rg.getKey().asCacheKey()));
});
executorService.shutdown();
}
use of no.cantara.docsite.domain.config.RepositoryConfigLoader in project SourceCodePortal by Cantara.
the class ScmRepositoryServiceTest method testRepositoryService.
@Ignore
@Test
public void testRepositoryService() {
DynamicConfiguration configuration = configuration();
CacheStore cacheStore = cacheStore(configuration);
RepositoryConfigLoader loader = new RepositoryConfigLoader(configuration, cacheStore);
cacheStore.getRepositoryConfig().getConfig().repos.forEach((k, v) -> {
LOG.trace("configRepo: {}", v);
});
loader.load();
ScmRepositoryService service = new ScmRepositoryService(cacheStore);
service.keySet().forEach(k -> {
// LOG.trace("key: {}", k);
});
// service.sortedEntrySet().entrySet().forEach(entry -> {
// LOG.trace("group: {} -- count: {}", entry.getKey().groupId, entry.getValue().size());
// entry.getValue().forEach(scmRepository -> {
// LOG.trace(" {}", scmRepository.cacheRepositoryKey.repoName );
// });
// });
service.groupedRepositories().forEach((k, v) -> {
if (k.isGroup()) {
LOG.trace("isGroup: {}", k.groupId);
v.forEach(r -> {
LOG.trace(" {}", r);
// LOG.trace(" {}", r.cacheRepositoryKey.repoName);
});
}
});
}
Aggregations