Package com.opengamma.master.position

Examples of com.opengamma.master.position.PositionHistoryResult$Meta


    // Create the history search cache and register a security master searcher
    _historySearchCache = new EHCachingSearchCache(name + "PositionHistory", cacheManager, new EHCachingSearchCache.Searcher() {
      @Override
      public ObjectsPair<Integer, List<UniqueId>> search(Bean request, PagingRequest pagingRequest) {
        // Fetch search results from underlying master
        PositionHistoryResult result = ((PositionMaster) getUnderlying()).history((PositionHistoryRequest)
            EHCachingSearchCache.withPagingRequest(request, pagingRequest));

        // Cache the result documents
        EHCachingSearchCache.cacheDocuments(result.getDocuments(), getUidToDocumentCache());

        // Return the list of result UniqueIds
        return new ObjectsPair<>(result.getPaging().getTotalItems(),
                                 EHCachingSearchCache.extractUniqueIds(result.getDocuments()));
      }
    });
   
    // Prime search cache
    PositionSearchRequest defaultSearch = new PositionSearchRequest();
View Full Code Here


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

    PositionHistoryResult result = new PositionHistoryResult(documents);
    result.setPaging(Paging.of(request.getPagingRequest(), pair.getFirst()));
    return result;   
  }
View Full Code Here

  public Response history(@Context UriInfo uriInfo) {
    PositionHistoryRequest request = RestUtils.decodeQueryParams(uriInfo, PositionHistoryRequest.class);
    if (getUrlId().equals(request.getObjectId()) == false) {
      throw new IllegalArgumentException("Document objectId does not match URI");
    }
    PositionHistoryResult result = getMaster().history(request);
    return responseOkFudge(result);
  }
View Full Code Here

    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(now, old.getCorrectionToInstant())// old version ended
    assertEquals(base.getPosition(), old.getPosition());
   
    PositionHistoryRequest search = new PositionHistoryRequest(base.getUniqueId(), now, null);
    PositionHistoryResult searchResult = _posMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.position.PositionHistoryResult$Meta

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.