Examples of HolidayHistoryRequest


Examples of com.opengamma.master.holiday.HolidayHistoryRequest

  }

  @Test
  public void test_history_versionsTo_postSecond() {
    ObjectId oid = ObjectId.of("DbHol", "201");
    HolidayHistoryRequest request = new HolidayHistoryRequest(oid);
    request.setVersionsToInstant(_version2Instant.plusSeconds(5));
    HolidayHistoryResult test = _holMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

    assertEquals(base.getVersionToInstant(), old.getVersionToInstant());
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(now, old.getCorrectionToInstant())// old version ended
    assertEquals(base.getHoliday(), old.getHoliday());
   
    HolidayHistoryRequest search = new HolidayHistoryRequest(base.getUniqueId(), now, null);
    HolidayHistoryResult searchResult = _holMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

    assertEquals(now, old.getVersionToInstant())// old version ended
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(base.getCorrectionToInstant(), old.getCorrectionToInstant());
    assertEquals(base.getHoliday(), old.getHoliday());
   
    HolidayHistoryRequest search = new HolidayHistoryRequest(base.getUniqueId(), null, now);
    HolidayHistoryResult searchResult = _holMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

    }
  }

  @Override
  protected AbstractHistoryResult<HolidayDocument> historyByVersionsCorrections(AbstractHistoryRequest request) {
    HolidayHistoryRequest historyRequest = new HolidayHistoryRequest();
    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

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

  public Response getJSON(
      @QueryParam("pgIdx") Integer pgIdx,
      @QueryParam("pgNum") Integer pgNum,
      @QueryParam("pgSze") Integer pgSze) {
    PagingRequest pr = buildPagingRequest(pgIdx, pgNum, pgSze);
    HolidayHistoryRequest request = new HolidayHistoryRequest(data().getHoliday().getUniqueId());
    request.setPagingRequest(pr);
    HolidayHistoryResult result = data().getHolidayMaster().history(request);
   
    FlexiBean out = createRootData();
    out.put("versionsResult", result);
    out.put("versions", result.getHolidays());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

    UniqueId oid = UniqueId.parse(idStr);
    try {
      HolidayDocument doc = data().getHolidayMaster().get(oid);
      data().setHoliday(doc);
    } catch (DataNotFoundException ex) {
      HolidayHistoryRequest historyRequest = new HolidayHistoryRequest(oid);
      historyRequest.setPagingRequest(PagingRequest.ONE);
      HolidayHistoryResult historyResult = data().getHolidayMaster().history(historyRequest);
      if (historyResult.getDocuments().size() == 0) {
        return null;
      }
      data().setHoliday(historyResult.getFirstDocument());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayHistoryRequest

  //-------------------------------------------------------------------------
  @GET
  @Path("versions")
  public Response history(@Context UriInfo uriInfo) {
    HolidayHistoryRequest request = RestUtils.decodeQueryParams(uriInfo, HolidayHistoryRequest.class);
    if (getUrlId().equals(request.getObjectId()) == false) {
      throw new IllegalArgumentException("Document objectId does not match URI");
    }
    HolidayHistoryResult result = getMaster().history(request);
    return responseOkFudge(result);
  }
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.