public Set<ProjectModel> getRootProjectModels() { Iterable<FileModel> fileModelIterable = WindupConfigurationService.getConfigurationModel(this.getGraphContext()).getInputPaths(); return StreamSupport.stream(fileModelIterable.spliterator(), false) .map(FileModel::getProjectModel) .filter(Objects::nonNull) .collect(Collectors.toSet()); } }
public static Path getArchivesPath(final GraphContext graphContext) { WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(graphContext); String windupOutputFolder = cfg.getOutputPath().getFilePath(); return Paths.get(windupOutputFolder, ARCHIVES); }
@Override public void perform(GraphRewrite event, EvaluationContext context, WindupConfigurationModel payload) { ProjectModel projectModel = payload.getInputPath().getProjectModel(); if (projectModel == null) { throw new WindupException("Error, no project found in: " + payload.getInputPath().getFilePath()); } createApplicationReport(event.getGraphContext(), projectModel); }
@Override public void perform(GraphRewrite event, EvaluationContext context) { WindupConfigurationModel conf = WindupConfigurationService.getConfigurationModel(event.getGraphContext()); int inputApplicationCount = Iterables.size(conf.getInputPaths()); if (inputApplicationCount > 1) { createGlobalMigrationIssuesReport(event.getGraphContext(), conf.isExportingCSV()); } for (FileModel inputPath : conf.getInputPaths()) { ApplicationReportModel report = createSingleApplicationMigrationIssuesReport(event.getGraphContext(), inputPath.getProjectModel()); report.setMainApplicationReport(false); } }
configurationModel.setInputPaths(inputPathModels); List<String> applicationNames = configuration.getInputApplicationNames(); GraphService<ApplicationModel> applicationModelService = new GraphService<>(context, ApplicationModel.class); configurationModel.setOutputPath(getFileModel(context, configuration.getOutputDirectory())); configurationModel.setOnlineMode(configuration.isOnline()); configurationModel.setExportingCSV(configuration.isExportingCSV()); configurationModel.setKeepWorkDirectories(configuration.getOptionValue(KeepWorkDirsOption.NAME)); for (Path path : configuration.getAllUserRulesDirectories()) + configuration.getAllUserRulesDirectories() + ")"); configurationModel.addUserRulesPath(getFileModel(context, path)); configurationModel.addUserIgnorePath(getFileModel(context, path));
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { GraphService<WindupConfigurationModel> service = new GraphService<>(event.getGraphContext(),WindupConfigurationModel.class); final WindupConfigurationModel windupConfiguration = service.findAll().iterator().next(); return windupConfiguration.isOnlineMode(); } }
public void loadPackageMappings(Path rulesPath) { try (GraphContext graphContext = graphContextFactory.create(false)) { WindupConfigurationModel configurationModel = WindupConfigurationService.getConfigurationModel(graphContext); FileModel windupRulesPath = new FileService(graphContext).createByFilePath(rulesPath.toString()); configurationModel.addUserRulesPath(windupRulesPath); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(Collections.singleton(rulesPath), null); RuleProviderRegistry registry = cache.getRuleProviderRegistry(ruleLoaderContext); this.event = new GraphRewrite(graphContext); RuleSubset ruleSubset = RuleSubset.create(registry.getConfiguration()); new RuleVisit(ruleSubset).accept((r) -> { if (r instanceof PackageNameMapping) { ((PackageNameMapping) r).preRulesetEvaluation(event); } }); graphContext.clear(); } catch (Exception e) { LOG.log(Level.WARNING, "Failed to load rule information due to: " + e.getMessage(), e); } } }
.getGraphContext()); final List<Path> filesUrl = new ArrayList<>(); for (FileModel ignoredRegexesFileModel : payload.getUserIgnorePaths())
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) boolean onlineMode = WindupConfigurationService.getConfigurationModel(event.getGraphContext()).isOnlineMode(); boolean validationFailed = false; try
public void loadPackageMappings(Path rulesPath) { try (GraphContext graphContext = graphContextFactory.create(false)) { WindupConfigurationModel configurationModel = WindupConfigurationService.getConfigurationModel(graphContext); FileModel windupRulesPath = new FileService(graphContext).createByFilePath(rulesPath.toString()); configurationModel.addUserRulesPath(windupRulesPath); RuleLoaderContext ruleLoaderContext = new RuleLoaderContext(Collections.singleton(rulesPath), null); RuleProviderRegistry registry = cache.getRuleProviderRegistry(ruleLoaderContext); this.event = new GraphRewrite(graphContext); RuleSubset ruleSubset = RuleSubset.create(registry.getConfiguration()); new RuleVisit(ruleSubset).accept((r) -> { if (r instanceof PackageNameMapping) { ((PackageNameMapping) r).preRulesetEvaluation(event); } }); graphContext.clear(); } catch (Exception e) { LOG.log(Level.WARNING, "Failed to load rule information due to: " + e.getMessage(), e); } } }
.getGraphContext()); final List<Path> filesUrl = new ArrayList<>(); for (FileModel ignoredRegexesFileModel : payload.getUserIgnorePaths())
public Set<ProjectModel> getRootProjectModels() { Iterable<FileModel> fileModelIterable = WindupConfigurationService.getConfigurationModel(this.getGraphContext()).getInputPaths(); return StreamSupport.stream(fileModelIterable.spliterator(), false) .map(FileModel::getProjectModel) .filter(Objects::nonNull) .collect(Collectors.toSet()); } }
public static Path getArchivesPath(final GraphContext graphContext) { WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(graphContext); String windupOutputFolder = cfg.getOutputPath().getFilePath(); return Paths.get(windupOutputFolder, ARCHIVES); }
@Override public void perform(GraphRewrite event, EvaluationContext context, WindupConfigurationModel payload) { ProjectModel projectModel = payload.getInputPath().getProjectModel(); if (projectModel == null) { throw new WindupException("Error, no project found in: " + payload.getInputPath().getFilePath()); } createApplicationReport(event.getGraphContext(), projectModel); }
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) boolean onlineMode = WindupConfigurationService.getConfigurationModel(event.getGraphContext()).isOnlineMode(); boolean validationFailed = false; try
/** * If this is in the input directory, return the input directory. Otherwise, return null. */ private String getInputPathForSource(WindupConfigurationModel configuration, String javaPath) { for (FileModel input : configuration.getInputPaths()) { if (javaPath.startsWith(input.getFilePath())) return input.getFilePath(); } return null; }
public static Path getArchivesDirLocation(final GraphContext graphContext) { WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(graphContext); String windupOutputFolder = cfg.getOutputPath().getFilePath(); return Paths.get(windupOutputFolder, ARCHIVES); }
@Override public void perform(GraphRewrite event, EvaluationContext context) { WindupConfigurationModel windupConfiguration = WindupConfigurationService.getConfigurationModel(event.getGraphContext()); ProjectModel projectModel = windupConfiguration.getInputPath().getProjectModel(); if (projectModel == null) { throw new WindupException("Error, no project found in: " + windupConfiguration.getInputPath().getFilePath()); } createSpringBeanReport(event.getGraphContext(), projectModel); }
/** * If this is in the input directory, return the input directory. Otherwise, return null. */ private String getInputPathForSource(WindupConfigurationModel configuration, String javaPath) { for (FileModel input : configuration.getInputPaths()) { if (javaPath.startsWith(input.getFilePath())) return input.getFilePath(); } return null; }
public static Path getArchivesDirLocation(final GraphContext graphContext) { WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(graphContext); String windupOutputFolder = cfg.getOutputPath().getFilePath(); return Paths.get(windupOutputFolder, ARCHIVES); }