Package com.opengamma.master.config

Examples of com.opengamma.master.config.ConfigSearchRequest


  }
 
  @SuppressWarnings({"rawtypes", "unchecked" })
  protected void outputFilesForConfigClass(Class<?> clazz) throws IOException {
    System.out.println("Outputting files for " + clazz);
    ConfigSearchRequest searchRequest = new ConfigSearchRequest(clazz);
    ConfigSearchResult searchResult = getConfigMaster().search(searchRequest);
    Set<ConfigDocument> latest = new HashSet<ConfigDocument>();
    for (Object documentObject : searchResult.getDocuments()) {
      ConfigDocument document = (ConfigDocument) documentObject;
      latest.add(getConfigMaster().get(document.getObjectId(), VersionCorrection.LATEST));
View Full Code Here


  @SuppressWarnings("unchecked")
  private FlexiBean search(PagingRequest request, ConfigSearchSortOrder so, String name,
      String typeName, List<String> configIdStrs, UriInfo uriInfo) {
    FlexiBean out = createRootData();
   
    @SuppressWarnings("rawtypes")
    ConfigSearchRequest searchRequest = new ConfigSearchRequest();
    typeName = StringUtils.trimToNull(typeName);
    if (typeName != null) {
      Class<?> typeClazz = data().getTypeMap().get(typeName);
      searchRequest.setType(typeClazz);
    } else {
      searchRequest.setType(Object.class);
    }
    searchRequest.setPagingRequest(request);
    searchRequest.setSortOrder(so);
    searchRequest.setName(StringUtils.trimToNull(name));
    out.put("searchRequest", searchRequest);
    out.put("type", typeName);
    for (String configIdStr : configIdStrs) {
      searchRequest.addConfigId(ObjectId.parse(configIdStr));
    }
   
    if (data().getUriInfo().getQueryParameters().size() > 0) {
      ConfigSearchResult<Object> searchResult = null;
      if (searchRequest.getType() != null) {
        searchResult = data().getConfigMaster().search(searchRequest);
      } else {
        searchResult = new ConfigSearchResult<Object>();
        searchResult.setPaging(Paging.of(searchRequest.getPagingRequest(), searchResult.getDocuments()));
      }
      out.put("searchResult", searchResult);
      out.put("paging", new WebPaging(searchResult.getPaging(), uriInfo));
    }
    return out;
View Full Code Here

                                 EHCachingSearchCache.extractUniqueIds(result.getDocuments()));
      }
    });
   
    // Prime search cache
    ConfigSearchRequest defaultSearch = new ConfigSearchRequest();
    defaultSearch.setSortOrder(ConfigSearchSortOrder.NAME_ASC);
    _documentSearchCache.prefetch(defaultSearch, PagingRequest.FIRST_PAGE);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.config.ConfigSearchRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.