コード例 #1
0
 protected String config2resourceType(MappingType type) {
   if (MappingType.INCLUSION.equals(type)) {
     return RepositoryRouteResource.INCLUSION_RULE_TYPE;
   } else if (MappingType.EXCLUSION.equals(type)) {
     return RepositoryRouteResource.EXCLUSION_RULE_TYPE;
   } else if (MappingType.BLOCKING.equals(type)) {
     return RepositoryRouteResource.BLOCKING_RULE_TYPE;
   } else {
     return null;
   }
 }
コード例 #2
0
  protected CPathMappingItem convert(RepositoryPathMapping item) {
    String routeType = null;

    if (MappingType.BLOCKING.equals(item.getMappingType())) {
      routeType = CPathMappingItem.BLOCKING_RULE_TYPE;
    } else if (MappingType.INCLUSION.equals(item.getMappingType())) {
      routeType = CPathMappingItem.INCLUSION_RULE_TYPE;
    } else if (MappingType.EXCLUSION.equals(item.getMappingType())) {
      routeType = CPathMappingItem.EXCLUSION_RULE_TYPE;
    }

    CPathMappingItem result = new CPathMappingItem();
    result.setId(item.getId());
    result.setGroupId(item.getGroupId());
    result.setRepositories(item.getMappedRepositories());
    result.setRouteType(routeType);
    ArrayList<String> patterns = new ArrayList<String>(item.getPatterns().size());
    for (Pattern pattern : item.getPatterns()) {
      patterns.add(pattern.toString());
    }
    result.setRoutePatterns(patterns);
    return result;
  }