@Override public ConditionBuilder when() { return Query.fromType(XmlFileModel.class).withProperty(XmlFileModel.ROOT_TAG_NAME, "beans"); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { QueryBuilderFind q = Query.fromType(InlineHintModel.class); if (StringUtils.isNotBlank(filename)) { q.piped(new QueryGremlinCriterion() { private static final String HINT_STEP = "hintModel"; @Override public void query(GraphRewrite event, GraphTraversal<?, Vertex> pipeline) { pipeline.as(HINT_STEP); pipeline.out(InlineHintModel.FILE_MODEL); pipeline.has(FileModel.FILE_NAME, filename); pipeline.select(HINT_STEP); } }); } q.withProperty(InlineHintModel.HINT, QueryPropertyComparisonType.REGEX, messagePattern); return q.evaluate(event, context); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { QueryBuilderFind q = Query.fromType(OverviewReportLineMessageModel.class); q.withProperty(OverviewReportLineMessageModel.PROPERTY_MESSAGE, QueryPropertyComparisonType.REGEX, messagePattern); return q.evaluate(event, context); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(WindupConfigurationModel.class) .piped((GraphRewrite event, GraphTraversal<?, Vertex> pipeline) -> { pipeline.out(WindupConfigurationModel.INPUT_PATH); pipeline.has(FileModel.IS_DIRECTORY, true); }) ) .perform(new RecurseDirectoryAndAddFiles()) .addRule() .when(Query.fromType(FileModel.class) .withProperty(FileModel.IS_DIRECTORY, false) .withProperty(FileModel.FILE_PATH, QueryPropertyComparisonType.REGEX, ZipUtil.getEndsWithZipRegularExpression()) ) .perform( new AddArchiveReferenceInformation() ); } // @formatter:on
@Override public ConditionBuilder when() { QueryGremlinCriterion doctypeSearchCriterion = new QueryGremlinCriterion() { @Override public void query(GraphRewrite event, GraphTraversal<?, Vertex> pipeline) { pipeline.has(DoctypeMetaModel.PROPERTY_PUBLIC_ID, Text.textRegex(REGEX_HIBERNATE)); Traversal<?, ?> systemIDQuery = event.getGraphContext().getQuery(DoctypeMetaModel.class) .getRawTraversal() .has(DoctypeMetaModel.PROPERTY_SYSTEM_ID, Text.textRegex(REGEX_HIBERNATE)); GraphTraversal<Vertex, Vertex> systemIdPipeline = new GraphTraversalSource(event.getGraphContext().getGraph()).V(systemIDQuery.toList()); pipeline.union(systemIdPipeline); pipeline.dedup(); } }; return Query.fromType(DoctypeMetaModel.class).piped(doctypeSearchCriterion); }
protected ConditionBuilder when() { return Query.fromType(JNDIResourceModel.class).or(Query.fromType(ThreadPoolModel.class)); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(ArchiveModel.class).excludingType(IgnoredArchiveModel.class)) .perform( UnzipArchiveToOutputFolder.unzip(), IterationProgress.monitoring("Unzipped archive", 1), Commit.every(1) ) .addRule() .when(Query.fromType(ArchiveModel.class).excludingType(DuplicateArchiveModel.class)) .perform(new DuplicateArchiveOperation()); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { Boolean generateReport = (Boolean)event.getGraphContext().getOptionMap().get(EnableCompatibleFilesReportOption.NAME); if (generateReport == null) generateReport = false; return generateReport && Query.fromType(WindupConfigurationModel.class).evaluate(event, context); } };
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { QueryBuilderFind q = Query.fromType(FileModel.class); q.withProperty(FileModel.FILE_NAME,filename); return q.evaluate(event, context); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(WindupConfigurationModel.class) .piped((GraphRewrite event, GraphTraversal<?, Vertex> pipeline) -> { pipeline.out(WindupConfigurationModel.INPUT_PATH); pipeline.has(FileModel.IS_DIRECTORY, true); }) ) .perform(new RecurseDirectoryAndAddFiles()) .addRule() .when(Query.fromType(FileModel.class) .withProperty(FileModel.IS_DIRECTORY, false) .withProperty(FileModel.FILE_PATH, QueryPropertyComparisonType.REGEX, ZipUtil.getEndsWithZipRegularExpression()) ) .perform( new AddArchiveReferenceInformation() ); } // @formatter:on
@Override public ConditionBuilder when() { QueryGremlinCriterion doctypeSearchCriterion = new QueryGremlinCriterion() { @Override public void query(GraphRewrite event, GremlinPipeline<Vertex, Vertex> pipeline) { pipeline.has(DoctypeMetaModel.PROPERTY_PUBLIC_ID, Text.REGEX, hibernateRegex); FramedGraphQuery systemIDQuery = event.getGraphContext().getQuery().type(DoctypeMetaModel.class) .has(DoctypeMetaModel.PROPERTY_SYSTEM_ID, Text.REGEX, hibernateRegex); GremlinPipeline<Vertex, Vertex> systemIdPipeline = new GremlinPipeline<>(systemIDQuery.vertices()); pipeline.add(systemIdPipeline); pipeline.dedup(); } }; return Query.fromType(DoctypeMetaModel.class).piped(doctypeSearchCriterion); }
protected ConditionBuilder when() { return Query.fromType(JNDIResourceModel.class).or(Query.fromType(ThreadPoolModel.class)); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(ArchiveModel.class).excludingType(IgnoredArchiveModel.class)) .perform( UnzipArchiveToOutputFolder.unzip(), IterationProgress.monitoring("Unzipped archive", 1), Commit.every(1) ) .addRule() .when(Query.fromType(ArchiveModel.class).excludingType(DuplicateArchiveModel.class)) .perform(new DuplicateArchiveOperation()); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { Boolean generateReport = (Boolean)event.getGraphContext().getOptionMap().get(EnableCompatibleFilesReportOption.NAME); if (generateReport == null) generateReport = false; return generateReport && Query.fromType(WindupConfigurationModel.class).evaluate(event, context); } };
@Override public ConditionBuilder when() { return Query.fromType(XmlFileModel.class).withProperty(XmlFileModel.ROOT_TAG_NAME, DATASOURCES_ROOT_TAG); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { QueryBuilderFind q = Query.fromType(InlineHintModel.class); if (StringUtils.isNotBlank(filename)) { q.piped(new QueryGremlinCriterion() { private static final String HINT_STEP = "hintModel"; @Override public void query(GraphRewrite event, GraphTraversal<?, Vertex> pipeline) { pipeline.as(HINT_STEP); pipeline.out(InlineHintModel.FILE_MODEL); pipeline.has(FileModel.FILE_NAME, filename); pipeline.select(HINT_STEP); } }); } q.withProperty(InlineHintModel.HINT, QueryPropertyComparisonType.REGEX, messagePattern); return q.evaluate(event, context); }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { QueryBuilderFind q = Query.fromType(FileModel.class); q.withProperty(FileModel.FILE_NAME,filename); return q.evaluate(event, context); }
@Override public ConditionBuilder when() { QueryGremlinCriterion doctypeSearchCriterion = new QueryGremlinCriterion() { @Override public void query(GraphRewrite event, GraphTraversal<?, Vertex> pipeline) { pipeline.has(DoctypeMetaModel.PROPERTY_PUBLIC_ID, Text.textRegex(REGEX_HIBERNATE)); Traversal<?, ?> systemIDQuery = event.getGraphContext().getQuery(DoctypeMetaModel.class) .getRawTraversal().has(DoctypeMetaModel.PROPERTY_SYSTEM_ID, Text.textRegex(REGEX_HIBERNATE)); GraphTraversal<Vertex, Vertex> systemIdPipeline = new GraphTraversalSource(event.getGraphContext().getGraph()).V(systemIDQuery.toList()); pipeline.union(systemIdPipeline); pipeline.dedup(); } }; return Query.fromType(DoctypeMetaModel.class).piped(doctypeSearchCriterion); }
@Override public Configuration getConfiguration(GraphContext context) { ConditionBuilder applicationProjectModelsFound = Query.fromType(HibernateConfigurationFileModel.class).or( Query.fromType(HibernateEntityModel.class)); GraphOperation addReport = new GraphOperation() { @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()); } createHibernateReport(event.getGraphContext(), projectModel); } @Override public String toString() { return "CreateHibernateReport"; } }; return ConfigurationBuilder.begin() .addRule() .when(applicationProjectModelsFound) .perform(addReport); }
@Override public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin().addRule() .when(Query.fromType(ArchiveModel.class).excludingType(IgnoredArchiveModel.class)) .perform(UnzipArchiveToOutputFolder.unzip() .and(IterationProgress.monitoring("Unzipped archive: ", 1)) .and(Commit.every(1)) ); } }