Package com.opengamma.master.marketdatasnapshot

Examples of com.opengamma.master.marketdatasnapshot.MarketDataSnapshotHistoryRequest$Meta


    }
  }

  @Override
  protected AbstractHistoryResult<MarketDataSnapshotDocument> historyByVersionsCorrections(AbstractHistoryRequest request) {
    MarketDataSnapshotHistoryRequest historyRequest = new MarketDataSnapshotHistoryRequest();
    historyRequest.setCorrectionsFromInstant(request.getCorrectionsFromInstant());
    historyRequest.setCorrectionsToInstant(request.getCorrectionsToInstant());
    historyRequest.setVersionsFromInstant(request.getVersionsFromInstant());
    historyRequest.setVersionsToInstant(request.getVersionsToInstant());
    historyRequest.setObjectId(request.getObjectId());
    return history(historyRequest);
  }
View Full Code Here


    }
    if (searchResult.getDocuments().size() == 0) {
      return Collections.emptyList();
    }
    ObjectId objectId = searchResult.getFirstDocument().getObjectId();
    MarketDataSnapshotHistoryResult historyResult = _snapshotMaster.history(new MarketDataSnapshotHistoryRequest(objectId));
    List<VersionInfo> results = new ArrayList<>();
    for (MarketDataSnapshotDocument doc : historyResult.getDocuments()) {
      results.add(new VersionInfo(doc.getVersionFromInstant(), doc.getCorrectionFromInstant(), doc.getVersionToInstant(), doc.getCorrectionToInstant(), doc.getUniqueId()));
    }
    return results;
View Full Code Here

  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("{snapshotId}")
  public String getMarketDataSnapshotHistory(@PathParam("snapshotId") String snapshotId) {
    ObjectId id = ObjectId.parse(snapshotId);
    MarketDataSnapshotHistoryResult result = _snapshotMaster.history(new MarketDataSnapshotHistoryRequest(id));
    List<MarketDataSnapshotDocument> documents = result.getDocuments();
    List<Map<String, Object>> json = Lists.newArrayListWithCapacity(documents.size());
    for (MarketDataSnapshotDocument document : documents) {
      Map<String, Object> map = Maps.newHashMapWithExpectedSize(5);
      map.put("uniqueId", document.getUniqueId());
View Full Code Here

    Map<String, Object> data = (Map<String, Object>) message.getData();
    String snapshotIdString = (String) data.get("snapshotId");
    UniqueId snapshotId = UniqueId.parse(snapshotIdString);

    MarketDataSnapshotHistoryRequest snapshotHistoryRequest = new MarketDataSnapshotHistoryRequest(snapshotId.getObjectId(), null, Instant.now());
    snapshotHistoryRequest.setIncludeData(false);
    MarketDataSnapshotHistoryResult snapshotSearchResult = _snapshotMaster.history(snapshotHistoryRequest);

    String[][] versions = new String[snapshotSearchResult.getDocuments().size()][2];
    int i = 0;
    for (MarketDataSnapshotDocument doc : snapshotSearchResult.getDocuments()) {
View Full Code Here

  }

  @GET
  @Path("versions")
  public Response history(@Context UriInfo uriInfo) {
    MarketDataSnapshotHistoryRequest request = RestUtils.decodeQueryParams(uriInfo, MarketDataSnapshotHistoryRequest.class);
    if (request.getObjectId() != null) {
      if (!request.getObjectId().equals(getUrlId())) {
        throw new IllegalArgumentException("Document objectId " + request.getObjectId() + " does not match URI " + getUrlId());
      }
    } else {
      request.setObjectId(getUrlId());
    }
    MarketDataSnapshotHistoryResult result = getMaster().history(request);
    return responseOkFudge(result);
  }
View Full Code Here

    MarketDataSnapshotDocument doc = result.getFirstDocument();
    assertEquals(_doc1.getUniqueId(), doc.getUniqueId());
  }

  public void test_history_emptyMaster() {
    MarketDataSnapshotHistoryRequest request = new MarketDataSnapshotHistoryRequest();
    request.setObjectId(_doc1.getUniqueId().getObjectId());
    MarketDataSnapshotHistoryResult result = _testEmpty.history(request);
    assertEquals(0, result.getPaging().getTotalItems());
    assertEquals(0, result.getDocuments().size());
  }
View Full Code Here

    assertEquals(0, result.getPaging().getTotalItems());
    assertEquals(0, result.getDocuments().size());
  }

  public void test_history_populatedMaster() {
    MarketDataSnapshotHistoryRequest request = new MarketDataSnapshotHistoryRequest();
    request.setObjectId(_doc1.getUniqueId().getObjectId());
    MarketDataSnapshotHistoryResult result = _testPopulated.history(request);
    assertEquals(1, result.getPaging().getTotalItems());
    assertEquals(1, result.getDocuments().size());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.marketdatasnapshot.MarketDataSnapshotHistoryRequest$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.