예제 #1
0
파일: GroupReader.java 프로젝트: nesi/hub
  private Observable<Thing<Group>> createGroups(
      Multimap<String, String> groups, Optional<String> groupMatcher) {

    if (groupMatcher.isPresent()) {
      return Observable.from(groups.keySet())
          .filter(groupName -> MatcherUtils.wildCardMatch(groupName, groupMatcher.get()))
          .map(groupName -> um.getAllGroups().get(groupName))
          // TODO make that work for non-project groups too
          .filter(group -> group != null)
          .map(group -> wrapGroup(group));
    } else {
      return Observable.from(groups.keySet())
          .map(groupName -> um.getAllGroups().get(groupName))
          // TODO make that work for non-project groups too
          .filter(group -> group != null)
          .map(group -> wrapGroup(group));
    }
  }
예제 #2
0
파일: GroupReader.java 프로젝트: nesi/hub
 @Override
 public Observable<? extends Thing<?>> findThingsMatchingTypeAndKey(String type, String key) {
   return Observable.from(um.getAllGroups().values())
       .filter(g -> MatcherUtils.wildCardMatch(g.getGroupName(), key))
       .map(g -> wrapGroup(g));
 }