public List<QueryResult<R>> get(String studyStr, List<String> entryList, Query query, QueryOptions options, boolean silent, String sessionId) throws CatalogException { List<QueryResult<R>> resultList = new ArrayList<>(entryList.size()); query = ParamUtils.defaultObject(query, Query::new); for (String entry : entryList) { Query queryCopy = new Query(query); try { MyResource<R> resource = getUid(entry, studyStr, sessionId); queryCopy.put("uid", resource.getResource().getUid()); QueryResult<R> rQueryResult = get(resource.getStudy().getFqn(), queryCopy, options, sessionId); rQueryResult.setId(entry); resultList.add(rQueryResult); } catch (CatalogException e) { if (silent) { resultList.add(new QueryResult<>(entry, 0, 0, 0, "", e.toString(), new ArrayList<>(0))); } else { throw e; } } } return resultList; }
/** * Fetch the R object. * * @param studyStr Study id in string format. Could be one of [id|user@aliasProject:aliasStudy|aliasProject:aliasStudy|aliasStudy]. * @param entryStr Entry id to be fetched. * @param options QueryOptions object, like "include", "exclude", "limit" and "skip". * @param sessionId sessionId * @return All matching elements. * @throws CatalogException CatalogException. */ public QueryResult<R> get(String studyStr, String entryStr, QueryOptions options, String sessionId) throws CatalogException { Query query = new Query(); MyResource resources = getUid(entryStr, studyStr, sessionId); query.put("uid", resources.getResource().getUid()); return get(studyStr, query, options, sessionId); }