Examples of OrganizationHistoryRequest


Examples of com.opengamma.master.orgs.OrganizationHistoryRequest


  @Test
  public void test_history_versionsTo_preFirst() {
    ObjectId oid = ObjectId.of("DbOrg", "201");
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.minusSeconds(5));
    OrganizationHistoryResult test = _orgMaster.history(request);

    assertEquals(0, test.getPaging().getTotalItems());

    assertEquals(0, test.getDocuments().size());
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

  }

  @Test
  public void test_history_versionsTo_firstToSecond() {
    ObjectId oid = ObjectId.of("DbOrg", "201");
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.plusSeconds(5));
    OrganizationHistoryResult test = _orgMaster.history(request);

    assertEquals(1, test.getPaging().getTotalItems());

    assertEquals(1, test.getDocuments().size());
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

  }

  @Test
  public void test_history_versionsTo_postSecond() {
    ObjectId oid = ObjectId.of("DbOrg", "201");
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(oid);
    request.setVersionsToInstant(_version2Instant.plusSeconds(5));
    OrganizationHistoryResult test = _orgMaster.history(request);

    assertEquals(2, test.getPaging().getTotalItems());

    assertEquals(2, test.getDocuments().size());
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

    assertEquals(base.getVersionToInstant(), old.getVersionToInstant());
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(now, old.getCorrectionToInstant())// old version ended
    assertEquals(base.getOrganization(), old.getOrganization());

    OrganizationHistoryRequest search = new OrganizationHistoryRequest(base.getUniqueId(), now, null);
    OrganizationHistoryResult searchResult = _orgMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

  }

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

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

  //-------------------------------------------------------------------------
  @Produces(MediaType.TEXT_HTML)
  @GET
  public String getHTML() {
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(data().getOrganization().getUniqueId());
    OrganizationHistoryResult result = data().getOrganizationMaster().history(request);
   
    FlexiBean out = createRootData();
    out.put("versionsResult", result);
    out.put("versions", result.getOrganizations());
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

  public Response getJSON(
      @QueryParam("pgIdx") Integer pgIdx,
      @QueryParam("pgNum") Integer pgNum,
      @QueryParam("pgSze") Integer pgSze) {
    PagingRequest pr = buildPagingRequest(pgIdx, pgNum, pgSze);
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(data().getOrganization().getUniqueId());
    request.setPagingRequest(pr);
    OrganizationHistoryResult result = data().getOrganizationMaster().history(request);
   
    FlexiBean out = createRootData();
    out.put("versionsResult", result);
    out.put("versions", result.getOrganizations());
View Full Code Here

Examples of com.opengamma.master.orgs.OrganizationHistoryRequest

    UniqueId oid = UniqueId.parse(idStr);
    try {
      OrganizationDocument doc = data().getOrganizationMaster().get(oid);
      data().setOrganization(doc);
    } catch (DataNotFoundException ex) {
      OrganizationHistoryRequest historyRequest = new OrganizationHistoryRequest(oid);
      historyRequest.setPagingRequest(PagingRequest.ONE);
      OrganizationHistoryResult historyResult = data().getOrganizationMaster().history(historyRequest);
      if (historyResult.getDocuments().size() == 0) {
        return null;
      }
      data().setOrganization(historyResult.getFirstDocument());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.