use of org.eclipse.winery.repository.backend.filebased.FilebasedRepository in project winery by eclipse.
the class RepositoryFactory method reconfigure.
public static void reconfigure(FileBasedRepositoryConfiguration fileBasedRepositoryConfiguration) {
RepositoryFactory.fileBasedRepositoryConfiguration = fileBasedRepositoryConfiguration;
RepositoryFactory.gitBasedRepositoryConfiguration = null;
RepositoryFactory.jCloudsConfiguration = null;
repository = new FilebasedRepository(fileBasedRepositoryConfiguration);
}
use of org.eclipse.winery.repository.backend.filebased.FilebasedRepository in project winery by eclipse.
the class WineryUsingHttpServer method main.
/**
* When in IntelliJ, /tmp/winery-repository is used. See /src/test/resources/winery.properties
*/
public static void main(String[] args) throws Exception {
// initialize repository
new Prefs(true);
Server server = createHttpServer();
server.start();
Server uiServer = createHttpServerForRepositoryUi();
uiServer.start();
IRepository repository = RepositoryFactory.getRepository();
if (repository instanceof FilebasedRepository) {
LOGGER.debug("Using path " + ((FilebasedRepository) repository).getRepositoryRoot());
} else {
LOGGER.debug("Repository is not filebased");
}
server.join();
uiServer.join();
}
use of org.eclipse.winery.repository.backend.filebased.FilebasedRepository in project winery by eclipse.
the class ServiceTemplateComplianceRuleRuleChecker method getRuleIds.
public List<ComplianceRuleId> getRuleIds(TServiceTemplate serviceTemplate) {
List<ComplianceRuleId> complianceRules = Lists.newArrayList();
Namespace namespace = new Namespace(serviceTemplate.getTargetNamespace(), false);
Collection<Namespace> componentsNamespaces = RepositoryFactory.getRepository().getComponentsNamespaces(ComplianceRuleId.class);
List<Namespace> relevantNamespaces = componentsNamespaces.stream().filter(ns -> namespace.getDecoded().startsWith(ns.getDecoded())).collect(Collectors.toList());
for (Namespace space : relevantNamespaces) {
complianceRules.addAll((Collection<? extends ComplianceRuleId>) ((FilebasedRepository) RepositoryFactory.getRepository()).getAllIdsInNamespace(ComplianceRuleId.class, space));
}
return complianceRules;
}
Aggregations