Example usage for org.springframework.batch.support PatternMatcher match

List of usage examples for org.springframework.batch.support PatternMatcher match

Introduction

In this page you can find the example usage for org.springframework.batch.support PatternMatcher match.

Prototype

public static boolean match(String pattern, String str) 

Source Link

Document

Lifted from AntPathMatcher in Spring Core.

Usage

From source file:admin.service.JdbcSearchableStepExecutionDao.java

public Collection<String> findStepNamesForJobExecution(String jobName, String excludesPattern) {

    List<String> list = getJdbcTemplate().query(getQuery(STEP_EXECUTIONS_FOR_JOB), new RowMapper<String>() {
        public String mapRow(java.sql.ResultSet rs, int rowNum) throws java.sql.SQLException {
            return rs.getString(1);
        }//from w ww  .  jav a 2 s .co m
    }, jobName);

    Set<String> stepNames = new LinkedHashSet<String>(list);
    for (Iterator<String> iterator = stepNames.iterator(); iterator.hasNext();) {
        String name = iterator.next();
        if (PatternMatcher.match(excludesPattern, name)) {
            iterator.remove();
        }
    }

    return stepNames;

}