Package com.opengamma.master.orgs

Examples of com.opengamma.master.orgs.OrganizationSearchResult


    List<OrganizationDocument> documents = new ArrayList<>();
    for (UniqueId uniqueId : pair.getSecond()) {
      documents.add(get(uniqueId));
    }

    OrganizationSearchResult result = new OrganizationSearchResult(documents);
    result.setPaging(Paging.of(request.getPagingRequest(), pair.getFirst()));

    final VersionCorrection vc = request.getVersionCorrection().withLatestFixed(Instant.now());
    result.setVersionCorrection(vc);

    // Debug: check result against underlying
    if (EHCachingSearchCache.TEST_AGAINST_UNDERLYING) {
      OrganizationSearchResult check = ((OrganizationMaster) getUnderlying()).search(request);
      if (!result.getPaging().equals(check.getPaging())) {
        s_logger.error(_documentSearchCache.getCache().getName()
                           + "\n\tCache:\t" + result.getPaging()
                           + "\n\tUnderlying:\t" + check.getPaging());
      }
      if (!result.getDocuments().equals(check.getDocuments())) {
        System.out.println(_documentSearchCache.getCache().getName() + ": ");
        if (check.getDocuments().size() != result.getDocuments().size()) {
          System.out.println("\tSizes differ (Underlying " + check.getDocuments().size()
                             + "; Cache " + result.getDocuments().size() + ")");
        } else {
          for (int i = 0; i < check.getDocuments().size(); i++) {
            if (!check.getDocuments().get(i).equals(result.getDocuments().get(i))) {
              System.out.println("\tUnderlying\t" + i + ":\t" + check.getDocuments().get(i).getUniqueId());
              System.out.println("\tCache     \t" + i + ":\t" + result.getDocuments().get(i).getUniqueId());
            }
          }
        }
      }
View Full Code Here


      searchRequest.addOrganizationObjectId(ObjectId.parse(organizationIdStr));
    }
    out.put("searchRequest", searchRequest);
   
    if (data().getUriInfo().getQueryParameters().size() > 0) {
      OrganizationSearchResult searchResult = data().getOrganizationMaster().search(searchRequest);
      out.put("searchResult", searchResult);
      out.put("paging", new WebPaging(searchResult.getPaging(), uriInfo));
    }
    return out;
  }
View Full Code Here

    ExternalId underlyingId = security.getUnderlyingId();
    if (underlyingId != null) {
      OrganizationSearchRequest request = new OrganizationSearchRequest();
      if (underlyingId.getScheme().equals(ExternalSchemes.MARKIT_RED_CODE)) {
        request.setObligorREDCode(underlyingId.getValue());
        OrganizationSearchResult searchResult = _organizationMaster.search(request);
        ManageableOrganization organization = searchResult.getSingleOrganization();
        if (organization != null) {
          _out.put("underlyingOrganization", organization);
        }
      } else {
        s_logger.warn("{} does not currently support CDSOption underlying lookup based on {}", WebSecuritiesResource.class, underlyingId.getScheme().getName());
View Full Code Here

TOP

Related Classes of com.opengamma.master.orgs.OrganizationSearchResult

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.